Docker: Add more & update libraries for FFmpeg (#1279)

* Fix error: x265 not found using pkg-config

Need to checkout tag or fetch tags, see https://bitbucket.org/multicoreware/x265_git/issues/572/pc-file-is-not-generated

* Add libs ogg, vorbis, theora, webp, xvid, openjpeg, png to ffmpeg

* ffmpeg x265 uses libnuma (but optional)

ci-common image not updated yet, pkg-config error resolved by checking out a tag. Installing libnuma was a suggested fix here: https://stackoverflow.com/questions/51918409/compiling-ffmpeg-x265-not-found-using-pkg-config

* Add Docker Images readme
This commit is contained in:
Simran
2020-10-27 18:21:54 +01:00
committed by GitHub
parent 379a799ad9
commit 9d029c4ae4
4 changed files with 242 additions and 34 deletions
+149 -31
View File
@@ -46,6 +46,7 @@ wait
# Set up libx264
{
# TODO: Checkout stable branch instead of master?
git clone --depth 1 "https://code.videolan.org/videolan/x264.git"
cd x264
./configure \
@@ -53,7 +54,7 @@ wait
--enable-shared \
--enable-pic \
--disable-cli
make -j${NUM_JOBS}
make
make install
cd ..
rm -rf x264
@@ -63,18 +64,121 @@ wait
{
# BitBucket dropped support for Mercurial repos
#hg clone https://bitbucket.org/multicoreware/x265
git clone --depth 1 "https://bitbucket.org/multicoreware/x265_git.git" x265
# Need to fetch tags (off by default for shallow clones) or checkout a tag to avoid pkg-config error
git clone --depth 1 --branch "${X265_VERSION}" "https://bitbucket.org/multicoreware/x265_git.git" x265
cd x265/build/linux
cmake \
-G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX="${OLIVE_INSTALL_PREFIX}" \
../../source
make -j${NUM_JOBS}
make
make install
cd ../../..
rm -rf x265
} &
# Set up libogg
{
curl -fLsS -o libogg.tar.gz "http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz"
tar xf libogg.tar.gz
rm -f libogg.tar.gz
cd libogg*
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared
make
make install
cd ..
rm -rf libogg*
} &
# Set up libopus
{
curl -fLsS -o opus.tar.gz "https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz"
tar xf opus.tar.gz
rm -f opus.tar.gz
cd opus*
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared
make
make install
cd ..
rm -rf opus*
} &
# join jobs, libvorbis and libtheora depend on libogg
wait
# Set up libvorbis
{
curl -fLsS -o libvorbis.tar.gz "http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz"
tar xf libvorbis.tar.gz
rm -f libvorbis.tar.gz
cd libvorbis*
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--with-ogg="${OLIVE_INSTALL_PREFIX}" \
--enable-shared
make
make install
cd ..
rm -rf libvorbis*
} &
# Set up libtheora
{
curl -fLsS -o libtheora.tar.gz "http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz"
tar xf libtheora.tar.gz
rm -f libtheora.tar.gz
cd libtheora*
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--with-ogg="${OLIVE_INSTALL_PREFIX}" \
--enable-shared
make
make install
cd ..
rm -rf libtheora*
} &
# Set up libvpx
{
git clone --depth 1 --branch "v${VPX_VERSION}" "https://chromium.googlesource.com/webm/libvpx.git"
cd libvpx
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared \
--enable-pic \
--enable-vp8 \
--enable-vp9 \
--enable-vp9-highbitdepth \
--as=yasm \
--disable-examples \
--disable-unit-tests \
--disable-docs \
--disable-install-bins
make
make install
cd ..
rm -rf libvpx
} &
### Set up libwebp
{
curl -fLsS -o libwebp.tar.gz "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz"
tar xf libwebp.tar.gz
rm -f libwebp.tar.gz
cd libwebp*
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared
make
make install
cd ..
rm -rf libwebp*
} &
# Set up libmp3lame
{
curl -fLsS -o lame.tar.gz "https://downloads.sourceforge.net/project/lame/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz"
@@ -86,45 +190,54 @@ wait
--enable-shared \
--enable-nasm \
--disable-frontend
make -j${NUM_JOBS}
make
make install
cd ..
rm -rf lame*
} &
# Set up libopus
### Set up xvid
{
curl -fLsS -o opus.tar.gz "https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz"
tar xf opus.tar.gz
rm -f opus.tar.gz
cd opus*
curl -fLsS -o xvidcore.tar.gz "http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz"
tar xf xvidcore.tar.gz
rm -f xvidcore.tar.gz
cd xvidcore/build/generic
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared
make -j${NUM_JOBS}
--bindir="${OLIVE_INSTALL_PREFIX}/bin"
make
make install
cd ..
rm -rf opus*
cd ../../..
rm -rf xvidcore
} &
# Set up libvpx
# Set up openjpeg
{
git clone --depth 1 "https://chromium.googlesource.com/webm/libvpx.git"
cd libvpx
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared \
--enable-pic \
--enable-vp9-highbitdepth \
--as=yasm \
--disable-examples \
--disable-unit-tests \
--disable-docs \
--disable-install-bins
make -j${NUM_JOBS}
curl -fLsS -o openjpeg.tar.gz "https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz"
tar xf openjpeg.tar.gz
rm -f openjpeg.tar.gz
cd openjpeg*
cmake \
-DBUILD_THIRDPARTY:BOOL=ON \
-DCMAKE_INSTALL_PREFIX="${OLIVE_INSTALL_PREFIX}" \
.
make
make install
cd ..
rm -rf libvpx
rm -rf openjpeg*
} &
# Set up libpng
{
git clone --depth 1 "https://git.code.sf.net/p/libpng/code" libpng --branch "v${LIBPNG_VERSION}"
cd libpng
./autogen.sh
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}"
make check
make install
cd ..
rm -rf libpng
} &
# join all jobs
@@ -142,11 +255,16 @@ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" ./configure \
--enable-version3 \
--enable-shared \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--enable-libopus \
--enable-libvorbis \
--enable-libtheora \
--enable-libvpx \
--enable-libwebp \
--enable-libmp3lame \
--enable-libxvid \
--enable-libopenjpeg \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--extra-libs=-lpthread \
--extra-libs=-lm \
@@ -26,6 +26,7 @@ yum install --setopt=tsflags=nodocs -y \
libxkbcommon-x11-devel \
libXScrnSaver libXScrnSaver-devel \
mesa-libGL-devel \
numactl-devel \
openjpeg2-devel \
pciutils-devel \
pulseaudio-libs pulseaudio-libs-devel \