commit d6bfc643569701bc8ea70a53d5545399fe2875c8 Author: paring Date: Tue May 2 19:35:56 2023 +0900 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c629b39 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +work +out \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b42a2d8 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# FFmpeg Builder for ADOFAI + +This project builds the LGPL 2.1 version of ffmpeg, including OpenH264 + +## Usage + +```sh +./clean.sh # clean files generated on build + +./build.sh # build ffmpeg from source +``` diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..44c60d5 --- /dev/null +++ b/build.sh @@ -0,0 +1,13 @@ +export workDir=$(pwd)/work +export outDir=$(pwd)/out +export PREFIX=$workDir/prefix + +export PKG_CONFIG_DIR=$PREFIX/lib/pkgconfig +export PKG_CONFIG_PATH=$PKG_CONFIG_DIR + +mkdir -p $workDir +mkdir -p $prefix +mkdir -p $outDir + +bash scripts/build-openh264.sh +bash scripts/build-ffmpeg.sh diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..5c42c43 --- /dev/null +++ b/clean.sh @@ -0,0 +1,2 @@ +rm -rf work +rm -rf out \ No newline at end of file diff --git a/scripts/build-ffmpeg.sh b/scripts/build-ffmpeg.sh new file mode 100644 index 0000000..45d727b --- /dev/null +++ b/scripts/build-ffmpeg.sh @@ -0,0 +1,16 @@ +export ffmpegPath=$workDir/ffmpeg + +git clone https://github.com/FFmpeg/FFmpeg $ffmpegPath + +cd $ffmpegPath + +make distclean + +./configure --disable-gpl --disable-nonfree --disable-doc --disable-network \ + --disable-ffprobe --disable-ffplay --enable-static --disable-shared \ + --enable-libopenh264 \ + --prefix=$PREFIX + +make -j + +cp ffmpeg $outDir diff --git a/scripts/build-openh264.sh b/scripts/build-openh264.sh new file mode 100644 index 0000000..21cc8d4 --- /dev/null +++ b/scripts/build-openh264.sh @@ -0,0 +1,29 @@ +set -x + +export OPENH264_VERSION=2.3.1 + +# TODO: detect platform +# export CISCO_BINARY_PLATFORM=mac +# export CISCO_BINARY_ARCH=x64 +# export CISCO_BINARY_SUFFIX=dylib.bz2 +# export CISCO_BINARY_NAME=libopenh264 + +# export OPENH264_CISCO_BINARY_URL=http://ciscobinary.openh264.org/$CISCO_BINARY_NAME-$OPENH264_VERSION-$CISCO_BINARY_PLATFORM-${CISCO_BINARY_ARCH}.${CISCO_BINARY_SUFFIX} + +export projectDir=$workDir/openh264 + +git clone https://github.com/cisco/openh264 $projectDir + +cd $projectDir + +git checkout tags/v$OPENH264_VERSION -b v$OPENH264_VERSION + +args="PREFIX=$PREFIX" + +make -j $args + +make install $args + +# rm -rf $PREFIX/lib/libopenh264* + +# wget -O $PREFIX/lib/libopenh264.dylib $OPENH264_CISCO_BINARY_URL \ No newline at end of file