Forked from felipecsl/install-ffmpeg-amazon-linux.sh
Last active
October 19, 2022 13:06
-
-
Save chrisfinne/1a45994e2d8b8939bf8661f7832b5c34 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel -y | |
cd /usr/src/ | |
mkdir ffmpeg_sources | |
# nasm | |
cd /usr/src/ffmpeg_sources | |
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2 | |
tar xjvf nasm-2.14.02.tar.bz2 | |
cd nasm-2.14.02 | |
./autogen.sh | |
./configure --prefix="/usr/src/ffmpeg_build" --bindir="/usr/local/bin" | |
make | |
make install | |
# yasm | |
cd /usr/src/ffmpeg_sources | |
curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz | |
tar xzvf yasm-1.3.0.tar.gz | |
cd yasm-1.3.0 | |
./configure --prefix="/usr/src/ffmpeg_build" --bindir="/usr/local/bin" | |
make | |
make install | |
# libxh264 | |
cd /usr/src/ffmpeg_sources | |
git clone --depth 1 https://code.videolan.org/videolan/x264 | |
cd x264 | |
PKG_CONFIG_PATH="/usr/src/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/usr/src/ffmpeg_build" --bindir="/usr/local/bin" --enable-static | |
make | |
make install | |
# libx265 | |
cd /usr/src/ffmpeg_sources | |
git clone --depth 1 https://bitbucket.org/multicoreware/x265_git.git | |
cd /usr/src/ffmpeg_sources/x265_git/build/linux | |
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/usr/src/ffmpeg_build" -DENABLE_SHARED:bool=off ../../source | |
make | |
make install | |
# libfdk_aac | |
cd /usr/src/ffmpeg_sources | |
git clone --depth 1 https://github.com/mstorsjo/fdk-aac | |
cd fdk-aac | |
autoreconf -fiv | |
./configure --prefix="/usr/src/ffmpeg_build" --disable-shared | |
make | |
make install | |
# libmp3lame | |
cd /usr/src/ffmpeg_sources | |
curl -O -L https://downloads.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz | |
tar xzvf lame-3.100.tar.gz | |
cd lame-3.100 | |
./configure --prefix="/usr/src/ffmpeg_build" --bindir="/usr/local/bin" --disable-shared --enable-nasm | |
make | |
make install | |
# libopus | |
cd /usr/src/ffmpeg_sources | |
curl -O -L https://archive.mozilla.org/pub/opus/opus-1.3.tar.gz | |
tar xzvf opus-1.3.tar.gz | |
cd opus-1.3 | |
./configure --prefix="/usr/src/ffmpeg_build" --disable-shared | |
make | |
make install | |
# libvpx | |
cd /usr/src/ffmpeg_sources | |
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git | |
cd libvpx | |
./configure --prefix="/usr/src/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm | |
make | |
make install | |
# build process no longer creating the PC file, so just manually copy one from an old SIP server ffmpeg build | |
echo 'prefix=/usr/src/ffmpeg_build | |
exec_prefix=${prefix} | |
libdir=${exec_prefix}/lib | |
includedir=${prefix}/include | |
Name: x265 | |
Description: H.265/HEVC video encoder | |
Version: 3.3 | |
Libs: -L${libdir} -lx265 | |
Libs.private: -lstdc++ -lm -lrt -ldl | |
Cflags: -I${includedir} | |
' > /usr/src/ffmpeg_build/lib/pkgconfig/x265.pc | |
# ffmpeg | |
cd /usr/src/ffmpeg_sources | |
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 | |
tar xjvf ffmpeg-snapshot.tar.bz2 | |
cd ffmpeg | |
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="/usr/src/ffmpeg_build/lib/pkgconfig" ./configure \ | |
--prefix="/usr/src/ffmpeg_build" \ | |
--pkg-config-flags="--static" \ | |
--extra-cflags="-I/usr/src/ffmpeg_build/include" \ | |
--extra-ldflags="-L/usr/src/ffmpeg_build/lib" \ | |
--extra-libs=-lpthread \ | |
--extra-libs=-lm \ | |
--bindir="/usr/local/bin" \ | |
--enable-gpl \ | |
--enable-libfdk-aac \ | |
--enable-libfreetype \ | |
--enable-libmp3lame \ | |
--enable-libopus \ | |
--enable-libvpx \ | |
--enable-libx264 \ | |
--enable-libx265 \ | |
--enable-nonfree | |
make | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment