Last active
May 16, 2023 15:16
-
-
Save contribu/8a572edaccb86ae749449a3fec83ce5f to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# License of this script: CC0 | |
# Installation of dependent libraries and softwares is required to use this script | |
# ex. nasm, yasm, libmp3lame-dev, libopus-dev, libvorbis-dev, libvpx-dev... | |
set -ex | |
# setup | |
temp_dir=$(mktemp -d) | |
# build openh264 | |
cd $temp_dir | |
git clone -b v1.7.0 --depth 1 --single-branch https://github.com/cisco/openh264.git | |
cd openh264 | |
make -j `nproc` | |
sudo make install | |
sudo ldconfig | |
# replace openh264 binary to avoid license problem | |
cd $temp_dir | |
curl -o ./libopenh264-1.7.0-linux64.4.so.bz2 -L https://github.com/cisco/openh264/releases/download/v1.7.0/libopenh264-1.7.0-linux64.4.so.bz2 | |
bunzip2 libopenh264-1.7.0-linux64.4.so.bz2 | |
sudo cp libopenh264-1.7.0-linux64.4.so /usr/local/lib/libopenh264.so.1.7.0 | |
sudo rm /usr/local/lib/libopenh264.a | |
# build ffmpeg | |
cd $temp_dir | |
git clone https://git.ffmpeg.org/ffmpeg.git | |
cd ffmpeg | |
git checkout n3.4.2 | |
./configure --enable-libopenh264 --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx | |
make -j `nproc` | |
sudo make install | |
# cleanup | |
cd | |
rm -rf $temp_dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment