Initial commit

main
paring 2023-05-02 19:35:56 +09:00
commit d6bfc64356
Signed by: pikokr
GPG Key ID: 8C7ABCEF704FD728
6 changed files with 73 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
work
out

11
README.md Normal file
View File

@ -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
```

13
build.sh Executable file
View File

@ -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

2
clean.sh Executable file
View File

@ -0,0 +1,2 @@
rm -rf work
rm -rf out

16
scripts/build-ffmpeg.sh Normal file
View File

@ -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

29
scripts/build-openh264.sh Normal file
View File

@ -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