-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to compile ffmpeg as static PIE binary
Signed-off-by: Adrian-George Dumitrache <adrian.dumitrache02@stud.acs.upb.ro> Fixed formatting Signed-off-by: Adrian-George Dumitrache <adrian.dumitrache02@stud.acs.upb.ro>
- Loading branch information
1 parent
46635a4
commit 0f38c8c
Showing
5 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/ffmpeg-5.1.2/ | ||
/ffmpeg-5.1.2.tar.bz2* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Build ffmpeg as static PIE | ||
|
||
Script to build ffmpeg as a static PIE binary. | ||
|
||
## Requirements | ||
|
||
Make sure that you have the following packages installed: | ||
* GCC | ||
* GNU Make | ||
|
||
## Build | ||
|
||
Run the build.sh file. | ||
It will create a folder where the static PIE ffmpeg will be located. | ||
|
||
## Running | ||
|
||
```bash | ||
./ffmpeg -i rootfs/drop.avi drop_new.mp4 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
link="https://ffmpeg.org/releases/ffmpeg-5.1.2.tar.bz2" | ||
|
||
# Clean up | ||
rm -fr ffmpeg-* | ||
|
||
echo -n "Downloading ffmpeg source code ... " | ||
wget -q "$link" | ||
echo "" | ||
echo -n "Unpacking ffmpeg ... " | ||
tar -xf ffmpeg-5.1.2.tar.bz2 | ||
echo "" | ||
|
||
pushd ffmpeg-5.1.2/ > /dev/null 2>&1 || exit 1 | ||
|
||
echo -n "Configuring ffmpeg ... " | ||
# Add PIC/PIE compile/link flags. | ||
./configure --extra-cflags="-fPIC" --extra-ldflags="-static-pie" --disable-shared --disable-opencl | ||
echo "" | ||
|
||
echo -n "Building ffmpeg ..." | ||
make -j "$(nproc)" | ||
|
||
echo "" | ||
popd > /dev/null 2>&1 || exit | ||
|
||
ln -fn ffmpeg-5.1.2/ffmpeg . | ||
|
||
rm ffmpeg-5.1.2.tar.bz2* |
Binary file not shown.
Binary file not shown.