diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2e167620..ecabe7c7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,7 @@ stages: - alpine38 - centos7 - centos8 + - almalinux8 - nvidia1604 - nvidia1804 - scratch311 diff --git a/README.md b/README.md index ce17df944..93f611954 100644 --- a/README.md +++ b/README.md @@ -33,16 +33,16 @@ There are different builds available: Not all combinations are supported and older versions will fade out over time. See the table below for the currently supported combinations. -| *Version* | alpine38 | alpine312 | centos7 | centos8 | nvidia1804 | scratch38 | scratch312 | ubuntu1804 | ubuntu2004 | vaapi1804 | vaapi2004 | -|-------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------| -| *3.2* | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: | :x: | :heavy_check_mark: | :x: | :x: | :heavy_check_mark: | :x: | :heavy_check_mark: | -| *3.3* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | -| *3.4* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | -| *4.0* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | -| *4.1* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | -| *4.2* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | -| *4.3* | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| *snapshot* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | +| *Version* | alpine38 | alpine312 | centos7 | centos8 | almalinux8 | nvidia1804 | scratch38 | scratch312 | ubuntu1804 | ubuntu2004 | vaapi1804 | vaapi2004 | +|-------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------|--------------------| +| *3.2* | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: | :x: | :x: | :heavy_check_mark: | :x: | :x: | :heavy_check_mark: | :x: | :heavy_check_mark: | +| *3.3* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | +| *3.4* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | +| *4.0* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | +| *4.1* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | +| *4.2* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | +| *4.3* | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | +| *snapshot* | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x: | :heavy_check_mark: | ### Generate list of recent images diff --git a/docker-images/3.3/almalinux8/Dockerfile b/docker-images/3.3/almalinux8/Dockerfile new file mode 100644 index 000000000..8eccf51cf --- /dev/null +++ b/docker-images/3.3/almalinux8/Dockerfile @@ -0,0 +1,591 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM almalinux:8 AS base + +RUN dnf -y install libgomp && \ + dnf clean all; + + +FROM base AS build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=3.3.9 \ + AOM_VERSION=v1.0.0 \ + FDKAAC_VERSION=0.1.5 \ + FONTCONFIG_VERSION=2.12.4 \ + FREETYPE_VERSION=2.10.4 \ + FRIBIDI_VERSION=0.19.7 \ + KVAZAAR_VERSION=2.0.0 \ + LAME_VERSION=3.100 \ + LIBASS_VERSION=0.13.7 \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION=1.1.0 \ + LIBXCB_VERSION=1.13.1 \ + XCBPROTO_VERSION=1.13 \ + OGG_VERSION=1.3.2 \ + OPENCOREAMR_VERSION=0.1.5 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.1.2 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20170226-2245-stable \ + X265_VERSION=3.4 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.4 \ + LIBXML2_VERSION=2.9.10 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.2 \ + LIBSRT_VERSION=1.4.1 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.1.1 \ + SRC=/usr/local + +ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" +ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" +ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" +ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" +ARG XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz" +ARG LIBXML2_SHA256SUM="f07dab13bf42d2b8db80620cce7419b3b87827cc937c8bb20fe13b8571ee9501 libxml2-v2.9.10.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" +ARG LIBVMAF_SHA256SUM="e7fc00ae1322a7eccfcf6d4f1cdf9c67eec8058709887c8c6c3795c617326f77 v2.1.1.tar.gz" + + +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PREFIX=/opt/ffmpeg +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + yasm \ + which \ + zlib-devel" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + dnf --enablerepo=extras install -y epel-release && \ + dnf update -y && \ + dnf -y install dnf-plugins-core && \ + yum config-manager --set-enabled powertools && \ + dnf install -y ${buildDeps} && \ + alternatives --set python /usr/bin/python3 +## libvmaf https://github.com/Netflix/vmaf +RUN \ + if which meson || false; then \ + echo "Building VMAF." && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd /tmp/vmaf/libvmaf && \ + meson build --buildtype release --prefix=${PREFIX} && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR}; \ + else \ + echo "VMAF skipped."; \ + fi + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +RUN \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## x264 http://www.videolan.org/developers/x264.html +RUN \ + DIR=/tmp/x264 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} +### x265 http://x265.org/ +RUN \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} +### libogg https://www.xiph.org/ogg/ +RUN \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libopus https://www.opus-codec.org/ +RUN \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvorbis https://xiph.org/vorbis/ +RUN \ + DIR=/tmp/vorbis && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libtheora http://www.theora.org/ +RUN \ + DIR=/tmp/theora && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvpx https://www.webmproject.org/code/ +RUN \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} +### libwebp https://developers.google.com/speed/webp/ +RUN \ + DIR=/tmp/vebp && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libmp3lame http://lame.sourceforge.net/ +RUN \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/lame/lame/$(echo ${LAME_VERSION} | sed -e 's/[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)/\1.\2/')/lame-${LAME_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} +### xvid https://www.xvid.com/ +RUN \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} +### fdk-aac https://github.com/mstorsjo/fdk-aac +RUN \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## freetype https://www.freetype.org/ +RUN \ + DIR=/tmp/freetype && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libvstab https://github.com/georgmartius/vid.stab +RUN \ + DIR=/tmp/vid.stab && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## fridibi https://www.fribidi.org/ +RUN \ + DIR=/tmp/fribidi && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + DIR=/tmp/fontconfig && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libass https://github.com/libass/libass +RUN \ + DIR=/tmp/libass && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + rm -rf CMakeCache.txt CMakeFiles ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + DIR=/tmp/xorg-macros && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/xproto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libXau && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libpthread-stubs && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb-proto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libxml2 - for libbluray +RUN \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${LIBXML2_VERSION}/libxml2-v${LIBXML2_VERSION}.tar.gz && \ + echo ${LIBXML2_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f libxml2-v${LIBXML2_VERSION}.tar.gz && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + DIR=/tmp/libbluray && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libzmq https://github.com/zeromq/libzmq/ +RUN \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +RUN \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libpng +RUN \ + DIR=/tmp/png && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libaribb24 +RUN \ + DIR=/tmp/b24 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 + + + +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-shared \ + --enable-avresample \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-gpl \ + --enable-libass \ + --enable-fontconfig \ + --enable-libfreetype \ + --enable-libvidstab \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libxcb \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libx264 \ + --enable-nonfree \ + --enable-openssl \ + --enable-libfdk_aac \ + --enable-postproc \ + --enable-small \ + --enable-version3 \ + --enable-libbluray \ + --enable-libzmq \ + --extra-libs=-ldl \ + --prefix="${PREFIX}" \ + --enable-libopenjpeg \ + --enable-libkvazaar \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done + +FROM base +MAINTAINER Julien Rottenberg + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local/ /usr/local/ + +# Let's make sure the app built correctly +# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output diff --git a/docker-images/3.4/almalinux8/Dockerfile b/docker-images/3.4/almalinux8/Dockerfile new file mode 100644 index 000000000..48472e6b3 --- /dev/null +++ b/docker-images/3.4/almalinux8/Dockerfile @@ -0,0 +1,591 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM almalinux:8 AS base + +RUN dnf -y install libgomp && \ + dnf clean all; + + +FROM base AS build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=3.4.8 \ + AOM_VERSION=v1.0.0 \ + FDKAAC_VERSION=0.1.5 \ + FONTCONFIG_VERSION=2.12.4 \ + FREETYPE_VERSION=2.10.4 \ + FRIBIDI_VERSION=0.19.7 \ + KVAZAAR_VERSION=2.0.0 \ + LAME_VERSION=3.100 \ + LIBASS_VERSION=0.13.7 \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION=1.1.0 \ + LIBXCB_VERSION=1.13.1 \ + XCBPROTO_VERSION=1.13 \ + OGG_VERSION=1.3.2 \ + OPENCOREAMR_VERSION=0.1.5 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.1.2 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20170226-2245-stable \ + X265_VERSION=3.4 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.4 \ + LIBXML2_VERSION=2.9.10 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.2 \ + LIBSRT_VERSION=1.4.1 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.1.1 \ + SRC=/usr/local + +ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" +ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" +ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" +ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" +ARG XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz" +ARG LIBXML2_SHA256SUM="f07dab13bf42d2b8db80620cce7419b3b87827cc937c8bb20fe13b8571ee9501 libxml2-v2.9.10.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" +ARG LIBVMAF_SHA256SUM="e7fc00ae1322a7eccfcf6d4f1cdf9c67eec8058709887c8c6c3795c617326f77 v2.1.1.tar.gz" + + +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PREFIX=/opt/ffmpeg +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + yasm \ + which \ + zlib-devel" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + dnf --enablerepo=extras install -y epel-release && \ + dnf update -y && \ + dnf -y install dnf-plugins-core && \ + yum config-manager --set-enabled powertools && \ + dnf install -y ${buildDeps} && \ + alternatives --set python /usr/bin/python3 +## libvmaf https://github.com/Netflix/vmaf +RUN \ + if which meson || false; then \ + echo "Building VMAF." && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd /tmp/vmaf/libvmaf && \ + meson build --buildtype release --prefix=${PREFIX} && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR}; \ + else \ + echo "VMAF skipped."; \ + fi + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +RUN \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## x264 http://www.videolan.org/developers/x264.html +RUN \ + DIR=/tmp/x264 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} +### x265 http://x265.org/ +RUN \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} +### libogg https://www.xiph.org/ogg/ +RUN \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libopus https://www.opus-codec.org/ +RUN \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvorbis https://xiph.org/vorbis/ +RUN \ + DIR=/tmp/vorbis && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libtheora http://www.theora.org/ +RUN \ + DIR=/tmp/theora && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvpx https://www.webmproject.org/code/ +RUN \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} +### libwebp https://developers.google.com/speed/webp/ +RUN \ + DIR=/tmp/vebp && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libmp3lame http://lame.sourceforge.net/ +RUN \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/lame/lame/$(echo ${LAME_VERSION} | sed -e 's/[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)/\1.\2/')/lame-${LAME_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} +### xvid https://www.xvid.com/ +RUN \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} +### fdk-aac https://github.com/mstorsjo/fdk-aac +RUN \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## freetype https://www.freetype.org/ +RUN \ + DIR=/tmp/freetype && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libvstab https://github.com/georgmartius/vid.stab +RUN \ + DIR=/tmp/vid.stab && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## fridibi https://www.fribidi.org/ +RUN \ + DIR=/tmp/fribidi && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + DIR=/tmp/fontconfig && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libass https://github.com/libass/libass +RUN \ + DIR=/tmp/libass && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + rm -rf CMakeCache.txt CMakeFiles ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + DIR=/tmp/xorg-macros && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/xproto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libXau && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libpthread-stubs && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb-proto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libxml2 - for libbluray +RUN \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${LIBXML2_VERSION}/libxml2-v${LIBXML2_VERSION}.tar.gz && \ + echo ${LIBXML2_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f libxml2-v${LIBXML2_VERSION}.tar.gz && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + DIR=/tmp/libbluray && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libzmq https://github.com/zeromq/libzmq/ +RUN \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +RUN \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libpng +RUN \ + DIR=/tmp/png && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libaribb24 +RUN \ + DIR=/tmp/b24 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 + + + +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-shared \ + --enable-avresample \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-gpl \ + --enable-libass \ + --enable-fontconfig \ + --enable-libfreetype \ + --enable-libvidstab \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libxcb \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libx264 \ + --enable-nonfree \ + --enable-openssl \ + --enable-libfdk_aac \ + --enable-postproc \ + --enable-small \ + --enable-version3 \ + --enable-libbluray \ + --enable-libzmq \ + --extra-libs=-ldl \ + --prefix="${PREFIX}" \ + --enable-libopenjpeg \ + --enable-libkvazaar \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done + +FROM base +MAINTAINER Julien Rottenberg + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local/ /usr/local/ + +# Let's make sure the app built correctly +# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output diff --git a/docker-images/4.0/almalinux8/Dockerfile b/docker-images/4.0/almalinux8/Dockerfile new file mode 100644 index 000000000..3e8b4e0b2 --- /dev/null +++ b/docker-images/4.0/almalinux8/Dockerfile @@ -0,0 +1,594 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM almalinux:8 AS base + +RUN dnf -y install libgomp && \ + dnf clean all; + + +FROM base AS build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=4.0.6 \ + AOM_VERSION=v1.0.0 \ + FDKAAC_VERSION=0.1.5 \ + FONTCONFIG_VERSION=2.12.4 \ + FREETYPE_VERSION=2.10.4 \ + FRIBIDI_VERSION=0.19.7 \ + KVAZAAR_VERSION=2.0.0 \ + LAME_VERSION=3.100 \ + LIBASS_VERSION=0.13.7 \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION=1.1.0 \ + LIBXCB_VERSION=1.13.1 \ + XCBPROTO_VERSION=1.13 \ + OGG_VERSION=1.3.2 \ + OPENCOREAMR_VERSION=0.1.5 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.1.2 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20170226-2245-stable \ + X265_VERSION=3.4 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.4 \ + LIBXML2_VERSION=2.9.10 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.2 \ + LIBSRT_VERSION=1.4.1 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.1.1 \ + SRC=/usr/local + +ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" +ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" +ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" +ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" +ARG XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz" +ARG LIBXML2_SHA256SUM="f07dab13bf42d2b8db80620cce7419b3b87827cc937c8bb20fe13b8571ee9501 libxml2-v2.9.10.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" +ARG LIBVMAF_SHA256SUM="e7fc00ae1322a7eccfcf6d4f1cdf9c67eec8058709887c8c6c3795c617326f77 v2.1.1.tar.gz" + + +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PREFIX=/opt/ffmpeg +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + yasm \ + which \ + zlib-devel" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + dnf --enablerepo=extras install -y epel-release && \ + dnf update -y && \ + dnf -y install dnf-plugins-core && \ + yum config-manager --set-enabled powertools && \ + dnf install -y ${buildDeps} && \ + alternatives --set python /usr/bin/python3 +## libvmaf https://github.com/Netflix/vmaf +RUN \ + if which meson || false; then \ + echo "Building VMAF." && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd /tmp/vmaf/libvmaf && \ + meson build --buildtype release --prefix=${PREFIX} && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR}; \ + else \ + echo "VMAF skipped."; \ + fi + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +RUN \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## x264 http://www.videolan.org/developers/x264.html +RUN \ + DIR=/tmp/x264 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} +### x265 http://x265.org/ +RUN \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} +### libogg https://www.xiph.org/ogg/ +RUN \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libopus https://www.opus-codec.org/ +RUN \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvorbis https://xiph.org/vorbis/ +RUN \ + DIR=/tmp/vorbis && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libtheora http://www.theora.org/ +RUN \ + DIR=/tmp/theora && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvpx https://www.webmproject.org/code/ +RUN \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} +### libwebp https://developers.google.com/speed/webp/ +RUN \ + DIR=/tmp/vebp && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libmp3lame http://lame.sourceforge.net/ +RUN \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/lame/lame/$(echo ${LAME_VERSION} | sed -e 's/[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)/\1.\2/')/lame-${LAME_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} +### xvid https://www.xvid.com/ +RUN \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} +### fdk-aac https://github.com/mstorsjo/fdk-aac +RUN \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## freetype https://www.freetype.org/ +RUN \ + DIR=/tmp/freetype && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libvstab https://github.com/georgmartius/vid.stab +RUN \ + DIR=/tmp/vid.stab && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## fridibi https://www.fribidi.org/ +RUN \ + DIR=/tmp/fribidi && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + DIR=/tmp/fontconfig && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libass https://github.com/libass/libass +RUN \ + DIR=/tmp/libass && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + rm -rf CMakeCache.txt CMakeFiles ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + DIR=/tmp/xorg-macros && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/xproto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libXau && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libpthread-stubs && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb-proto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libxml2 - for libbluray +RUN \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${LIBXML2_VERSION}/libxml2-v${LIBXML2_VERSION}.tar.gz && \ + echo ${LIBXML2_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f libxml2-v${LIBXML2_VERSION}.tar.gz && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + DIR=/tmp/libbluray && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libzmq https://github.com/zeromq/libzmq/ +RUN \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +RUN \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libpng +RUN \ + DIR=/tmp/png && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libaribb24 +RUN \ + DIR=/tmp/b24 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 + + + +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-shared \ + --enable-avresample \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-gpl \ + --enable-libass \ + --enable-fontconfig \ + --enable-libfreetype \ + --enable-libvidstab \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libxcb \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libx264 \ + --enable-nonfree \ + --enable-openssl \ + --enable-libfdk_aac \ + --enable-postproc \ + --enable-small \ + --enable-version3 \ + --enable-libbluray \ + --enable-libzmq \ + --extra-libs=-ldl \ + --prefix="${PREFIX}" \ + --enable-libopenjpeg \ + --enable-libkvazaar \ + --enable-libaom \ + --extra-libs=-lpthread \ + --enable-libsrt \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done + +FROM base +MAINTAINER Julien Rottenberg + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local/ /usr/local/ + +# Let's make sure the app built correctly +# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output diff --git a/docker-images/4.1/almalinux8/Dockerfile b/docker-images/4.1/almalinux8/Dockerfile new file mode 100644 index 000000000..e8a565197 --- /dev/null +++ b/docker-images/4.1/almalinux8/Dockerfile @@ -0,0 +1,594 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM almalinux:8 AS base + +RUN dnf -y install libgomp && \ + dnf clean all; + + +FROM base AS build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=4.1.7 \ + AOM_VERSION=v1.0.0 \ + FDKAAC_VERSION=0.1.5 \ + FONTCONFIG_VERSION=2.12.4 \ + FREETYPE_VERSION=2.10.4 \ + FRIBIDI_VERSION=0.19.7 \ + KVAZAAR_VERSION=2.0.0 \ + LAME_VERSION=3.100 \ + LIBASS_VERSION=0.13.7 \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION=1.1.0 \ + LIBXCB_VERSION=1.13.1 \ + XCBPROTO_VERSION=1.13 \ + OGG_VERSION=1.3.2 \ + OPENCOREAMR_VERSION=0.1.5 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.1.2 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20170226-2245-stable \ + X265_VERSION=3.4 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.4 \ + LIBXML2_VERSION=2.9.10 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.2 \ + LIBSRT_VERSION=1.4.1 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.1.1 \ + SRC=/usr/local + +ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" +ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" +ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" +ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" +ARG XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz" +ARG LIBXML2_SHA256SUM="f07dab13bf42d2b8db80620cce7419b3b87827cc937c8bb20fe13b8571ee9501 libxml2-v2.9.10.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" +ARG LIBVMAF_SHA256SUM="e7fc00ae1322a7eccfcf6d4f1cdf9c67eec8058709887c8c6c3795c617326f77 v2.1.1.tar.gz" + + +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PREFIX=/opt/ffmpeg +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + yasm \ + which \ + zlib-devel" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + dnf --enablerepo=extras install -y epel-release && \ + dnf update -y && \ + dnf -y install dnf-plugins-core && \ + yum config-manager --set-enabled powertools && \ + dnf install -y ${buildDeps} && \ + alternatives --set python /usr/bin/python3 +## libvmaf https://github.com/Netflix/vmaf +RUN \ + if which meson || false; then \ + echo "Building VMAF." && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd /tmp/vmaf/libvmaf && \ + meson build --buildtype release --prefix=${PREFIX} && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR}; \ + else \ + echo "VMAF skipped."; \ + fi + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +RUN \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## x264 http://www.videolan.org/developers/x264.html +RUN \ + DIR=/tmp/x264 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} +### x265 http://x265.org/ +RUN \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} +### libogg https://www.xiph.org/ogg/ +RUN \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libopus https://www.opus-codec.org/ +RUN \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvorbis https://xiph.org/vorbis/ +RUN \ + DIR=/tmp/vorbis && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libtheora http://www.theora.org/ +RUN \ + DIR=/tmp/theora && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvpx https://www.webmproject.org/code/ +RUN \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} +### libwebp https://developers.google.com/speed/webp/ +RUN \ + DIR=/tmp/vebp && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libmp3lame http://lame.sourceforge.net/ +RUN \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/lame/lame/$(echo ${LAME_VERSION} | sed -e 's/[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)/\1.\2/')/lame-${LAME_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} +### xvid https://www.xvid.com/ +RUN \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} +### fdk-aac https://github.com/mstorsjo/fdk-aac +RUN \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## freetype https://www.freetype.org/ +RUN \ + DIR=/tmp/freetype && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libvstab https://github.com/georgmartius/vid.stab +RUN \ + DIR=/tmp/vid.stab && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## fridibi https://www.fribidi.org/ +RUN \ + DIR=/tmp/fribidi && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + DIR=/tmp/fontconfig && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libass https://github.com/libass/libass +RUN \ + DIR=/tmp/libass && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + rm -rf CMakeCache.txt CMakeFiles ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + DIR=/tmp/xorg-macros && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/xproto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libXau && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libpthread-stubs && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb-proto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libxml2 - for libbluray +RUN \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${LIBXML2_VERSION}/libxml2-v${LIBXML2_VERSION}.tar.gz && \ + echo ${LIBXML2_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f libxml2-v${LIBXML2_VERSION}.tar.gz && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + DIR=/tmp/libbluray && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libzmq https://github.com/zeromq/libzmq/ +RUN \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +RUN \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libpng +RUN \ + DIR=/tmp/png && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libaribb24 +RUN \ + DIR=/tmp/b24 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 + + + +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-shared \ + --enable-avresample \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-gpl \ + --enable-libass \ + --enable-fontconfig \ + --enable-libfreetype \ + --enable-libvidstab \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libxcb \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libx264 \ + --enable-nonfree \ + --enable-openssl \ + --enable-libfdk_aac \ + --enable-postproc \ + --enable-small \ + --enable-version3 \ + --enable-libbluray \ + --enable-libzmq \ + --extra-libs=-ldl \ + --prefix="${PREFIX}" \ + --enable-libopenjpeg \ + --enable-libkvazaar \ + --enable-libaom \ + --extra-libs=-lpthread \ + --enable-libsrt \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done + +FROM base +MAINTAINER Julien Rottenberg + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local/ /usr/local/ + +# Let's make sure the app built correctly +# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output diff --git a/docker-images/4.2/almalinux8/Dockerfile b/docker-images/4.2/almalinux8/Dockerfile new file mode 100644 index 000000000..2d98b2b99 --- /dev/null +++ b/docker-images/4.2/almalinux8/Dockerfile @@ -0,0 +1,595 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM almalinux:8 AS base + +RUN dnf -y install libgomp && \ + dnf clean all; + + +FROM base AS build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=4.2.4 \ + AOM_VERSION=v1.0.0 \ + FDKAAC_VERSION=0.1.5 \ + FONTCONFIG_VERSION=2.12.4 \ + FREETYPE_VERSION=2.10.4 \ + FRIBIDI_VERSION=0.19.7 \ + KVAZAAR_VERSION=2.0.0 \ + LAME_VERSION=3.100 \ + LIBASS_VERSION=0.13.7 \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION=1.1.0 \ + LIBXCB_VERSION=1.13.1 \ + XCBPROTO_VERSION=1.13 \ + OGG_VERSION=1.3.2 \ + OPENCOREAMR_VERSION=0.1.5 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.1.2 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20170226-2245-stable \ + X265_VERSION=3.4 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.4 \ + LIBXML2_VERSION=2.9.10 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.2 \ + LIBSRT_VERSION=1.4.1 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.1.1 \ + SRC=/usr/local + +ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" +ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" +ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" +ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" +ARG XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz" +ARG LIBXML2_SHA256SUM="f07dab13bf42d2b8db80620cce7419b3b87827cc937c8bb20fe13b8571ee9501 libxml2-v2.9.10.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" +ARG LIBVMAF_SHA256SUM="e7fc00ae1322a7eccfcf6d4f1cdf9c67eec8058709887c8c6c3795c617326f77 v2.1.1.tar.gz" + + +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PREFIX=/opt/ffmpeg +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + yasm \ + which \ + zlib-devel" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + dnf --enablerepo=extras install -y epel-release && \ + dnf update -y && \ + dnf -y install dnf-plugins-core && \ + yum config-manager --set-enabled powertools && \ + dnf install -y ${buildDeps} && \ + alternatives --set python /usr/bin/python3 +## libvmaf https://github.com/Netflix/vmaf +RUN \ + if which meson || false; then \ + echo "Building VMAF." && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd /tmp/vmaf/libvmaf && \ + meson build --buildtype release --prefix=${PREFIX} && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR}; \ + else \ + echo "VMAF skipped."; \ + fi + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +RUN \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## x264 http://www.videolan.org/developers/x264.html +RUN \ + DIR=/tmp/x264 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} +### x265 http://x265.org/ +RUN \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} +### libogg https://www.xiph.org/ogg/ +RUN \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libopus https://www.opus-codec.org/ +RUN \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvorbis https://xiph.org/vorbis/ +RUN \ + DIR=/tmp/vorbis && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libtheora http://www.theora.org/ +RUN \ + DIR=/tmp/theora && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvpx https://www.webmproject.org/code/ +RUN \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} +### libwebp https://developers.google.com/speed/webp/ +RUN \ + DIR=/tmp/vebp && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libmp3lame http://lame.sourceforge.net/ +RUN \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/lame/lame/$(echo ${LAME_VERSION} | sed -e 's/[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)/\1.\2/')/lame-${LAME_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} +### xvid https://www.xvid.com/ +RUN \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} +### fdk-aac https://github.com/mstorsjo/fdk-aac +RUN \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## freetype https://www.freetype.org/ +RUN \ + DIR=/tmp/freetype && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libvstab https://github.com/georgmartius/vid.stab +RUN \ + DIR=/tmp/vid.stab && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## fridibi https://www.fribidi.org/ +RUN \ + DIR=/tmp/fribidi && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + DIR=/tmp/fontconfig && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libass https://github.com/libass/libass +RUN \ + DIR=/tmp/libass && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + rm -rf CMakeCache.txt CMakeFiles ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + DIR=/tmp/xorg-macros && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/xproto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libXau && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libpthread-stubs && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb-proto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libxml2 - for libbluray +RUN \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${LIBXML2_VERSION}/libxml2-v${LIBXML2_VERSION}.tar.gz && \ + echo ${LIBXML2_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f libxml2-v${LIBXML2_VERSION}.tar.gz && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + DIR=/tmp/libbluray && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libzmq https://github.com/zeromq/libzmq/ +RUN \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +RUN \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libpng +RUN \ + DIR=/tmp/png && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libaribb24 +RUN \ + DIR=/tmp/b24 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 + + + +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-shared \ + --enable-avresample \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-gpl \ + --enable-libass \ + --enable-fontconfig \ + --enable-libfreetype \ + --enable-libvidstab \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libxcb \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libx264 \ + --enable-nonfree \ + --enable-openssl \ + --enable-libfdk_aac \ + --enable-postproc \ + --enable-small \ + --enable-version3 \ + --enable-libbluray \ + --enable-libzmq \ + --extra-libs=-ldl \ + --prefix="${PREFIX}" \ + --enable-libopenjpeg \ + --enable-libkvazaar \ + --enable-libaom \ + --extra-libs=-lpthread \ + --enable-libsrt \ + --enable-libaribb24 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done + +FROM base +MAINTAINER Julien Rottenberg + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local/ /usr/local/ + +# Let's make sure the app built correctly +# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output diff --git a/docker-images/4.3/almalinux8/Dockerfile b/docker-images/4.3/almalinux8/Dockerfile new file mode 100644 index 000000000..7d7bb7f83 --- /dev/null +++ b/docker-images/4.3/almalinux8/Dockerfile @@ -0,0 +1,595 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM almalinux:8 AS base + +RUN dnf -y install libgomp && \ + dnf clean all; + + +FROM base AS build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=4.3.2 \ + AOM_VERSION=v1.0.0 \ + FDKAAC_VERSION=0.1.5 \ + FONTCONFIG_VERSION=2.12.4 \ + FREETYPE_VERSION=2.10.4 \ + FRIBIDI_VERSION=0.19.7 \ + KVAZAAR_VERSION=2.0.0 \ + LAME_VERSION=3.100 \ + LIBASS_VERSION=0.13.7 \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION=1.1.0 \ + LIBXCB_VERSION=1.13.1 \ + XCBPROTO_VERSION=1.13 \ + OGG_VERSION=1.3.2 \ + OPENCOREAMR_VERSION=0.1.5 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.1.2 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20170226-2245-stable \ + X265_VERSION=3.4 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.4 \ + LIBXML2_VERSION=2.9.10 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.2 \ + LIBSRT_VERSION=1.4.1 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.1.1 \ + SRC=/usr/local + +ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" +ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" +ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" +ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" +ARG XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz" +ARG LIBXML2_SHA256SUM="f07dab13bf42d2b8db80620cce7419b3b87827cc937c8bb20fe13b8571ee9501 libxml2-v2.9.10.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" +ARG LIBVMAF_SHA256SUM="e7fc00ae1322a7eccfcf6d4f1cdf9c67eec8058709887c8c6c3795c617326f77 v2.1.1.tar.gz" + + +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PREFIX=/opt/ffmpeg +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + yasm \ + which \ + zlib-devel" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + dnf --enablerepo=extras install -y epel-release && \ + dnf update -y && \ + dnf -y install dnf-plugins-core && \ + yum config-manager --set-enabled powertools && \ + dnf install -y ${buildDeps} && \ + alternatives --set python /usr/bin/python3 +## libvmaf https://github.com/Netflix/vmaf +RUN \ + if which meson || false; then \ + echo "Building VMAF." && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd /tmp/vmaf/libvmaf && \ + meson build --buildtype release --prefix=${PREFIX} && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR}; \ + else \ + echo "VMAF skipped."; \ + fi + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +RUN \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## x264 http://www.videolan.org/developers/x264.html +RUN \ + DIR=/tmp/x264 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} +### x265 http://x265.org/ +RUN \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} +### libogg https://www.xiph.org/ogg/ +RUN \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libopus https://www.opus-codec.org/ +RUN \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvorbis https://xiph.org/vorbis/ +RUN \ + DIR=/tmp/vorbis && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libtheora http://www.theora.org/ +RUN \ + DIR=/tmp/theora && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvpx https://www.webmproject.org/code/ +RUN \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} +### libwebp https://developers.google.com/speed/webp/ +RUN \ + DIR=/tmp/vebp && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libmp3lame http://lame.sourceforge.net/ +RUN \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/lame/lame/$(echo ${LAME_VERSION} | sed -e 's/[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)/\1.\2/')/lame-${LAME_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} +### xvid https://www.xvid.com/ +RUN \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} +### fdk-aac https://github.com/mstorsjo/fdk-aac +RUN \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## freetype https://www.freetype.org/ +RUN \ + DIR=/tmp/freetype && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libvstab https://github.com/georgmartius/vid.stab +RUN \ + DIR=/tmp/vid.stab && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## fridibi https://www.fribidi.org/ +RUN \ + DIR=/tmp/fribidi && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + DIR=/tmp/fontconfig && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libass https://github.com/libass/libass +RUN \ + DIR=/tmp/libass && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + rm -rf CMakeCache.txt CMakeFiles ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + DIR=/tmp/xorg-macros && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/xproto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libXau && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libpthread-stubs && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb-proto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libxml2 - for libbluray +RUN \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${LIBXML2_VERSION}/libxml2-v${LIBXML2_VERSION}.tar.gz && \ + echo ${LIBXML2_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f libxml2-v${LIBXML2_VERSION}.tar.gz && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + DIR=/tmp/libbluray && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libzmq https://github.com/zeromq/libzmq/ +RUN \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +RUN \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libpng +RUN \ + DIR=/tmp/png && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libaribb24 +RUN \ + DIR=/tmp/b24 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 + + + +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-shared \ + --enable-avresample \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-gpl \ + --enable-libass \ + --enable-fontconfig \ + --enable-libfreetype \ + --enable-libvidstab \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libxcb \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libx264 \ + --enable-nonfree \ + --enable-openssl \ + --enable-libfdk_aac \ + --enable-postproc \ + --enable-small \ + --enable-version3 \ + --enable-libbluray \ + --enable-libzmq \ + --extra-libs=-ldl \ + --prefix="${PREFIX}" \ + --enable-libopenjpeg \ + --enable-libkvazaar \ + --enable-libaom \ + --extra-libs=-lpthread \ + --enable-libsrt \ + --enable-libaribb24 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done + +FROM base +MAINTAINER Julien Rottenberg + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local/ /usr/local/ + +# Let's make sure the app built correctly +# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output diff --git a/docker-images/4.4/almalinux8/Dockerfile b/docker-images/4.4/almalinux8/Dockerfile new file mode 100644 index 000000000..8467f2c0f --- /dev/null +++ b/docker-images/4.4/almalinux8/Dockerfile @@ -0,0 +1,595 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Centos +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM almalinux:8 AS base + +RUN dnf -y install libgomp && \ + dnf clean all; + + +FROM base AS build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=4.4 \ + AOM_VERSION=v1.0.0 \ + FDKAAC_VERSION=0.1.5 \ + FONTCONFIG_VERSION=2.12.4 \ + FREETYPE_VERSION=2.10.4 \ + FRIBIDI_VERSION=0.19.7 \ + KVAZAAR_VERSION=2.0.0 \ + LAME_VERSION=3.100 \ + LIBASS_VERSION=0.13.7 \ + LIBPTHREAD_STUBS_VERSION=0.4 \ + LIBVIDSTAB_VERSION=1.1.0 \ + LIBXCB_VERSION=1.13.1 \ + XCBPROTO_VERSION=1.13 \ + OGG_VERSION=1.3.2 \ + OPENCOREAMR_VERSION=0.1.5 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.1.2 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20170226-2245-stable \ + X265_VERSION=3.4 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.4 \ + LIBXML2_VERSION=2.9.10 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.2 \ + LIBSRT_VERSION=1.4.1 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.1.1 \ + SRC=/usr/local + +ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01b2c953269f658dac freetype-2.10.4.tar.gz" +ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 0.19.7.tar.gz" +ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692 libogg-1.3.2.tar.gz" +ARG OPUS_SHA256SUM="77db45a87b51578fbc49555ef1b10926179861d854eb2613207dc79d9ec0a9a9 opus-1.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="6efbcecdd3e5dfbf090341b485da9d176eb250d893e3eb378c428a2db38301ce libvorbis-1.3.5.tar.gz" +ARG XVID_SHA256SUM="4e9fd62728885855bc5007fe1be58df42e5e274497591fec37249e1052ae316f xvidcore-1.3.4.tar.gz" +ARG LIBXML2_SHA256SUM="f07dab13bf42d2b8db80620cce7419b3b87827cc937c8bb20fe13b8571ee9501 libxml2-v2.9.10.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" +ARG LIBVMAF_SHA256SUM="e7fc00ae1322a7eccfcf6d4f1cdf9c67eec8058709887c8c6c3795c617326f77 v2.1.1.tar.gz" + + +ARG LD_LIBRARY_PATH=/opt/ffmpeg/lib +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PREFIX=/opt/ffmpeg +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + bzip2 \ + cmake \ + diffutils \ + expat-devel \ + gcc \ + gcc-c++ \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + python3 \ + openssl-devel \ + tar \ + yasm \ + which \ + zlib-devel" && \ + echo "${SRC}/lib" > /etc/ld.so.conf.d/libc.conf && \ + dnf --enablerepo=extras install -y epel-release && \ + dnf update -y && \ + dnf -y install dnf-plugins-core && \ + yum config-manager --set-enabled powertools && \ + dnf install -y ${buildDeps} && \ + alternatives --set python /usr/bin/python3 +## libvmaf https://github.com/Netflix/vmaf +RUN \ + if which meson || false; then \ + echo "Building VMAF." && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + cd /tmp/vmaf/libvmaf && \ + meson build --buildtype release --prefix=${PREFIX} && \ + ninja -vC build && \ + ninja -vC build install && \ + mkdir -p ${PREFIX}/share/model/ && \ + cp -r /tmp/vmaf/model/* ${PREFIX}/share/model/ && \ + rm -rf ${DIR}; \ + else \ + echo "VMAF skipped."; \ + fi + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +RUN \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## x264 http://www.videolan.org/developers/x264.html +RUN \ + DIR=/tmp/x264 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-${X264_VERSION}.tar.bz2 | \ + tar -jx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared --enable-pic --disable-cli && \ + make && \ + make install && \ + rm -rf ${DIR} +### x265 http://x265.org/ +RUN \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + tar -zx && \ + cd x265-${X265_VERSION}/build/linux && \ + sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh && \ + sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh && \ + ./multilib.sh && \ + make -C 8bit install && \ + rm -rf ${DIR} +### libogg https://www.xiph.org/ogg/ +RUN \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz && \ + echo ${OGG_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libogg-${OGG_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libopus https://www.opus-codec.org/ +RUN \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz && \ + echo ${OPUS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f opus-${OPUS_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvorbis https://xiph.org/vorbis/ +RUN \ + DIR=/tmp/vorbis && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz && \ + echo ${VORBIS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libvorbis-${VORBIS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libtheora http://www.theora.org/ +RUN \ + DIR=/tmp/theora && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.gz && \ + echo ${THEORA_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f libtheora-${THEORA_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libvpx https://www.webmproject.org/code/ +RUN \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-vp8 --enable-vp9 --enable-vp9-highbitdepth --enable-pic --enable-shared \ + --disable-debug --disable-examples --disable-docs --disable-install-bins && \ + make && \ + make install && \ + rm -rf ${DIR} +### libwebp https://developers.google.com/speed/webp/ +RUN \ + DIR=/tmp/vebp && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +### libmp3lame http://lame.sourceforge.net/ +RUN \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://versaweb.dl.sourceforge.net/project/lame/lame/$(echo ${LAME_VERSION} | sed -e 's/[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)/\1.\2/')/lame-${LAME_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} +### xvid https://www.xvid.com/ +RUN \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + echo ${XVID_SHA256SUM} | sha256sum --check && \ + tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ + cd xvidcore/build/generic && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ + make && \ + make install && \ + rm -rf ${DIR} +### fdk-aac https://github.com/mstorsjo/fdk-aac +RUN \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + autoreconf -fiv && \ + ./configure --prefix="${PREFIX}" --enable-shared --datadir="${DIR}" && \ + make && \ + make install && \ + rm -rf ${DIR} +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## freetype https://www.freetype.org/ +RUN \ + DIR=/tmp/freetype && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + echo ${FREETYPE_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f freetype-${FREETYPE_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libvstab https://github.com/georgmartius/vid.stab +RUN \ + DIR=/tmp/vid.stab && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ + echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} +## fridibi https://www.fribidi.org/ +RUN \ + DIR=/tmp/fribidi && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/fribidi/fribidi/archive/${FRIBIDI_VERSION}.tar.gz && \ + echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${FRIBIDI_VERSION}.tar.gz && \ + sed -i 's/^SUBDIRS =.*/SUBDIRS=gen.tab charset lib bin/' Makefile.am && \ + ./bootstrap --no-config --auto && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make -j1 && \ + make install && \ + rm -rf ${DIR} +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + DIR=/tmp/fontconfig && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f fontconfig-${FONTCONFIG_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## libass https://github.com/libass/libass +RUN \ + DIR=/tmp/libass && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/libass/libass/archive/${LIBASS_VERSION}.tar.gz && \ + echo ${LIBASS_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + rm -rf CMakeCache.txt CMakeFiles ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + DIR=/tmp/xorg-macros && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/xproto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/proto/xproto-${XPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xproto-${XPROTO_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libXau && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://www.x.org/archive/individual/lib/libXau-${XAU_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libXau-${XAU_VERSION}.tar.gz && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libpthread-stubs && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb-proto && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f xcb-proto-${XCBPROTO_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +RUN \ + DIR=/tmp/libxcb && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://xcb.freedesktop.org/dist/libxcb-${LIBXCB_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f libxcb-${LIBXCB_VERSION}.tar.gz && \ + ACLOCAL_PATH="${PREFIX}/share/aclocal" ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libxml2 - for libbluray +RUN \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.gnome.org/GNOME/libxml2/-/archive/v${LIBXML2_VERSION}/libxml2-v${LIBXML2_VERSION}.tar.gz && \ + echo ${LIBXML2_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f libxml2-v${LIBXML2_VERSION}.tar.gz && \ + ./autogen.sh --prefix="${PREFIX}" --with-ftp=no --with-http=no --with-python=no && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + DIR=/tmp/libbluray && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + echo ${LIBBLURAY_SHA256SUM} | sha256sum --check && \ + tar -jx --strip-components=1 -f libbluray-${LIBBLURAY_VERSION}.tar.bz2 && \ + ./configure --prefix="${PREFIX}" --disable-examples --disable-bdjava-jar --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libzmq https://github.com/zeromq/libzmq/ +RUN \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/archive/v${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +RUN \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ + cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libpng +RUN \ + DIR=/tmp/png && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + git clone https://git.code.sf.net/p/libpng/code ${DIR} -b v${LIBPNG_VERSION} --depth 1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make check && \ + make install && \ + rm -rf ${DIR} + +## libaribb24 +RUN \ + DIR=/tmp/b24 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/nkoriyama/aribb24/archive/v${LIBARIBB24_VERSION}.tar.gz && \ + echo ${LIBARIBB24_SHA256SUM} | sha256sum --check && \ + tar -xz --strip-components=1 -f v${LIBARIBB24_VERSION}.tar.gz && \ + autoreconf -fiv && \ + ./configure CFLAGS="-I${PREFIX}/include -fPIC" --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 + + + +RUN \ + DIR=/tmp/ffmpeg && mkdir -p ${DIR} && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-shared \ + --enable-avresample \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-gpl \ + --enable-libass \ + --enable-fontconfig \ + --enable-libfreetype \ + --enable-libvidstab \ + --enable-libmp3lame \ + --enable-libopus \ + --enable-libtheora \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libxcb \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libx264 \ + --enable-nonfree \ + --enable-openssl \ + --enable-libfdk_aac \ + --enable-postproc \ + --enable-small \ + --enable-version3 \ + --enable-libbluray \ + --enable-libzmq \ + --extra-libs=-ldl \ + --prefix="${PREFIX}" \ + --enable-libopenjpeg \ + --enable-libkvazaar \ + --enable-libaom \ + --extra-libs=-lpthread \ + --enable-libsrt \ + --enable-libaribb24 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" && \ + make && \ + make install && \ + make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ + make distclean && \ + hash -r && \ + cd tools && \ + make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib64/ && \ + for lib in /usr/local/lib64/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib64/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib64/pkgconfig/"${pc##*/}"; \ + done + +FROM base +MAINTAINER Julien Rottenberg + +ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local/ /usr/local/ + +# Let's make sure the app built correctly +# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output diff --git a/docker-images/azure-jobs.yml b/docker-images/azure-jobs.yml index b55693fd0..cece2a5ba 100644 --- a/docker-images/azure-jobs.yml +++ b/docker-images/azure-jobs.yml @@ -61,6 +61,15 @@ jobs: ISPARENT: True + almalinux8_4.4: + MAJOR_VERSION: 4 + VERSION: 4.4 + LONG_VERSION: 4.4 + VARIANT: almalinux8 + PARENT: centos + ISPARENT: True + + scratch312_4.4: MAJOR_VERSION: 4 VERSION: 4.4 @@ -160,6 +169,15 @@ jobs: ISPARENT: True + almalinux8_4.3.2: + MAJOR_VERSION: 4 + VERSION: 4.3 + LONG_VERSION: 4.3.2 + VARIANT: almalinux8 + PARENT: centos + ISPARENT: True + + scratch312_4.3.2: MAJOR_VERSION: 4 VERSION: 4.3 @@ -250,6 +268,15 @@ jobs: ISPARENT: True + almalinux8_4.2.4: + MAJOR_VERSION: 4 + VERSION: 4.2 + LONG_VERSION: 4.2.4 + VARIANT: almalinux8 + PARENT: centos + ISPARENT: True + + scratch312_4.2.4: MAJOR_VERSION: 4 VERSION: 4.2 @@ -322,6 +349,15 @@ jobs: ISPARENT: True + almalinux8_4.1.7: + MAJOR_VERSION: 4 + VERSION: 4.1 + LONG_VERSION: 4.1.7 + VARIANT: almalinux8 + PARENT: centos + ISPARENT: True + + scratch312_4.1.7: MAJOR_VERSION: 4 VERSION: 4.1 @@ -394,6 +430,15 @@ jobs: ISPARENT: True + almalinux8_4.0.6: + MAJOR_VERSION: 4 + VERSION: 4.0 + LONG_VERSION: 4.0.6 + VARIANT: almalinux8 + PARENT: centos + ISPARENT: True + + scratch312_4.0.6: MAJOR_VERSION: 4 VERSION: 4.0 @@ -466,6 +511,15 @@ jobs: ISPARENT: True + almalinux8_3.4.8: + MAJOR_VERSION: 3 + VERSION: 3.4 + LONG_VERSION: 3.4.8 + VARIANT: almalinux8 + PARENT: centos + ISPARENT: True + + scratch312_3.4.8: MAJOR_VERSION: 3 VERSION: 3.4 @@ -538,6 +592,15 @@ jobs: ISPARENT: True + almalinux8_3.3.9: + MAJOR_VERSION: 3 + VERSION: 3.3 + LONG_VERSION: 3.3.9 + VARIANT: almalinux8 + PARENT: centos + ISPARENT: True + + scratch312_3.3.9: MAJOR_VERSION: 3 VERSION: 3.3 diff --git a/docker-images/gitlab-ci.yml b/docker-images/gitlab-ci.yml index efd1e1c17..b5a3aaf40 100644 --- a/docker-images/gitlab-ci.yml +++ b/docker-images/gitlab-ci.yml @@ -65,6 +65,17 @@ PARENT: "centos" ISPARENT: "True" +4.4-almalinux8: + extends: .docker + stage: almalinux8 + variables: + MAJOR_VERSION: 4 + VERSION: "4.4" + LONG_VERSION: "4.4" + VARIANT: almalinux8 + PARENT: "almalinux" + ISPARENT: "True" + 4.4-scratch312: extends: .docker stage: scratch312 @@ -186,6 +197,17 @@ PARENT: "centos" ISPARENT: "True" +4.3.2-almalinux8: + extends: .docker + stage: almalinux8 + variables: + MAJOR_VERSION: 4 + VERSION: "4.3" + LONG_VERSION: "4.3.2" + VARIANT: almalinux8 + PARENT: "almalinux" + ISPARENT: "True" + 4.3.2-scratch312: extends: .docker stage: scratch312 @@ -296,6 +318,17 @@ PARENT: "centos" ISPARENT: "True" +4.2.4-almalinux8: + extends: .docker + stage: almalinux8 + variables: + MAJOR_VERSION: 4 + VERSION: "4.2" + LONG_VERSION: "4.2.4" + VARIANT: almalinux8 + PARENT: "centos" + ISPARENT: "True" + 4.2.4-scratch312: extends: .docker stage: scratch312 @@ -384,6 +417,17 @@ PARENT: "centos" ISPARENT: "True" +4.1.7-almalinux8: + extends: .docker + stage: almalinux8 + variables: + MAJOR_VERSION: 4 + VERSION: "4.1" + LONG_VERSION: "4.1.7" + VARIANT: almalinux8 + PARENT: "centos" + ISPARENT: "True" + 4.1.7-scratch312: extends: .docker stage: scratch312 @@ -472,6 +516,17 @@ PARENT: "centos" ISPARENT: "True" +4.0.6-almalinux8: + extends: .docker + stage: almalinux8 + variables: + MAJOR_VERSION: 4 + VERSION: "4.0" + LONG_VERSION: "4.0.6" + VARIANT: almalinux8 + PARENT: "centos" + ISPARENT: "True" + 4.0.6-scratch312: extends: .docker stage: scratch312 @@ -560,6 +615,17 @@ PARENT: "centos" ISPARENT: "True" +3.4.8-almalinux8: + extends: .docker + stage: almalinux8 + variables: + MAJOR_VERSION: 3 + VERSION: "3.4" + LONG_VERSION: "3.4.8" + VARIANT: almalinux8 + PARENT: "centos" + ISPARENT: "True" + 3.4.8-scratch312: extends: .docker stage: scratch312 @@ -648,6 +714,17 @@ PARENT: "centos" ISPARENT: "True" +3.3.9-almalinux8: + extends: .docker + stage: almalinux8 + variables: + MAJOR_VERSION: 3 + VERSION: "3.3" + LONG_VERSION: "3.3.9" + VARIANT: almalinux8 + PARENT: "centos" + ISPARENT: "True" + 3.3.9-scratch312: extends: .docker stage: scratch312 diff --git a/update.py b/update.py index 45ec5885c..26e28541a 100755 --- a/update.py +++ b/update.py @@ -25,6 +25,7 @@ {"name": "alpine38", "parent": "alpine"}, {"name": "centos7", "parent": "centos"}, {"name": "centos8", "parent": "centos"}, + {"name": "almalinux8", "parent": "almalinux"}, {"name": "scratch312", "parent": "scratch"}, {"name": "scratch38", "parent": "scratch"}, {"name": "vaapi1804", "parent": "vaapi"}, @@ -49,6 +50,7 @@ "3.2": [ "alpine312", "centos8", + "almalinux8", "nvidia2004", "scratch312", "ubuntu1804",