diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..6aabf891a --- /dev/null +++ b/.gitignore @@ -0,0 +1,164 @@ +list_of_recent_images.txt + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/latest/usage/project/#working-with-version-control +.pdm.toml +.pdm-python +.pdm-build/ + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ diff --git a/README.md b/README.md index c0f04df03..a0ab600ef 100644 --- a/README.md +++ b/README.md @@ -14,35 +14,69 @@ You can install the latest build of this image by running `docker pull jrottenbe This image can be used as a base for an encoding farm. -## Builds +## Builds / Avaliabvle Docker Containers There are different builds available: +Below is a table that provides examples for the nomenclature: + +`ffmpeg--` + +| image name | OS ver | ffmpeg ver | variant | description +| --- | --- | --- | --- | --- | +| ffmpeg-7.1-ubuntu2404 | 24.04 | 7.1 | [ubuntu](https://releases.ubuntu.com/) | external libraries are installed from os packages, and ffmpeg is built from source. See [Ubunu Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) for details on this. | +| ffmpeg-7.0-ubuntu2404-edge | 24.04 | 7.0 | [ubuntu](https://releases.ubuntu.com/) | libs and ffmpeg are built from source. See [Ubunu Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) for details on this. | +| ffmpeg-6.1-vaapi2404 | 24.04 | 6.1 | [ubuntu](https://releases.ubuntu.com/) | like: `ubuntu2404` but enables: [Video Acceleration API (VAAPI)](https://trac.ffmpeg.org/wiki/HWAccelIntro#VAAPI) in ffmpeg | +| ffmpeg-5.1-nvidia2204-edge | 22.04 | 5.1 | [ubuntu](https://releases.ubuntu.com/) | Built w/ [NVIDIA's hardware-accelerated encoding and decoding APIs](https://trac.ffmpeg.org/wiki/HWAccelIntro#CUDANVENCNVDEC) enabled | +| ffmpeg-7.1-alpine320 | 3.20 | 7.1 | [alpine](https://alpinelinux.org/releases/) | vendor libs, but ffmpeg is built from source | +| ffmpeg-7.0-scratch | 3.20 | 7.0 | [alpine](https://alpinelinux.org/releases/) | vendor libs, and ffmpeg are built from source. Also we make the distro as small as possible by not installing any packages in base and striping symbols of installed libs | + +ffmpeg `` can be one of the following: `5.1`, `6.1`, `7.0`, `7.1` with the above table. + +Note: I changed the ffmpeg version number in the table above as an example of how this works. Probably best to stick with the latest ffmpeg. + + +
Here are some additional older builds + - alpine based images `ffmpeg:-alpine` or `ffmpeg:-alpine313` (old versions with `ffmpeg:-alpine312` , `ffmpeg:-alpine311`) - alpine based scratch images `ffmpeg:-scratch` or `ffmpeg:-scratch313` (old versions with `ffmpeg:-scratch312` , `ffmpeg:-scratch311`) - ubuntu based images `ffmpeg:-ubuntu` or `ffmpeg:-ubuntu2004` (old versions with `ffmpeg:-ubuntu1804` , `ffmpeg:-ubuntu1604`) - ubuntu based nvidia images `ffmpeg:-nvidia` or `ffmpeg:-nvidia2004` (old versions with `ffmpeg:-nvidia1804`, `ffmpeg:-nvidia1604`) - ubuntu based vaapi images `ffmpeg:-vaapi1804` or `ffmpeg:-vaapi2004` (old versions with `ffmpeg:-vaapi1804`, `ffmpeg:-nvidia1604`) -`` can be one of the following: -- 3.2 -- 3.3 -- 3.4 -- 4.0 -- 4.1 -- 4.2 -- 4.3 -- 4.4 +
+### Philosophy behind the different builds +**ubuntu2404** +We chose Ubuntu 24.04 because it is the LTS ( Long Term Support ) build of Ubuntu. +We used the ffmpeg support libraries from the Ubuntu distrobution where possible. Example: we use 'libx264-dev' as the package to install. We do not tie it to a version. This way when its time to update from 24.04 to 26.04 we can simply update the base Docker template for ubuntu. This will make updating the OS easier as time goes on. +**ubuntu2404-edge** +This image is just like the above `ubuntu2404` container image, except we build all of the ffmpeg support libraries. This is in the spirit of the original intent of this project `jrottenberg/ffmpeg` alltogether. Building everything that ffmpeg needs, and ffmpeg itself from source. This gives us the most control over all of the details of release. The drawback of this is that its much harder to keep updated. The thought process of having both 'Ubuntu-2404' and 'Ubuntu-2404-edge' is that it makes updating the OS easier over time. +**vaapi2404** + This release is like also `ubuntu2404` but enables: [Video Acceleration API (VAAPI)](https://trac.ffmpeg.org/wiki/HWAccelIntro#VAAPI) when building ffmpeg + +**nvidia2204-edge** + This release is like also `ubuntu2404` but enables: [NVIDIA's hardware-accelerated encoding and decoding APIs](https://trac.ffmpeg.org/wiki/HWAccelIntro#CUDANVENCNVDEC) enabled +**alpine320** +[alpine](https://alpinelinux.org/releases/) uses the os vendor libs, but ffmpeg is built from source. -### Generate list of recent images +**scratch** +Scratch is also an [alpine](https://alpinelinux.org/releases/) image. We build the vendor libs, and ffmpeg from source. Also we make the distro as small as possible by not installing any packages in base and striping symbols of installed libs. + +### Generate list of recent Docker Container Images You can use the following command to generate a list of current images: ```bash -$ curl --silent https://hub.docker.com/v2/repositories/jrottenberg/ffmpeg/tags/?page_size=500 | jq -cr ".results|sort_by(.name)|reverse[]|.sz=(.full_size/1048576|floor|tostring+\"mb\")|[.name,( (20-(.name|length))*\" \" ),.sz,( (8-(.sz|length))*\" \"),.last_updated[:10]]|@text|gsub(\"[,\\\"\\\]\\\[]\";null)" +$ python3 -mvenv .venv +$ source .venv/bin/activate +$ pip install requests +$ python3 ./generate-list-of-recent-images.py > list_of_recent_images.txt +$ deactivate +$ rm -rf .venv +$ less list_of_recent_images.txt ``` If you want to compare the one you have locally, use the following command: @@ -218,8 +252,7 @@ Full hardware acceleration example: ##### See what's inside the beast ```bash -docker run -it --entrypoint='bash' jrottenberg/ffmpeg:4.4-ubuntu - +docker run -it --entrypoint='bash' jrottenberg/ffmpeg:7.1-ubuntu2404 for i in ogg amr vorbis theora mp3lame opus vpx xvid fdk x264 x265;do echo $i; find /usr/local/ -name *$i*;done ``` diff --git a/docker-images/5.1/alpine320/Dockerfile b/docker-images/5.1/alpine320/Dockerfile new file mode 100644 index 000000000..3939b7a06 --- /dev/null +++ b/docker-images/5.1/alpine320/Dockerfile @@ -0,0 +1,369 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# + +FROM alpine:3.20 as base + +RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git + +FROM base as build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=5.1.6 \ + AOM_VERSION=v3.8.1 \ + CHROMAPRINT_VERSION=1.5.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.6 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.5.2 \ + PYTHON=python3 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.7 \ + LIBXML2_VERSION=2.9.12 \ + LIBBLURAY_VERSION=1.1.2 \ + # LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.3.1 \ + ZIMG_VERSION=3.0.5 \ + 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 LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + + +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 libDeps="libgomp \ + # https://github.com/zeromq/libzmq/ + zeromq \ + zeromq-dev \ + # https://sourceforge.net/projects/opencore-amr/ + opencore-amr \ + opencore-amr-dev \ + # https://www.xiph.org/ogg/ + libogg \ + libogg-static \ + libogg-dev \ + # libtheora http://www.theora.org/ + libtheora \ + libtheora-static \ + libtheora-dev \ + # http://www.videolan.org/developers/x264.html + x264 \ + x264-libs \ + x264-dev \ + # http://x265.org/ + x265 \ + x265-libs \ + x265-dev \ + # https://www.opus-codec.org/ + opus \ + opus-tools \ + opus-dev \ + # https://xiph.org/vorbis/ + libvorbis \ + libvorbis-static \ + libvorbis-dev \ + # https://www.webmproject.org/code/ + libvpx \ + libvpx-utils \ + libvpx-dev \ + # https://developers.google.com/speed/webp/ + libwebp \ + libwebp-dev \ + libwebp-static \ + libwebp-tools \ + # http://lame.sourceforge.net/ + lame \ + lame-libs \ + lame-dev \ + # https://www.xvid.com/ + xvidcore \ + xvidcore-static \ + xvidcore-dev \ + # https://github.com/mstorsjo/fdk-aac + fdk-aac \ + fdk-aac-dev \ + # https://github.com/uclouvain/openjpeg + openjpeg \ + openjpeg-tools \ + openjpeg-dev \ + # https://www.freetype.org/ + freetype \ + freetype-static \ + freetype-dev \ + # https://github.com/georgmartius/vid.stab + vidstab \ + vidstab-dev \ + ## https://www.fribidi.org/ + fribidi \ + fribidi-static \ + fribidi-dev \ + # fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ + fontconfig \ + fontconfig-static \ + fontconfig-dev \ + # https://github.com/libass/libass + libass \ + libass-dev \ + # https://aomedia.googlesource.com/aom + aom \ + aom-libs \ + aom-dev \ + # https://xcb.freedesktop.org/ + # https://www.x.org/archive//individual/util/util-macros- + util-macros \ + # https://www.x.org/archive/individual/proto/xproto- + xorgproto \ + # https://www.x.org/archive/individual/lib/libXau- + libxau \ + libxau-dev \ + # https://github.com/GNOME/libxml2/ + libxml2 \ + libxml2-static \ + libxml2-utils \ + libxml2-dev \ + # https://github.com/Haivision/srt + libsrt \ + libsrt-progs \ + libsrt-dev \ + # https://git.code.sf.net/p/libpng/code + libpng \ + libpng-static \ + libpng-utils \ + libpng-dev \ + # https://github.com/sekrit-twc/zimg + zimg \ + zimg-dev" && \ + apk add --no-cache --update ${libDeps} + + +RUN buildDeps="autoconf \ + automake \ + bash \ + binutils \ + bzip2 \ + cmake \ + coreutils \ + curl \ + diffutils \ + expat-dev \ + file \ + g++ \ + gcc \ + gperf \ + libtool \ + make \ + nasm \ + openssl-dev \ + python3 \ + tar \ + xcb-proto \ + yasm \ + zlib-dev \ + alpine-sdk \ + linux-headers" && \ + apk add --no-cache --update ${buildDeps} +## 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 + +## 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} + +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? +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} + + +## 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} + +## 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} + +## Download 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 && \ + ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ + make ; make install + + + + + +# ## Build ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libsvtav1 \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lm \ + --extra-libs=-lpthread \ + --ld=g++ \ + --prefix="${PREFIX}" && \ + make clean && \ + 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/lib/ && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + mkdir -p /usr/local/include && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +### Release Stage +FROM base as release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local diff --git a/docker-images/5.1/nvidia2204/Dockerfile b/docker-images/5.1/nvidia2204/Dockerfile index 32a3acfe5..e86f1f13e 100644 --- a/docker-images/5.1/nvidia2204/Dockerfile +++ b/docker-images/5.1/nvidia2204/Dockerfile @@ -33,62 +33,101 @@ FROM devel-base as build ENV NVIDIA_HEADERS_VERSION=11.1.5.3 ENV FFMPEG_VERSION=5.1.6 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ - 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.12 \ - 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 \ - ZIMG_VERSION=3.0.5 \ - 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 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 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" + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" RUN buildDeps="autoconf \ @@ -122,420 +161,94 @@ RUN \ make install PREFIX="${PREFIX}" && \ rm -rf ${DIR} -## 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 + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev -## opencore-amr https://sourceforge.net/projects/opencore-amr/ -RUN \ - DIR=/tmp/opencore-amr && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ - 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://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ - 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 \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ 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 && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ rm -rf ${DIR} +## libvmaf https://github.com/Netflix/vmaf 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} - - -## libxml2 - for libbluray -RUN \ - DIR=/tmp/libxml2 && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ - tar -xz --strip-components=1 && \ - ./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} + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ -## libaribb24 +# https://github.com/Netflix/vmaf/issues/788 RUN \ - DIR=/tmp/b24 && \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ 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} + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 -# zimg https://github.com/sekrit-twc/zimg -RUN \ - DIR=/tmp/zimg && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/sekrit-twc/zimg/archive/refs/tags/release-${ZIMG_VERSION}.tar.gz | \ - tar -zx --strip-components=1 && \ - ./autogen.sh && \ - ./configure --prefix="${PREFIX}" --enable-shared && \ - make && \ - make install && \ - rm -rf ${DIR} +#### Do we really need to build ffmpeg twice? seems silly ## Download ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ 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 && \ - ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ - make ; make install - - - - - -## Build ffmpeg https://ffmpeg.org/ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ DIR=/tmp/ffmpeg && cd ${DIR} && \ - ./configure \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ --disable-debug \ --disable-doc \ --disable-ffplay \ @@ -579,7 +292,6 @@ RUN \ --extra-libs=-ldl \ --extra-libs=-lpthread \ --prefix="${PREFIX}" && \ - make clean && \ make && \ make install && \ make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ @@ -588,6 +300,7 @@ RUN \ cd tools && \ make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + ## cleanup RUN \ LD_LIBRARY_PATH="${PREFIX}/lib:${PREFIX}/lib64:${LD_LIBRARY_PATH}" ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ diff --git a/docker-images/5.1/alpine313/Dockerfile b/docker-images/5.1/scratch320/Dockerfile similarity index 78% rename from docker-images/5.1/alpine313/Dockerfile rename to docker-images/5.1/scratch320/Dockerfile index 47b6e7808..078d0583c 100644 --- a/docker-images/5.1/alpine313/Dockerfile +++ b/docker-images/5.1/scratch320/Dockerfile @@ -4,74 +4,72 @@ # # -FROM alpine:3.13 AS base - -RUN apk add --no-cache --update libgcc libstdc++ ca-certificates libcrypto1.1 libssl1.1 libgomp expat git - - -FROM base AS build +FROM alpine:3.20 as build WORKDIR /tmp/workdir ENV FFMPEG_VERSION=5.1.6 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ + LIBVMAF_VERSION=2.3.1 \ + OPENCOREAMR_VERSION=0.1.6 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + OGG_VERSION=1.3.5 \ + OPUS_VERSION=1.3 \ + VORBIS_VERSION=1.3.7 \ 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 \ + WEBP_VERSION=1.4.0 \ + LAME_VERSION=3.100 \ + XVID_VERSION=1.3.7 \ + FDKAAC_VERSION=2.0.3 \ + OPENJPEG_VERSION=2.5.2 \ + FREETYPE_VERSION=2.13.3 \ + LIBVIDSTAB_VERSION=1.1.1 \ + FRIBIDI_VERSION=1.0.16 \ + FONTCONFIG_VERSION=2.15.0 \ + LIBASS_VERSION=0.17.3 \ + KVAZAAR_VERSION=2.3.1 \ + AOM_VERSION=v3.10.0 \ + XORG_MACROS_VERSION=1.20.1 \ XPROTO_VERSION=7.0.31 \ - XVID_VERSION=1.3.4 \ - LIBXML2_VERSION=2.9.12 \ - LIBBLURAY_VERSION=1.1.2 \ - LIBZMQ_VERSION=4.3.2 \ - LIBSRT_VERSION=1.4.1 \ + XAU_VERSION=1.0.11 \ + LIBPTHREAD_STUBS_VERSION=0.5 \ + LIBXML2_VERSION=2.13.4 \ + LIBBLURAY_VERSION=1.3.4 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBPNG_VERSION=1.6.44 \ LIBARIBB24_VERSION=1.0.3 \ - LIBPNG_VERSION=1.6.9 \ - LIBVMAF_VERSION=2.1.1 \ ZIMG_VERSION=3.0.5 \ 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" +# + # CHROMAPRINT_VERSION=1.5.0 \ + # LIBXCB_VERSION=1.13.1 \ + # XCBPROTO_VERSION=1.13 \ + # PYTHON=python3 \ + +ARG OGG_SHA256SUM="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.5.tar.gz" +ARG OPUS_SHA256SUM="4f3d69aefdf2dbaf9825408e452a8a414ffc60494c70633560700398820dc550 opus-1.3.tar.gz" +ARG VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.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 LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" -ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG FREETYPE_SHA256SUM="5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 freetype-2.13.3.tar.gz" +# ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 1.0.16.tar.gz" +# ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +# ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBBLURAY_SHA512SUM="94dbf3b68d1c23fe4648c153cc2f0c251886fac0a6b6bbe3a77caabaa5322682f712afe4a7b6b16ca3f06744fbc0e1ca872209a32898dcf0ae182055d335aec1 libbluray-1.3.4.tar.bz2" +ARG LIBZMQ_SHA256SUM="ae933b1e98411fd7cb8309f9502d2737 zeromq-4.3.5.tar.gz" ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + 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 apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git libgomp + RUN buildDeps="autoconf \ automake \ bash \ @@ -94,8 +92,13 @@ RUN buildDeps="autoconf \ tar \ xcb-proto \ yasm \ - zlib-dev" && \ + zlib-dev \ + alpine-sdk \ + linux-headers" && \ apk add --no-cache --update ${buildDeps} + +#RUN apk add --no-cache --update meson samuri + ## libvmaf https://github.com/Netflix/vmaf RUN \ if which meson || false; then \ @@ -143,9 +146,9 @@ RUN \ DIR=/tmp/x265 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265-${X265_VERSION}/build/linux && \ + 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 && \ @@ -189,6 +192,7 @@ RUN \ make install && \ rm -rf ${DIR} ### libtheora http://www.theora.org/ +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure RUN \ DIR=/tmp/theora && \ mkdir -p ${DIR} && \ @@ -196,7 +200,7 @@ RUN \ 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 && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --build="aarch64-unknown-linux-gnu" --enable-shared && \ make && \ make install && \ rm -rf ${DIR} @@ -214,7 +218,7 @@ RUN \ rm -rf ${DIR} ### libwebp https://developers.google.com/speed/webp/ RUN \ - DIR=/tmp/vebp && \ + DIR=/tmp/webp && \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ @@ -239,8 +243,7 @@ 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 && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ cd xvidcore/build/generic && \ ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ @@ -264,9 +267,10 @@ RUN \ DIR=/tmp/openjpeg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ make install && \ rm -rf ${DIR} @@ -288,7 +292,7 @@ RUN \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ - echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + # echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -299,9 +303,9 @@ 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 && \ + curl -sLO https://github.com/fribidi/fribidi/archive/refs/tags/v${FRIBIDI_VERSION}.tar.gz && \ + # echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f fribidi-${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 && \ @@ -313,19 +317,19 @@ 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 && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz && \ + tar -zx --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 +## libass v 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 && \ + # echo ${LIBASS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -337,7 +341,7 @@ RUN \ DIR=/tmp/kvazaar && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v2.3.1/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -358,12 +362,13 @@ RUN \ rm -rf ${DIR} ## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## util-macros 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 && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.xz && \ + tar -Jx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ make && \ make install && \ @@ -391,6 +396,7 @@ RUN \ make install && \ rm -rf ${DIR} +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? RUN \ DIR=/tmp/libpthread-stubs && \ mkdir -p ${DIR} && \ @@ -421,21 +427,22 @@ RUN \ 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 && \ + echo ${LIBBLURAY_SHA512SUM} | sha512sum --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} +# Update Use the zeromq zeromq-dev packages from the alpine repository ## 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 && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha512sum --check && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" && \ make && \ @@ -448,7 +455,7 @@ RUN \ DIR=/tmp/srt && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/v${LIBSRT_VERSION}.tar.gz && \ tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -506,7 +513,7 @@ RUN \ -## Build ffmpeg https://ffmpeg.org/ +# ## Build ffmpeg https://ffmpeg.org/ RUN \ DIR=/tmp/ffmpeg && cd ${DIR} && \ ./configure \ @@ -519,7 +526,8 @@ RUN \ --enable-libaribb24 \ --enable-libass \ --enable-libbluray \ - --enable-libfdk_aac \ + --enable-libdav1d \ + --enable-libfdk-aac \ --enable-libfreetype \ --enable-libkvazaar \ --enable-libmp3lame \ @@ -528,8 +536,10 @@ RUN \ --enable-libopenjpeg \ --enable-libopus \ --enable-libsrt \ + --enable-libsvtav1 \ --enable-libtheora \ --enable-libvidstab \ + --enable-libvmaf \ --enable-libvorbis \ --enable-libvpx \ --enable-libwebp \ @@ -547,7 +557,9 @@ RUN \ --extra-cflags="-I${PREFIX}/include" \ --extra-ldflags="-L${PREFIX}/lib" \ --extra-libs=-ldl \ + --extra-libs=-lm \ --extra-libs=-lpthread \ + --ld=g++ \ --prefix="${PREFIX}" && \ make clean && \ make && \ @@ -560,29 +572,21 @@ RUN \ RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ - mkdir -p /usr/local/include && \ - cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ - mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ - done + mkdir -p /tmp/fakeroot/lib && \ + ldd ${PREFIX}/bin/ffmpeg | cut -d ' ' -f 3 | strings | xargs -I R cp R /tmp/fakeroot/lib/ && \ + for lib in /tmp/fakeroot/lib/*; do strip --strip-all $lib; done && \ + cp -r ${PREFIX}/bin /tmp/fakeroot/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /tmp/fakeroot/share/ && \ + LD_LIBRARY_PATH=/tmp/fakeroot/lib /tmp/fakeroot/bin/ffmpeg -buildconf ### Release Stage -FROM base AS release +FROM scratch as release LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 CMD ["--help"] -ENTRYPOINT ["ffmpeg"] - -COPY --from=build /usr/local /usr/local +ENTRYPOINT ["/bin/ffmpeg"] -# Let's make sure the app built correctly -# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output +COPY --from=build /tmp/fakeroot/ / diff --git a/docker-images/5.1/ubuntu2204/Dockerfile b/docker-images/5.1/ubuntu2204/Dockerfile deleted file mode 100644 index 35ba7092b..000000000 --- a/docker-images/5.1/ubuntu2204/Dockerfile +++ /dev/null @@ -1,590 +0,0 @@ -# ffmpeg - http://ffmpeg.org/download.html -# -# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu -# -# https://hub.docker.com/r/jrottenberg/ffmpeg/ -# -# -FROM ubuntu:20.04 AS base - -WORKDIR /tmp/workdir - -RUN apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ - apt-get autoremove -y && \ - apt-get clean -y - -FROM base as build - -ENV FFMPEG_VERSION=5.1.6 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ - 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.12 \ - 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 \ - ZIMG_VERSION=3.0.5 \ - 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 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 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" - - -ARG DEBIAN_FRONTEND=noninteractive - -RUN buildDeps="autoconf \ - automake \ - cmake \ - curl \ - bzip2 \ - libexpat1-dev \ - g++ \ - gcc \ - git \ - gperf \ - libtool \ - make \ - meson \ - nasm \ - perl \ - pkg-config \ - python \ - libssl-dev \ - yasm \ - zlib1g-dev" && \ - apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ${buildDeps} -## 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://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ - 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://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ - 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} - - -## libxml2 - for libbluray -RUN \ - DIR=/tmp/libxml2 && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ - tar -xz --strip-components=1 && \ - ./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} - -# zimg https://github.com/sekrit-twc/zimg -RUN \ - DIR=/tmp/zimg && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/sekrit-twc/zimg/archive/refs/tags/release-${ZIMG_VERSION}.tar.gz | \ - tar -zx --strip-components=1 && \ - ./autogen.sh && \ - ./configure --prefix="${PREFIX}" --enable-shared && \ - make && \ - make install && \ - rm -rf ${DIR} - -## Download 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 && \ - ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ - make ; make install - - - - - -## Build ffmpeg https://ffmpeg.org/ -RUN \ - DIR=/tmp/ffmpeg && cd ${DIR} && \ - ./configure \ - --disable-debug \ - --disable-doc \ - --disable-ffplay \ - --enable-fontconfig \ - --enable-gpl \ - --enable-libaom \ - --enable-libaribb24 \ - --enable-libass \ - --enable-libbluray \ - --enable-libfdk_aac \ - --enable-libfreetype \ - --enable-libkvazaar \ - --enable-libmp3lame \ - --enable-libopencore-amrnb \ - --enable-libopencore-amrwb \ - --enable-libopenjpeg \ - --enable-libopus \ - --enable-libsrt \ - --enable-libtheora \ - --enable-libvidstab \ - --enable-libvmaf \ - --enable-libvorbis \ - --enable-libvpx \ - --enable-libwebp \ - --enable-libx264 \ - --enable-libx265 \ - --enable-libxvid \ - --enable-libzimg \ - --enable-libzmq \ - --enable-nonfree \ - --enable-openssl \ - --enable-postproc \ - --enable-shared \ - --enable-small \ - --enable-version3 \ - --extra-cflags="-I${PREFIX}/include" \ - --extra-ldflags="-L${PREFIX}/lib" \ - --extra-libs=-ldl \ - --extra-libs=-lpthread \ - --prefix="${PREFIX}" && \ - make clean && \ - 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/ - -## cleanup -RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ - cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ - mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ - done - -FROM base AS release -LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ - org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg - -ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 - -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/5.1/vaapi2204/Dockerfile b/docker-images/5.1/ubuntu2404-edge/Dockerfile similarity index 63% rename from docker-images/5.1/vaapi2204/Dockerfile rename to docker-images/5.1/ubuntu2404-edge/Dockerfile index 384e64f41..afccaf90b 100644 --- a/docker-images/5.1/vaapi2204/Dockerfile +++ b/docker-images/5.1/ubuntu2404-edge/Dockerfile @@ -5,21 +5,17 @@ # https://hub.docker.com/r/jrottenberg/ffmpeg/ # # -FROM ubuntu:22.04 AS base +# Stage 1: Build +FROM ubuntu:24.04 AS builder -WORKDIR /tmp/workdir - -RUN apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ - apt-get autoremove -y && \ - apt-get clean -y -FROM base as build +WORKDIR /tmp/workdir ENV FFMPEG_VERSION=5.1.6 \ - AOM_VERSION=v3.8.1 \ + AOM_VERSION=v3.10.0 \ + SVTAV1_VERSION=2.2.1 \ CHROMAPRINT_VERSION=1.5.0 \ - FDKAAC_VERSION=0.1.5 \ + FDKAAC_VERSION=2.0.3 \ FONTCONFIG_VERSION=2.12.4 \ FREETYPE_VERSION=2.10.4 \ FRIBIDI_VERSION=0.19.7 \ @@ -30,28 +26,28 @@ ENV FFMPEG_VERSION=5.1.6 \ 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 \ + OGG_VERSION=1.3.5 \ + OPENCOREAMR_VERSION=0.1.6 \ + OPUS_VERSION=1.5.2 \ + OPENJPEG_VERSION=2.5.2 \ PYTHON=python3 \ 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 \ + VORBIS_VERSION=1.3.7 \ + VPX_VERSION=1.14.1 \ + WEBP_VERSION=1.4.0 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ XAU_VERSION=1.0.9 \ XORG_MACROS_VERSION=1.19.2 \ XPROTO_VERSION=7.0.31 \ - XVID_VERSION=1.3.4 \ + XVID_VERSION=1.3.7 \ LIBXML2_VERSION=2.9.12 \ LIBBLURAY_VERSION=1.1.2 \ - LIBZMQ_VERSION=4.3.2 \ - LIBSRT_VERSION=1.4.1 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ LIBARIBB24_VERSION=1.0.3 \ LIBPNG_VERSION=1.6.9 \ - LIBVMAF_VERSION=2.1.1 \ + LIBVMAF_VERSION=3.0.0 \ ZIMG_VERSION=3.0.5 \ SRC=/usr/local @@ -59,68 +55,66 @@ ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01 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 OGG_SHA256SUM="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.4.tar.gz" +ARG OPUS_SHA256SUM="65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1 opus-1.5.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 VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.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 MAKEFLAGS="-j2" -ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ARG PREFIX="/opt/ffmpeg" ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y + +# FROM base AS build + + RUN buildDeps="autoconf \ automake \ cmake \ + build-essential \ + texinfo \ curl \ + wget \ bzip2 \ libexpat1-dev \ - g++ \ gcc \ git \ + git-core \ gperf \ libtool \ make \ meson \ + ninja-build \ nasm \ perl \ pkg-config \ - libssl-dev \ + python3 \ yasm \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ libva-dev \ - zlib1g-dev" && \ + libvdpau-dev \ + libnuma-dev" && \ apt-get -yqq update && \ apt-get install -yq --no-install-recommends ${buildDeps} -## 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/ +# opencore-amr: from source RUN \ + echo "Building opencore-amr-${OPENCOREAMR_VERSION}" && \ DIR=/tmp/opencore-amr && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -130,8 +124,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -## x264 http://www.videolan.org/developers/x264.html + +# ## x264 http://www.videolan.org/developers/x264.html RUN \ + echo "Building x264-snapshot-${X264_VERSION}" && \ DIR=/tmp/x264 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -141,46 +137,56 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -### x265 http://x265.org/ + +# ### x265 http://x265.org/ ( videolan ) RUN \ + echo "Building x265_${X265_VERSION}" && \ DIR=/tmp/x265 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265-${X265_VERSION}/build/linux && \ + 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/ + +### libogg https://www.xiph.org/ogg/ ( xiph ) RUN \ + echo "Building libogg-${OGG_VERSION}" && \ 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 && \ + curl -sLO https://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/ + +### libopus https://www.opus-codec.org/ ( xiph ) +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +# apt libopus-dev RUN \ + echo "Building opus-${OPUS_VERSION}" && \ 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 && \ + curl -sL https://github.com/xiph/opus/releases/download/v${OPUS_VERSION}/opus-${OPUS_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + # echo ${OPUS_SHA256SUM} | sha256sum --check && \ ./configure --prefix="${PREFIX}" --enable-shared && \ + # ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \ make && \ make install && \ rm -rf ${DIR} -### libvorbis https://xiph.org/vorbis/ + +### libvorbis https://xiph.org/vorbis/ ( xiph ) RUN \ + echo "Building libvorbis-${VORBIS_VERSION}" && \ DIR=/tmp/vorbis && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -191,33 +197,28 @@ RUN \ 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/ +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +### configure w/ --as=yasm ?? +### double check that this came from the correct place. RUN \ + echo "Building libvpx-${VPX_VERSION}" && \ 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 && \ + curl -sL https://chromium.googlesource.com/webm/libvpx.git/+archive/v${VPX_VERSION}.tar.gz | \ + tar -zxm && \ ./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 && \ + echo "Building libwebp-${WEBP_VERSION}" && \ + DIR=/tmp/webp && \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ @@ -226,8 +227,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ### libmp3lame http://lame.sourceforge.net/ RUN \ + echo "Building lame-${LAME_VERSION}" && \ DIR=/tmp/lame && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -237,44 +240,55 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -### xvid https://www.xvid.com/ + +### xvid (xvidcore) https://www.xvid.com/ RUN \ + echo "Building xvidcore-${XVID_VERSION}" && \ 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 && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ 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 +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +# might not need --datadir anymore RUN \ + echo "Building fdk-aac-${FDKAAC_VERSION}" && \ DIR=/tmp/fdk-aac && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/refs/tags/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 \ + echo "Building openjpeg-${OPENJPEG_VERSION}" && \ DIR=/tmp/openjpeg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ make install && \ rm -rf ${DIR} + ## freetype https://www.freetype.org/ +# make sure to pass in --no-install-recommends for this one its globbie RUN \ + echo "Building freetype-${FREETYPE_VERSION}" && \ DIR=/tmp/freetype && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -285,8 +299,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -## libvstab https://github.com/georgmartius/vid.stab + +## libvidstab https://github.com/georgmartius/vid.stab RUN \ + echo "Building libvidstab-${LIBVIDSTAB_VERSION}" && \ DIR=/tmp/vid.stab && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -297,8 +313,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## fridibi https://www.fribidi.org/ RUN \ + echo "Building fribidi-${FRIBIDI_VERSION}" && \ DIR=/tmp/fribidi && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -311,8 +329,10 @@ RUN \ make -j1 && \ make install && \ rm -rf ${DIR} + ## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ RUN \ + echo "Building fontconfig-${FONTCONFIG_VERSION}" && \ DIR=/tmp/fontconfig && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -322,8 +342,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## libass https://github.com/libass/libass RUN \ + echo "Building libass-${LIBASS_VERSION}" && \ DIR=/tmp/libass && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -335,8 +357,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## kvazaar https://github.com/ultravideo/kvazaar RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ DIR=/tmp/kvazaar && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -347,43 +371,77 @@ RUN \ make && \ make install && \ rm -rf ${DIR} - +# lib aom +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom RUN \ + echo "Building aom-${AOM_VERSION}" && \ 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 ..; \ + # cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libsvtav1 https://gitlab.com/AOMediaCodec/SVT-AV1.git +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +# RUN \ +# echo "Installing dependencies libpng" && \ +# apt-get install -yq libsvtav1enc-dev + +RUN \ + echo "Building SVT-AV1 v${SVTAV1_VERSION}" && \ + DIR=/tmp/libsvtav1 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${SVTAV1_VERSION}/SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + cd Build && \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=Release -DBUILD_DEC=OFF -DBUILD_SHARED_LIBS=OFF ..; \ make ; \ make install ; \ rm -rf ${DIR} -## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## libdav1d https://code.videolan.org/videolan/dav1d +## https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## installed w/ apt-get in the build stage RUN \ + echo "installing libdav1d-dev with debian packages" && \ + apt-get install -yq libdav1d-dev + +## x.org: util-macros (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + echo "Building x.org: util-macros-${XORG_MACROS_VERSION}" && \ 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 && \ + 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} +## x.org: xproto RUN \ + echo "Building x.org: xproto-${XPROTO_VERSION}" && \ 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 && \ + cp /usr/share/misc/config.guess . && \ ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ make && \ make install && \ rm -rf ${DIR} +## libXau RUN \ + echo "Building x.org: libXau-${XAU_VERSION}" && \ DIR=/tmp/libXau && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -394,7 +452,9 @@ RUN \ make install && \ rm -rf ${DIR} +## libpthread-stubs RUN \ + echo "Building libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}" && \ DIR=/tmp/libpthread-stubs && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -408,6 +468,7 @@ RUN \ ## libxml2 - for libbluray RUN \ + echo "Building libxml2-${LIBXML2_VERSION}" && \ DIR=/tmp/libxml2 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -420,6 +481,7 @@ RUN \ ## libbluray - Requires libxml, freetype, and fontconfig RUN \ + echo "Building libbluray-${LIBBLURAY_VERSION}" && \ DIR=/tmp/libbluray && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -432,13 +494,14 @@ RUN \ rm -rf ${DIR} ## libzmq https://github.com/zeromq/libzmq/ +# this one pulls in a bunch of dependencies RUN \ + echo "Building libzmq-${LIBZMQ_VERSION}" && \ 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 && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" && \ make && \ @@ -446,20 +509,11 @@ RUN \ 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 +# also pulls in a bunch of stuff RUN \ + echo "Building libpng-${LIBPNG_VERSION}" && \ DIR=/tmp/png && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -472,6 +526,7 @@ RUN \ ## libaribb24 RUN \ + echo "Building libaribb24-${LIBARIBB24_VERSION}" && \ DIR=/tmp/b24 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -486,6 +541,7 @@ RUN \ # zimg https://github.com/sekrit-twc/zimg RUN \ + echo "Building zimg-${ZIMG_VERSION}" && \ DIR=/tmp/zimg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -497,21 +553,98 @@ RUN \ make install && \ rm -rf ${DIR} +### libtheora http://www.theora.org/ ( xiph ) +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +RUN \ + echo "Building libtheora-${THEORA_VERSION}" && \ + 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 && \ + # add sym link for sdl-config + # ln -s /usr/bin/sdl2-config /usr/bin/sdl-config && \ + # currently build does not find sdl-config, and thus no playback support is enabled (probably exacly, the way it was before) + # Note: consider installing doxygen so that the api documentation is built + # right now, I did not, so we can keep everything small. + # disable examples to advoid the libjpeg sizeof error still in the example code. + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +# RUN \ +# echo "installing libsrt-dev with debian package: Secure Reliable Transport UDP streaming library (OpenSSL flavour)" && \ +# apt-get install -yq libsrt1.5-openssl +# libsrt-openssl-dev +RUN \ + echo "Adding libssl-dev for libsrt build" && \ + apt-get install -yq --no-install-recommends libssl-dev + # Note: we can get the config error + # GnuTLS('libgnutls28-dev') and OpenSSL('libssl-dev') must not be enabled at the same time, + # from a previous build + # so we add libssl-dev and later in the build + + ## libsrt https://github.com/Haivision/srt +RUN \ + echo "Building libsrt-${LIBSRT_VERSION}" && \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/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} + + + +## libvmaf https://github.com/Netflix/vmaf +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + + ## Download ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (intial) ffmpeg-${FFMPEG_VERSION}" && \ 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 && \ - ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ - make ; make install - - + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install ## Build ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (final) ffmpeg-${FFMPEG_VERSION}" && \ DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ ./configure \ --disable-debug \ --disable-doc \ @@ -547,14 +680,12 @@ RUN \ --enable-postproc \ --enable-shared \ --enable-small \ - --enable-vaapi \ --enable-version3 \ - --extra-cflags="-I${PREFIX}/include" \ - --extra-ldflags="-L${PREFIX}/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu" \ --extra-libs=-ldl \ --extra-libs=-lpthread \ --prefix="${PREFIX}" && \ - make clean && \ make && \ make install && \ make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ @@ -563,20 +694,33 @@ RUN \ cd tools && \ make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + + ## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ cp ${PREFIX}/bin/* /usr/local/bin/ && \ cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ mkdir -p /usr/local/lib/pkgconfig && \ - for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ done -FROM base AS release +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg @@ -585,12 +729,3 @@ ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 CMD ["--help"] ENTRYPOINT ["ffmpeg"] -COPY --from=build /usr/local /usr/local/ - -RUN \ - apt-get update -y && \ - apt-get install -y --no-install-recommends libva-drm2 libva2 i965-va-driver && \ - rm -rf /var/lib/apt/lists/* - -# 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/5.1/ubuntu2404/Dockerfile b/docker-images/5.1/ubuntu2404/Dockerfile new file mode 100644 index 000000000..4ff995a65 --- /dev/null +++ b/docker-images/5.1/ubuntu2404/Dockerfile @@ -0,0 +1,329 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +# Stage 1: Build +FROM ubuntu:24.04 AS builder + + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=5.1.6 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y + +# FROM base AS build + + + +RUN buildDeps="autoconf \ + automake \ + cmake \ + build-essential \ + texinfo \ + curl \ + wget \ + bzip2 \ + libexpat1-dev \ + gcc \ + git \ + git-core \ + gperf \ + libtool \ + make \ + meson \ + ninja-build \ + nasm \ + perl \ + pkg-config \ + python3 \ + yasm \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ + libva-dev \ + libvdpau-dev \ + libnuma-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} + +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libsvtav1 \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu" \ + --extra-libs=-ldl \ + --extra-libs=-lm \ + --extra-libs=-lpthread \ + --ld=g++ \ + --prefix="${PREFIX}" && \ + 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/ + + + + +## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) +RUN \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ + done + +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + diff --git a/docker-images/5.1/vaapi2404/Dockerfile b/docker-images/5.1/vaapi2404/Dockerfile new file mode 100644 index 000000000..0211051f5 --- /dev/null +++ b/docker-images/5.1/vaapi2404/Dockerfile @@ -0,0 +1,309 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM ubuntu:24.04 as base + +WORKDIR /tmp/workdir + +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 && \ + apt-get autoremove -y && \ + apt-get clean -y + +FROM base as build + +ENV FFMPEG_VERSION=5.1.6 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive + +RUN buildDeps="autoconf \ + automake \ + cmake \ + curl \ + bzip2 \ + libexpat1-dev \ + g++ \ + gcc \ + git \ + gperf \ + libtool \ + make \ + meson \ + nasm \ + perl \ + pkg-config \ + libssl-dev \ + yasm \ + libva-dev \ + zlib1g-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-vaapi \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lpthread \ + --prefix="${PREFIX}" && \ + 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/ + + +## cleanup +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ + for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +FROM base AS release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local/ + +RUN \ + apt-get update -y && \ + apt-get install -y --no-install-recommends libva-drm2 libva2 i965-va-driver && \ + rm -rf /var/lib/apt/lists/* + +# 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/6.1/alpine320/Dockerfile b/docker-images/6.1/alpine320/Dockerfile new file mode 100644 index 000000000..abe247489 --- /dev/null +++ b/docker-images/6.1/alpine320/Dockerfile @@ -0,0 +1,369 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# + +FROM alpine:3.20 as base + +RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git + +FROM base as build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=6.1.2 \ + AOM_VERSION=v3.8.1 \ + CHROMAPRINT_VERSION=1.5.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.6 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.5.2 \ + PYTHON=python3 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.7 \ + LIBXML2_VERSION=2.9.12 \ + LIBBLURAY_VERSION=1.1.2 \ + # LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.3.1 \ + ZIMG_VERSION=3.0.5 \ + 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 LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + + +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 libDeps="libgomp \ + # https://github.com/zeromq/libzmq/ + zeromq \ + zeromq-dev \ + # https://sourceforge.net/projects/opencore-amr/ + opencore-amr \ + opencore-amr-dev \ + # https://www.xiph.org/ogg/ + libogg \ + libogg-static \ + libogg-dev \ + # libtheora http://www.theora.org/ + libtheora \ + libtheora-static \ + libtheora-dev \ + # http://www.videolan.org/developers/x264.html + x264 \ + x264-libs \ + x264-dev \ + # http://x265.org/ + x265 \ + x265-libs \ + x265-dev \ + # https://www.opus-codec.org/ + opus \ + opus-tools \ + opus-dev \ + # https://xiph.org/vorbis/ + libvorbis \ + libvorbis-static \ + libvorbis-dev \ + # https://www.webmproject.org/code/ + libvpx \ + libvpx-utils \ + libvpx-dev \ + # https://developers.google.com/speed/webp/ + libwebp \ + libwebp-dev \ + libwebp-static \ + libwebp-tools \ + # http://lame.sourceforge.net/ + lame \ + lame-libs \ + lame-dev \ + # https://www.xvid.com/ + xvidcore \ + xvidcore-static \ + xvidcore-dev \ + # https://github.com/mstorsjo/fdk-aac + fdk-aac \ + fdk-aac-dev \ + # https://github.com/uclouvain/openjpeg + openjpeg \ + openjpeg-tools \ + openjpeg-dev \ + # https://www.freetype.org/ + freetype \ + freetype-static \ + freetype-dev \ + # https://github.com/georgmartius/vid.stab + vidstab \ + vidstab-dev \ + ## https://www.fribidi.org/ + fribidi \ + fribidi-static \ + fribidi-dev \ + # fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ + fontconfig \ + fontconfig-static \ + fontconfig-dev \ + # https://github.com/libass/libass + libass \ + libass-dev \ + # https://aomedia.googlesource.com/aom + aom \ + aom-libs \ + aom-dev \ + # https://xcb.freedesktop.org/ + # https://www.x.org/archive//individual/util/util-macros- + util-macros \ + # https://www.x.org/archive/individual/proto/xproto- + xorgproto \ + # https://www.x.org/archive/individual/lib/libXau- + libxau \ + libxau-dev \ + # https://github.com/GNOME/libxml2/ + libxml2 \ + libxml2-static \ + libxml2-utils \ + libxml2-dev \ + # https://github.com/Haivision/srt + libsrt \ + libsrt-progs \ + libsrt-dev \ + # https://git.code.sf.net/p/libpng/code + libpng \ + libpng-static \ + libpng-utils \ + libpng-dev \ + # https://github.com/sekrit-twc/zimg + zimg \ + zimg-dev" && \ + apk add --no-cache --update ${libDeps} + + +RUN buildDeps="autoconf \ + automake \ + bash \ + binutils \ + bzip2 \ + cmake \ + coreutils \ + curl \ + diffutils \ + expat-dev \ + file \ + g++ \ + gcc \ + gperf \ + libtool \ + make \ + nasm \ + openssl-dev \ + python3 \ + tar \ + xcb-proto \ + yasm \ + zlib-dev \ + alpine-sdk \ + linux-headers" && \ + apk add --no-cache --update ${buildDeps} +## 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 + +## 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} + +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? +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} + + +## 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} + +## 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} + +## Download 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 && \ + ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ + make ; make install + + + + + +# ## Build ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libsvtav1 \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lm \ + --extra-libs=-lpthread \ + --ld=g++ \ + --prefix="${PREFIX}" && \ + make clean && \ + 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/lib/ && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + mkdir -p /usr/local/include && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +### Release Stage +FROM base as release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local diff --git a/docker-images/6.1/nvidia2204/Dockerfile b/docker-images/6.1/nvidia2204/Dockerfile index 4bd0ad8df..d75f50b3b 100644 --- a/docker-images/6.1/nvidia2204/Dockerfile +++ b/docker-images/6.1/nvidia2204/Dockerfile @@ -33,62 +33,101 @@ FROM devel-base as build ENV NVIDIA_HEADERS_VERSION=11.1.5.3 ENV FFMPEG_VERSION=6.1.2 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ - 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.12 \ - 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 \ - ZIMG_VERSION=3.0.5 \ - 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 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 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" + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" RUN buildDeps="autoconf \ @@ -122,420 +161,94 @@ RUN \ make install PREFIX="${PREFIX}" && \ rm -rf ${DIR} -## 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 + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev -## opencore-amr https://sourceforge.net/projects/opencore-amr/ -RUN \ - DIR=/tmp/opencore-amr && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ - 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://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ - 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 \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ 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 && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ rm -rf ${DIR} +## libvmaf https://github.com/Netflix/vmaf 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} - - -## libxml2 - for libbluray -RUN \ - DIR=/tmp/libxml2 && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ - tar -xz --strip-components=1 && \ - ./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} + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ -## libaribb24 +# https://github.com/Netflix/vmaf/issues/788 RUN \ - DIR=/tmp/b24 && \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ 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} + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 -# zimg https://github.com/sekrit-twc/zimg -RUN \ - DIR=/tmp/zimg && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/sekrit-twc/zimg/archive/refs/tags/release-${ZIMG_VERSION}.tar.gz | \ - tar -zx --strip-components=1 && \ - ./autogen.sh && \ - ./configure --prefix="${PREFIX}" --enable-shared && \ - make && \ - make install && \ - rm -rf ${DIR} +#### Do we really need to build ffmpeg twice? seems silly ## Download ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ 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 && \ - ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ - make ; make install - - - - - -## Build ffmpeg https://ffmpeg.org/ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ DIR=/tmp/ffmpeg && cd ${DIR} && \ - ./configure \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ --disable-debug \ --disable-doc \ --disable-ffplay \ @@ -579,7 +292,6 @@ RUN \ --extra-libs=-ldl \ --extra-libs=-lpthread \ --prefix="${PREFIX}" && \ - make clean && \ make && \ make install && \ make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ @@ -588,6 +300,7 @@ RUN \ cd tools && \ make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + ## cleanup RUN \ LD_LIBRARY_PATH="${PREFIX}/lib:${PREFIX}/lib64:${LD_LIBRARY_PATH}" ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ diff --git a/docker-images/6.1/ubuntu2204/Dockerfile b/docker-images/6.1/scratch320/Dockerfile similarity index 74% rename from docker-images/6.1/ubuntu2204/Dockerfile rename to docker-images/6.1/scratch320/Dockerfile index a65985730..21b8748ce 100644 --- a/docker-images/6.1/ubuntu2204/Dockerfile +++ b/docker-images/6.1/scratch320/Dockerfile @@ -1,104 +1,104 @@ # ffmpeg - http://ffmpeg.org/download.html # -# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu -# # https://hub.docker.com/r/jrottenberg/ffmpeg/ # # -FROM ubuntu:20.04 AS base - -WORKDIR /tmp/workdir -RUN apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ - apt-get autoremove -y && \ - apt-get clean -y +FROM alpine:3.20 as build -FROM base as build +WORKDIR /tmp/workdir ENV FFMPEG_VERSION=6.1.2 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ + LIBVMAF_VERSION=2.3.1 \ + OPENCOREAMR_VERSION=0.1.6 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + OGG_VERSION=1.3.5 \ + OPUS_VERSION=1.3 \ + VORBIS_VERSION=1.3.7 \ 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 \ + WEBP_VERSION=1.4.0 \ + LAME_VERSION=3.100 \ + XVID_VERSION=1.3.7 \ + FDKAAC_VERSION=2.0.3 \ + OPENJPEG_VERSION=2.5.2 \ + FREETYPE_VERSION=2.13.3 \ + LIBVIDSTAB_VERSION=1.1.1 \ + FRIBIDI_VERSION=1.0.16 \ + FONTCONFIG_VERSION=2.15.0 \ + LIBASS_VERSION=0.17.3 \ + KVAZAAR_VERSION=2.3.1 \ + AOM_VERSION=v3.10.0 \ + XORG_MACROS_VERSION=1.20.1 \ XPROTO_VERSION=7.0.31 \ - XVID_VERSION=1.3.4 \ - LIBXML2_VERSION=2.9.12 \ - LIBBLURAY_VERSION=1.1.2 \ - LIBZMQ_VERSION=4.3.2 \ - LIBSRT_VERSION=1.4.1 \ + XAU_VERSION=1.0.11 \ + LIBPTHREAD_STUBS_VERSION=0.5 \ + LIBXML2_VERSION=2.13.4 \ + LIBBLURAY_VERSION=1.3.4 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBPNG_VERSION=1.6.44 \ LIBARIBB24_VERSION=1.0.3 \ - LIBPNG_VERSION=1.6.9 \ - LIBVMAF_VERSION=2.1.1 \ ZIMG_VERSION=3.0.5 \ 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" +# + # CHROMAPRINT_VERSION=1.5.0 \ + # LIBXCB_VERSION=1.13.1 \ + # XCBPROTO_VERSION=1.13 \ + # PYTHON=python3 \ + +ARG OGG_SHA256SUM="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.5.tar.gz" +ARG OPUS_SHA256SUM="4f3d69aefdf2dbaf9825408e452a8a414ffc60494c70633560700398820dc550 opus-1.3.tar.gz" +ARG VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.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 LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" -ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG FREETYPE_SHA256SUM="5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 freetype-2.13.3.tar.gz" +# ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 1.0.16.tar.gz" +# ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +# ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBBLURAY_SHA512SUM="94dbf3b68d1c23fe4648c153cc2f0c251886fac0a6b6bbe3a77caabaa5322682f712afe4a7b6b16ca3f06744fbc0e1ca872209a32898dcf0ae182055d335aec1 libbluray-1.3.4.tar.bz2" +ARG LIBZMQ_SHA256SUM="ae933b1e98411fd7cb8309f9502d2737 zeromq-4.3.5.tar.gz" ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + 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" -ARG DEBIAN_FRONTEND=noninteractive - -RUN buildDeps="autoconf \ - automake \ - cmake \ - curl \ - bzip2 \ - libexpat1-dev \ - g++ \ - gcc \ - git \ - gperf \ - libtool \ - make \ - meson \ - nasm \ - perl \ - pkg-config \ - python \ - libssl-dev \ - yasm \ - zlib1g-dev" && \ - apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ${buildDeps} +RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git libgomp + +RUN buildDeps="autoconf \ + automake \ + bash \ + binutils \ + bzip2 \ + cmake \ + coreutils \ + curl \ + diffutils \ + expat-dev \ + file \ + g++ \ + gcc \ + gperf \ + libtool \ + make \ + nasm \ + openssl-dev \ + python3 \ + tar \ + xcb-proto \ + yasm \ + zlib-dev \ + alpine-sdk \ + linux-headers" && \ + apk add --no-cache --update ${buildDeps} + +#RUN apk add --no-cache --update meson samuri + ## libvmaf https://github.com/Netflix/vmaf RUN \ if which meson || false; then \ @@ -146,9 +146,9 @@ RUN \ DIR=/tmp/x265 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265-${X265_VERSION}/build/linux && \ + 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 && \ @@ -192,6 +192,7 @@ RUN \ make install && \ rm -rf ${DIR} ### libtheora http://www.theora.org/ +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure RUN \ DIR=/tmp/theora && \ mkdir -p ${DIR} && \ @@ -199,7 +200,7 @@ RUN \ 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 && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --build="aarch64-unknown-linux-gnu" --enable-shared && \ make && \ make install && \ rm -rf ${DIR} @@ -217,7 +218,7 @@ RUN \ rm -rf ${DIR} ### libwebp https://developers.google.com/speed/webp/ RUN \ - DIR=/tmp/vebp && \ + DIR=/tmp/webp && \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ @@ -242,8 +243,7 @@ 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 && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ cd xvidcore/build/generic && \ ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ @@ -267,9 +267,10 @@ RUN \ DIR=/tmp/openjpeg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ make install && \ rm -rf ${DIR} @@ -291,7 +292,7 @@ RUN \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ - echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + # echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -302,9 +303,9 @@ 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 && \ + curl -sLO https://github.com/fribidi/fribidi/archive/refs/tags/v${FRIBIDI_VERSION}.tar.gz && \ + # echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f fribidi-${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 && \ @@ -316,19 +317,19 @@ 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 && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz && \ + tar -zx --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 +## libass v 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 && \ + # echo ${LIBASS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -340,7 +341,7 @@ RUN \ DIR=/tmp/kvazaar && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v2.3.1/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -361,12 +362,13 @@ RUN \ rm -rf ${DIR} ## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## util-macros 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 && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.xz && \ + tar -Jx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ make && \ make install && \ @@ -394,6 +396,7 @@ RUN \ make install && \ rm -rf ${DIR} +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? RUN \ DIR=/tmp/libpthread-stubs && \ mkdir -p ${DIR} && \ @@ -424,21 +427,22 @@ RUN \ 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 && \ + echo ${LIBBLURAY_SHA512SUM} | sha512sum --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} +# Update Use the zeromq zeromq-dev packages from the alpine repository ## 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 && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha512sum --check && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" && \ make && \ @@ -451,7 +455,7 @@ RUN \ DIR=/tmp/srt && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/v${LIBSRT_VERSION}.tar.gz && \ tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -509,7 +513,7 @@ RUN \ -## Build ffmpeg https://ffmpeg.org/ +# ## Build ffmpeg https://ffmpeg.org/ RUN \ DIR=/tmp/ffmpeg && cd ${DIR} && \ ./configure \ @@ -522,7 +526,8 @@ RUN \ --enable-libaribb24 \ --enable-libass \ --enable-libbluray \ - --enable-libfdk_aac \ + --enable-libdav1d \ + --enable-libfdk-aac \ --enable-libfreetype \ --enable-libkvazaar \ --enable-libmp3lame \ @@ -531,6 +536,7 @@ RUN \ --enable-libopenjpeg \ --enable-libopus \ --enable-libsrt \ + --enable-libsvtav1 \ --enable-libtheora \ --enable-libvidstab \ --enable-libvmaf \ @@ -551,7 +557,9 @@ RUN \ --extra-cflags="-I${PREFIX}/include" \ --extra-ldflags="-L${PREFIX}/lib" \ --extra-libs=-ldl \ + --extra-libs=-lm \ --extra-libs=-lpthread \ + --ld=g++ \ --prefix="${PREFIX}" && \ make clean && \ make && \ @@ -562,29 +570,23 @@ RUN \ cd tools && \ make qt-faststart && cp qt-faststart ${PREFIX}/bin/ -## cleanup + RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ - cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ - mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ - done - -FROM base AS release + mkdir -p /tmp/fakeroot/lib && \ + ldd ${PREFIX}/bin/ffmpeg | cut -d ' ' -f 3 | strings | xargs -I R cp R /tmp/fakeroot/lib/ && \ + for lib in /tmp/fakeroot/lib/*; do strip --strip-all $lib; done && \ + cp -r ${PREFIX}/bin /tmp/fakeroot/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /tmp/fakeroot/share/ && \ + LD_LIBRARY_PATH=/tmp/fakeroot/lib /tmp/fakeroot/bin/ffmpeg -buildconf + +### Release Stage +FROM scratch as release LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 CMD ["--help"] -ENTRYPOINT ["ffmpeg"] - -COPY --from=build /usr/local /usr/local/ +ENTRYPOINT ["/bin/ffmpeg"] -# Let's make sure the app built correctly -# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output +COPY --from=build /tmp/fakeroot/ / diff --git a/docker-images/6.1/vaapi2204/Dockerfile b/docker-images/6.1/ubuntu2404-edge/Dockerfile similarity index 63% rename from docker-images/6.1/vaapi2204/Dockerfile rename to docker-images/6.1/ubuntu2404-edge/Dockerfile index 6f71ccc5b..1bd093fc0 100644 --- a/docker-images/6.1/vaapi2204/Dockerfile +++ b/docker-images/6.1/ubuntu2404-edge/Dockerfile @@ -5,21 +5,17 @@ # https://hub.docker.com/r/jrottenberg/ffmpeg/ # # -FROM ubuntu:22.04 AS base +# Stage 1: Build +FROM ubuntu:24.04 AS builder -WORKDIR /tmp/workdir - -RUN apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ - apt-get autoremove -y && \ - apt-get clean -y -FROM base as build +WORKDIR /tmp/workdir ENV FFMPEG_VERSION=6.1.2 \ - AOM_VERSION=v3.8.1 \ + AOM_VERSION=v3.10.0 \ + SVTAV1_VERSION=2.2.1 \ CHROMAPRINT_VERSION=1.5.0 \ - FDKAAC_VERSION=0.1.5 \ + FDKAAC_VERSION=2.0.3 \ FONTCONFIG_VERSION=2.12.4 \ FREETYPE_VERSION=2.10.4 \ FRIBIDI_VERSION=0.19.7 \ @@ -30,28 +26,28 @@ ENV FFMPEG_VERSION=6.1.2 \ 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 \ + OGG_VERSION=1.3.5 \ + OPENCOREAMR_VERSION=0.1.6 \ + OPUS_VERSION=1.5.2 \ + OPENJPEG_VERSION=2.5.2 \ PYTHON=python3 \ 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 \ + VORBIS_VERSION=1.3.7 \ + VPX_VERSION=1.14.1 \ + WEBP_VERSION=1.4.0 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ XAU_VERSION=1.0.9 \ XORG_MACROS_VERSION=1.19.2 \ XPROTO_VERSION=7.0.31 \ - XVID_VERSION=1.3.4 \ + XVID_VERSION=1.3.7 \ LIBXML2_VERSION=2.9.12 \ LIBBLURAY_VERSION=1.1.2 \ - LIBZMQ_VERSION=4.3.2 \ - LIBSRT_VERSION=1.4.1 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ LIBARIBB24_VERSION=1.0.3 \ LIBPNG_VERSION=1.6.9 \ - LIBVMAF_VERSION=2.1.1 \ + LIBVMAF_VERSION=3.0.0 \ ZIMG_VERSION=3.0.5 \ SRC=/usr/local @@ -59,68 +55,66 @@ ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01 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 OGG_SHA256SUM="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.4.tar.gz" +ARG OPUS_SHA256SUM="65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1 opus-1.5.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 VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.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 MAKEFLAGS="-j2" -ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ARG PREFIX="/opt/ffmpeg" ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y + +# FROM base AS build + + RUN buildDeps="autoconf \ automake \ cmake \ + build-essential \ + texinfo \ curl \ + wget \ bzip2 \ libexpat1-dev \ - g++ \ gcc \ git \ + git-core \ gperf \ libtool \ make \ meson \ + ninja-build \ nasm \ perl \ pkg-config \ - libssl-dev \ + python3 \ yasm \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ libva-dev \ - zlib1g-dev" && \ + libvdpau-dev \ + libnuma-dev" && \ apt-get -yqq update && \ apt-get install -yq --no-install-recommends ${buildDeps} -## 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/ +# opencore-amr: from source RUN \ + echo "Building opencore-amr-${OPENCOREAMR_VERSION}" && \ DIR=/tmp/opencore-amr && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -130,8 +124,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -## x264 http://www.videolan.org/developers/x264.html + +# ## x264 http://www.videolan.org/developers/x264.html RUN \ + echo "Building x264-snapshot-${X264_VERSION}" && \ DIR=/tmp/x264 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -141,46 +137,56 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -### x265 http://x265.org/ + +# ### x265 http://x265.org/ ( videolan ) RUN \ + echo "Building x265_${X265_VERSION}" && \ DIR=/tmp/x265 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265-${X265_VERSION}/build/linux && \ + 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/ + +### libogg https://www.xiph.org/ogg/ ( xiph ) RUN \ + echo "Building libogg-${OGG_VERSION}" && \ 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 && \ + curl -sLO https://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/ + +### libopus https://www.opus-codec.org/ ( xiph ) +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +# apt libopus-dev RUN \ + echo "Building opus-${OPUS_VERSION}" && \ 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 && \ + curl -sL https://github.com/xiph/opus/releases/download/v${OPUS_VERSION}/opus-${OPUS_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + # echo ${OPUS_SHA256SUM} | sha256sum --check && \ ./configure --prefix="${PREFIX}" --enable-shared && \ + # ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \ make && \ make install && \ rm -rf ${DIR} -### libvorbis https://xiph.org/vorbis/ + +### libvorbis https://xiph.org/vorbis/ ( xiph ) RUN \ + echo "Building libvorbis-${VORBIS_VERSION}" && \ DIR=/tmp/vorbis && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -191,33 +197,28 @@ RUN \ 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/ +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +### configure w/ --as=yasm ?? +### double check that this came from the correct place. RUN \ + echo "Building libvpx-${VPX_VERSION}" && \ 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 && \ + curl -sL https://chromium.googlesource.com/webm/libvpx.git/+archive/v${VPX_VERSION}.tar.gz | \ + tar -zxm && \ ./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 && \ + echo "Building libwebp-${WEBP_VERSION}" && \ + DIR=/tmp/webp && \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ @@ -226,8 +227,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ### libmp3lame http://lame.sourceforge.net/ RUN \ + echo "Building lame-${LAME_VERSION}" && \ DIR=/tmp/lame && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -237,44 +240,55 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -### xvid https://www.xvid.com/ + +### xvid (xvidcore) https://www.xvid.com/ RUN \ + echo "Building xvidcore-${XVID_VERSION}" && \ 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 && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ 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 +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +# might not need --datadir anymore RUN \ + echo "Building fdk-aac-${FDKAAC_VERSION}" && \ DIR=/tmp/fdk-aac && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/refs/tags/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 \ + echo "Building openjpeg-${OPENJPEG_VERSION}" && \ DIR=/tmp/openjpeg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ make install && \ rm -rf ${DIR} + ## freetype https://www.freetype.org/ +# make sure to pass in --no-install-recommends for this one its globbie RUN \ + echo "Building freetype-${FREETYPE_VERSION}" && \ DIR=/tmp/freetype && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -285,8 +299,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -## libvstab https://github.com/georgmartius/vid.stab + +## libvidstab https://github.com/georgmartius/vid.stab RUN \ + echo "Building libvidstab-${LIBVIDSTAB_VERSION}" && \ DIR=/tmp/vid.stab && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -297,8 +313,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## fridibi https://www.fribidi.org/ RUN \ + echo "Building fribidi-${FRIBIDI_VERSION}" && \ DIR=/tmp/fribidi && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -311,8 +329,10 @@ RUN \ make -j1 && \ make install && \ rm -rf ${DIR} + ## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ RUN \ + echo "Building fontconfig-${FONTCONFIG_VERSION}" && \ DIR=/tmp/fontconfig && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -322,8 +342,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## libass https://github.com/libass/libass RUN \ + echo "Building libass-${LIBASS_VERSION}" && \ DIR=/tmp/libass && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -335,8 +357,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## kvazaar https://github.com/ultravideo/kvazaar RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ DIR=/tmp/kvazaar && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -347,43 +371,77 @@ RUN \ make && \ make install && \ rm -rf ${DIR} - +# lib aom +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom RUN \ + echo "Building aom-${AOM_VERSION}" && \ 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 ..; \ + # cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libsvtav1 https://gitlab.com/AOMediaCodec/SVT-AV1.git +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +# RUN \ +# echo "Installing dependencies libpng" && \ +# apt-get install -yq libsvtav1enc-dev + +RUN \ + echo "Building SVT-AV1 v${SVTAV1_VERSION}" && \ + DIR=/tmp/libsvtav1 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${SVTAV1_VERSION}/SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + cd Build && \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=Release -DBUILD_DEC=OFF -DBUILD_SHARED_LIBS=OFF ..; \ make ; \ make install ; \ rm -rf ${DIR} -## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## libdav1d https://code.videolan.org/videolan/dav1d +## https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## installed w/ apt-get in the build stage RUN \ + echo "installing libdav1d-dev with debian packages" && \ + apt-get install -yq libdav1d-dev + +## x.org: util-macros (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + echo "Building x.org: util-macros-${XORG_MACROS_VERSION}" && \ 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 && \ + 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} +## x.org: xproto RUN \ + echo "Building x.org: xproto-${XPROTO_VERSION}" && \ 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 && \ + cp /usr/share/misc/config.guess . && \ ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ make && \ make install && \ rm -rf ${DIR} +## libXau RUN \ + echo "Building x.org: libXau-${XAU_VERSION}" && \ DIR=/tmp/libXau && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -394,7 +452,9 @@ RUN \ make install && \ rm -rf ${DIR} +## libpthread-stubs RUN \ + echo "Building libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}" && \ DIR=/tmp/libpthread-stubs && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -408,6 +468,7 @@ RUN \ ## libxml2 - for libbluray RUN \ + echo "Building libxml2-${LIBXML2_VERSION}" && \ DIR=/tmp/libxml2 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -420,6 +481,7 @@ RUN \ ## libbluray - Requires libxml, freetype, and fontconfig RUN \ + echo "Building libbluray-${LIBBLURAY_VERSION}" && \ DIR=/tmp/libbluray && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -432,13 +494,14 @@ RUN \ rm -rf ${DIR} ## libzmq https://github.com/zeromq/libzmq/ +# this one pulls in a bunch of dependencies RUN \ + echo "Building libzmq-${LIBZMQ_VERSION}" && \ 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 && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" && \ make && \ @@ -446,20 +509,11 @@ RUN \ 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 +# also pulls in a bunch of stuff RUN \ + echo "Building libpng-${LIBPNG_VERSION}" && \ DIR=/tmp/png && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -472,6 +526,7 @@ RUN \ ## libaribb24 RUN \ + echo "Building libaribb24-${LIBARIBB24_VERSION}" && \ DIR=/tmp/b24 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -486,6 +541,7 @@ RUN \ # zimg https://github.com/sekrit-twc/zimg RUN \ + echo "Building zimg-${ZIMG_VERSION}" && \ DIR=/tmp/zimg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -497,21 +553,98 @@ RUN \ make install && \ rm -rf ${DIR} +### libtheora http://www.theora.org/ ( xiph ) +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +RUN \ + echo "Building libtheora-${THEORA_VERSION}" && \ + 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 && \ + # add sym link for sdl-config + # ln -s /usr/bin/sdl2-config /usr/bin/sdl-config && \ + # currently build does not find sdl-config, and thus no playback support is enabled (probably exacly, the way it was before) + # Note: consider installing doxygen so that the api documentation is built + # right now, I did not, so we can keep everything small. + # disable examples to advoid the libjpeg sizeof error still in the example code. + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +# RUN \ +# echo "installing libsrt-dev with debian package: Secure Reliable Transport UDP streaming library (OpenSSL flavour)" && \ +# apt-get install -yq libsrt1.5-openssl +# libsrt-openssl-dev +RUN \ + echo "Adding libssl-dev for libsrt build" && \ + apt-get install -yq --no-install-recommends libssl-dev + # Note: we can get the config error + # GnuTLS('libgnutls28-dev') and OpenSSL('libssl-dev') must not be enabled at the same time, + # from a previous build + # so we add libssl-dev and later in the build + + ## libsrt https://github.com/Haivision/srt +RUN \ + echo "Building libsrt-${LIBSRT_VERSION}" && \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/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} + + + +## libvmaf https://github.com/Netflix/vmaf +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + + ## Download ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (intial) ffmpeg-${FFMPEG_VERSION}" && \ 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 && \ - ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ - make ; make install - - + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install ## Build ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (final) ffmpeg-${FFMPEG_VERSION}" && \ DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ ./configure \ --disable-debug \ --disable-doc \ @@ -547,14 +680,12 @@ RUN \ --enable-postproc \ --enable-shared \ --enable-small \ - --enable-vaapi \ --enable-version3 \ - --extra-cflags="-I${PREFIX}/include" \ - --extra-ldflags="-L${PREFIX}/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu" \ --extra-libs=-ldl \ --extra-libs=-lpthread \ --prefix="${PREFIX}" && \ - make clean && \ make && \ make install && \ make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ @@ -563,20 +694,33 @@ RUN \ cd tools && \ make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + + ## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ cp ${PREFIX}/bin/* /usr/local/bin/ && \ cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ mkdir -p /usr/local/lib/pkgconfig && \ - for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ done -FROM base AS release +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg @@ -585,12 +729,3 @@ ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 CMD ["--help"] ENTRYPOINT ["ffmpeg"] -COPY --from=build /usr/local /usr/local/ - -RUN \ - apt-get update -y && \ - apt-get install -y --no-install-recommends libva-drm2 libva2 i965-va-driver && \ - rm -rf /var/lib/apt/lists/* - -# 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/6.1/ubuntu2404/Dockerfile b/docker-images/6.1/ubuntu2404/Dockerfile new file mode 100644 index 000000000..d3abc6280 --- /dev/null +++ b/docker-images/6.1/ubuntu2404/Dockerfile @@ -0,0 +1,329 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +# Stage 1: Build +FROM ubuntu:24.04 AS builder + + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=6.1.2 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y + +# FROM base AS build + + + +RUN buildDeps="autoconf \ + automake \ + cmake \ + build-essential \ + texinfo \ + curl \ + wget \ + bzip2 \ + libexpat1-dev \ + gcc \ + git \ + git-core \ + gperf \ + libtool \ + make \ + meson \ + ninja-build \ + nasm \ + perl \ + pkg-config \ + python3 \ + yasm \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ + libva-dev \ + libvdpau-dev \ + libnuma-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} + +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libsvtav1 \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu" \ + --extra-libs=-ldl \ + --extra-libs=-lm \ + --extra-libs=-lpthread \ + --ld=g++ \ + --prefix="${PREFIX}" && \ + 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/ + + + + +## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) +RUN \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ + done + +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + diff --git a/docker-images/6.1/vaapi2404/Dockerfile b/docker-images/6.1/vaapi2404/Dockerfile new file mode 100644 index 000000000..aecdf00bd --- /dev/null +++ b/docker-images/6.1/vaapi2404/Dockerfile @@ -0,0 +1,309 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM ubuntu:24.04 as base + +WORKDIR /tmp/workdir + +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 && \ + apt-get autoremove -y && \ + apt-get clean -y + +FROM base as build + +ENV FFMPEG_VERSION=6.1.2 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive + +RUN buildDeps="autoconf \ + automake \ + cmake \ + curl \ + bzip2 \ + libexpat1-dev \ + g++ \ + gcc \ + git \ + gperf \ + libtool \ + make \ + meson \ + nasm \ + perl \ + pkg-config \ + libssl-dev \ + yasm \ + libva-dev \ + zlib1g-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-vaapi \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lpthread \ + --prefix="${PREFIX}" && \ + 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/ + + +## cleanup +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ + for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +FROM base AS release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local/ + +RUN \ + apt-get update -y && \ + apt-get install -y --no-install-recommends libva-drm2 libva2 i965-va-driver && \ + rm -rf /var/lib/apt/lists/* + +# 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/7.0/alpine320/Dockerfile b/docker-images/7.0/alpine320/Dockerfile new file mode 100644 index 000000000..248084a9f --- /dev/null +++ b/docker-images/7.0/alpine320/Dockerfile @@ -0,0 +1,369 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# + +FROM alpine:3.20 as base + +RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git + +FROM base as build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=7.0.2 \ + AOM_VERSION=v3.8.1 \ + CHROMAPRINT_VERSION=1.5.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.6 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.5.2 \ + PYTHON=python3 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.7 \ + LIBXML2_VERSION=2.9.12 \ + LIBBLURAY_VERSION=1.1.2 \ + # LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.3.1 \ + ZIMG_VERSION=3.0.5 \ + 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 LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + + +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 libDeps="libgomp \ + # https://github.com/zeromq/libzmq/ + zeromq \ + zeromq-dev \ + # https://sourceforge.net/projects/opencore-amr/ + opencore-amr \ + opencore-amr-dev \ + # https://www.xiph.org/ogg/ + libogg \ + libogg-static \ + libogg-dev \ + # libtheora http://www.theora.org/ + libtheora \ + libtheora-static \ + libtheora-dev \ + # http://www.videolan.org/developers/x264.html + x264 \ + x264-libs \ + x264-dev \ + # http://x265.org/ + x265 \ + x265-libs \ + x265-dev \ + # https://www.opus-codec.org/ + opus \ + opus-tools \ + opus-dev \ + # https://xiph.org/vorbis/ + libvorbis \ + libvorbis-static \ + libvorbis-dev \ + # https://www.webmproject.org/code/ + libvpx \ + libvpx-utils \ + libvpx-dev \ + # https://developers.google.com/speed/webp/ + libwebp \ + libwebp-dev \ + libwebp-static \ + libwebp-tools \ + # http://lame.sourceforge.net/ + lame \ + lame-libs \ + lame-dev \ + # https://www.xvid.com/ + xvidcore \ + xvidcore-static \ + xvidcore-dev \ + # https://github.com/mstorsjo/fdk-aac + fdk-aac \ + fdk-aac-dev \ + # https://github.com/uclouvain/openjpeg + openjpeg \ + openjpeg-tools \ + openjpeg-dev \ + # https://www.freetype.org/ + freetype \ + freetype-static \ + freetype-dev \ + # https://github.com/georgmartius/vid.stab + vidstab \ + vidstab-dev \ + ## https://www.fribidi.org/ + fribidi \ + fribidi-static \ + fribidi-dev \ + # fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ + fontconfig \ + fontconfig-static \ + fontconfig-dev \ + # https://github.com/libass/libass + libass \ + libass-dev \ + # https://aomedia.googlesource.com/aom + aom \ + aom-libs \ + aom-dev \ + # https://xcb.freedesktop.org/ + # https://www.x.org/archive//individual/util/util-macros- + util-macros \ + # https://www.x.org/archive/individual/proto/xproto- + xorgproto \ + # https://www.x.org/archive/individual/lib/libXau- + libxau \ + libxau-dev \ + # https://github.com/GNOME/libxml2/ + libxml2 \ + libxml2-static \ + libxml2-utils \ + libxml2-dev \ + # https://github.com/Haivision/srt + libsrt \ + libsrt-progs \ + libsrt-dev \ + # https://git.code.sf.net/p/libpng/code + libpng \ + libpng-static \ + libpng-utils \ + libpng-dev \ + # https://github.com/sekrit-twc/zimg + zimg \ + zimg-dev" && \ + apk add --no-cache --update ${libDeps} + + +RUN buildDeps="autoconf \ + automake \ + bash \ + binutils \ + bzip2 \ + cmake \ + coreutils \ + curl \ + diffutils \ + expat-dev \ + file \ + g++ \ + gcc \ + gperf \ + libtool \ + make \ + nasm \ + openssl-dev \ + python3 \ + tar \ + xcb-proto \ + yasm \ + zlib-dev \ + alpine-sdk \ + linux-headers" && \ + apk add --no-cache --update ${buildDeps} +## 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 + +## 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} + +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? +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} + + +## 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} + +## 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} + +## Download 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 && \ + ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ + make ; make install + + + + + +# ## Build ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libsvtav1 \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lm \ + --extra-libs=-lpthread \ + --ld=g++ \ + --prefix="${PREFIX}" && \ + make clean && \ + 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/lib/ && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + mkdir -p /usr/local/include && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +### Release Stage +FROM base as release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local diff --git a/docker-images/7.0/nvidia2204/Dockerfile b/docker-images/7.0/nvidia2204/Dockerfile index be7029051..4ef0c7560 100644 --- a/docker-images/7.0/nvidia2204/Dockerfile +++ b/docker-images/7.0/nvidia2204/Dockerfile @@ -33,62 +33,101 @@ FROM devel-base as build ENV NVIDIA_HEADERS_VERSION=11.1.5.3 ENV FFMPEG_VERSION=7.0.2 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ - 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.12 \ - 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 \ - ZIMG_VERSION=3.0.5 \ - 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 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 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" + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" RUN buildDeps="autoconf \ @@ -122,420 +161,94 @@ RUN \ make install PREFIX="${PREFIX}" && \ rm -rf ${DIR} -## 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 + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev -## opencore-amr https://sourceforge.net/projects/opencore-amr/ -RUN \ - DIR=/tmp/opencore-amr && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ - 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://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ - 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 \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ 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 && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ make && \ make install && \ rm -rf ${DIR} +## libvmaf https://github.com/Netflix/vmaf 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} - - -## libxml2 - for libbluray -RUN \ - DIR=/tmp/libxml2 && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ - tar -xz --strip-components=1 && \ - ./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} + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ -## libaribb24 +# https://github.com/Netflix/vmaf/issues/788 RUN \ - DIR=/tmp/b24 && \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ 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} + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 -# zimg https://github.com/sekrit-twc/zimg -RUN \ - DIR=/tmp/zimg && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/sekrit-twc/zimg/archive/refs/tags/release-${ZIMG_VERSION}.tar.gz | \ - tar -zx --strip-components=1 && \ - ./autogen.sh && \ - ./configure --prefix="${PREFIX}" --enable-shared && \ - make && \ - make install && \ - rm -rf ${DIR} +#### Do we really need to build ffmpeg twice? seems silly ## Download ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ 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 && \ - ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ - make ; make install - - - - - -## Build ffmpeg https://ffmpeg.org/ + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ DIR=/tmp/ffmpeg && cd ${DIR} && \ - ./configure \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ --disable-debug \ --disable-doc \ --disable-ffplay \ @@ -579,7 +292,6 @@ RUN \ --extra-libs=-ldl \ --extra-libs=-lpthread \ --prefix="${PREFIX}" && \ - make clean && \ make && \ make install && \ make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ @@ -588,6 +300,7 @@ RUN \ cd tools && \ make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + ## cleanup RUN \ LD_LIBRARY_PATH="${PREFIX}/lib:${PREFIX}/lib64:${LD_LIBRARY_PATH}" ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ diff --git a/docker-images/7.0/scratch313/Dockerfile b/docker-images/7.0/scratch320/Dockerfile similarity index 80% rename from docker-images/7.0/scratch313/Dockerfile rename to docker-images/7.0/scratch320/Dockerfile index bf616ec8b..f3c199e5e 100644 --- a/docker-images/7.0/scratch313/Dockerfile +++ b/docker-images/7.0/scratch320/Dockerfile @@ -4,75 +4,77 @@ # # -FROM alpine:3.13 AS build +FROM alpine:3.20 as build WORKDIR /tmp/workdir ENV FFMPEG_VERSION=7.0.2 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ + LIBVMAF_VERSION=2.3.1 \ + OPENCOREAMR_VERSION=0.1.6 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + OGG_VERSION=1.3.5 \ + OPUS_VERSION=1.3 \ + VORBIS_VERSION=1.3.7 \ 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 \ + WEBP_VERSION=1.4.0 \ + LAME_VERSION=3.100 \ + XVID_VERSION=1.3.7 \ + FDKAAC_VERSION=2.0.3 \ + OPENJPEG_VERSION=2.5.2 \ + FREETYPE_VERSION=2.13.3 \ + LIBVIDSTAB_VERSION=1.1.1 \ + FRIBIDI_VERSION=1.0.16 \ + FONTCONFIG_VERSION=2.15.0 \ + LIBASS_VERSION=0.17.3 \ + KVAZAAR_VERSION=2.3.1 \ + AOM_VERSION=v3.10.0 \ + XORG_MACROS_VERSION=1.20.1 \ XPROTO_VERSION=7.0.31 \ - XVID_VERSION=1.3.4 \ - LIBXML2_VERSION=2.9.12 \ - LIBBLURAY_VERSION=1.1.2 \ - LIBZMQ_VERSION=4.3.2 \ - LIBSRT_VERSION=1.4.1 \ + XAU_VERSION=1.0.11 \ + LIBPTHREAD_STUBS_VERSION=0.5 \ + LIBXML2_VERSION=2.13.4 \ + LIBBLURAY_VERSION=1.3.4 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBPNG_VERSION=1.6.44 \ LIBARIBB24_VERSION=1.0.3 \ - LIBPNG_VERSION=1.6.9 \ - LIBVMAF_VERSION=2.1.1 \ ZIMG_VERSION=3.0.5 \ 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" +# + # CHROMAPRINT_VERSION=1.5.0 \ + # LIBXCB_VERSION=1.13.1 \ + # XCBPROTO_VERSION=1.13 \ + # PYTHON=python3 \ + +ARG OGG_SHA256SUM="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.5.tar.gz" +ARG OPUS_SHA256SUM="4f3d69aefdf2dbaf9825408e452a8a414ffc60494c70633560700398820dc550 opus-1.3.tar.gz" +ARG VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.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 LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" -ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG FREETYPE_SHA256SUM="5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 freetype-2.13.3.tar.gz" +# ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 1.0.16.tar.gz" +# ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +# ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBBLURAY_SHA512SUM="94dbf3b68d1c23fe4648c153cc2f0c251886fac0a6b6bbe3a77caabaa5322682f712afe4a7b6b16ca3f06744fbc0e1ca872209a32898dcf0ae182055d335aec1 libbluray-1.3.4.tar.bz2" +ARG LIBZMQ_SHA256SUM="ae933b1e98411fd7cb8309f9502d2737 zeromq-4.3.5.tar.gz" ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + 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 apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git libgomp + RUN buildDeps="autoconf \ automake \ bash \ binutils \ bzip2 \ - ca-certificates \ cmake \ coreutils \ curl \ @@ -81,12 +83,7 @@ RUN buildDeps="autoconf \ file \ g++ \ gcc \ - git \ gperf \ - libcrypto1.1 \ - libgcc \ - libssl1.1 \ - libstdc++ \ libtool \ make \ nasm \ @@ -95,8 +92,12 @@ RUN buildDeps="autoconf \ tar \ xcb-proto \ yasm \ - zlib-dev" && \ - apk add --update ${buildDeps} + zlib-dev \ + alpine-sdk \ + linux-headers" && \ + apk add --no-cache --update ${buildDeps} + +#RUN apk add --no-cache --update meson samuri ## libvmaf https://github.com/Netflix/vmaf RUN \ @@ -145,9 +146,9 @@ RUN \ DIR=/tmp/x265 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265-${X265_VERSION}/build/linux && \ + 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 && \ @@ -191,6 +192,7 @@ RUN \ make install && \ rm -rf ${DIR} ### libtheora http://www.theora.org/ +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure RUN \ DIR=/tmp/theora && \ mkdir -p ${DIR} && \ @@ -198,7 +200,7 @@ RUN \ 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 && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --build="aarch64-unknown-linux-gnu" --enable-shared && \ make && \ make install && \ rm -rf ${DIR} @@ -216,7 +218,7 @@ RUN \ rm -rf ${DIR} ### libwebp https://developers.google.com/speed/webp/ RUN \ - DIR=/tmp/vebp && \ + DIR=/tmp/webp && \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ @@ -241,8 +243,7 @@ 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 && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ cd xvidcore/build/generic && \ ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ @@ -266,9 +267,10 @@ RUN \ DIR=/tmp/openjpeg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ make install && \ rm -rf ${DIR} @@ -290,7 +292,7 @@ RUN \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ - echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + # echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -301,9 +303,9 @@ 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 && \ + curl -sLO https://github.com/fribidi/fribidi/archive/refs/tags/v${FRIBIDI_VERSION}.tar.gz && \ + # echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f fribidi-${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 && \ @@ -315,19 +317,19 @@ 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 && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz && \ + tar -zx --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 +## libass v 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 && \ + # echo ${LIBASS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -339,7 +341,7 @@ RUN \ DIR=/tmp/kvazaar && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v2.3.1/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -360,12 +362,13 @@ RUN \ rm -rf ${DIR} ## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## util-macros 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 && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.xz && \ + tar -Jx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ make && \ make install && \ @@ -393,6 +396,7 @@ RUN \ make install && \ rm -rf ${DIR} +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? RUN \ DIR=/tmp/libpthread-stubs && \ mkdir -p ${DIR} && \ @@ -423,21 +427,22 @@ RUN \ 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 && \ + echo ${LIBBLURAY_SHA512SUM} | sha512sum --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} +# Update Use the zeromq zeromq-dev packages from the alpine repository ## 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 && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha512sum --check && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" && \ make && \ @@ -450,7 +455,7 @@ RUN \ DIR=/tmp/srt && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/v${LIBSRT_VERSION}.tar.gz && \ tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -508,7 +513,7 @@ RUN \ -## Build ffmpeg https://ffmpeg.org/ +# ## Build ffmpeg https://ffmpeg.org/ RUN \ DIR=/tmp/ffmpeg && cd ${DIR} && \ ./configure \ @@ -521,7 +526,8 @@ RUN \ --enable-libaribb24 \ --enable-libass \ --enable-libbluray \ - --enable-libfdk_aac \ + --enable-libdav1d \ + --enable-libfdk-aac \ --enable-libfreetype \ --enable-libkvazaar \ --enable-libmp3lame \ @@ -530,8 +536,10 @@ RUN \ --enable-libopenjpeg \ --enable-libopus \ --enable-libsrt \ + --enable-libsvtav1 \ --enable-libtheora \ --enable-libvidstab \ + --enable-libvmaf \ --enable-libvorbis \ --enable-libvpx \ --enable-libwebp \ @@ -549,7 +557,9 @@ RUN \ --extra-cflags="-I${PREFIX}/include" \ --extra-ldflags="-L${PREFIX}/lib" \ --extra-libs=-ldl \ + --extra-libs=-lm \ --extra-libs=-lpthread \ + --ld=g++ \ --prefix="${PREFIX}" && \ make clean && \ make && \ @@ -570,7 +580,7 @@ RUN \ LD_LIBRARY_PATH=/tmp/fakeroot/lib /tmp/fakeroot/bin/ffmpeg -buildconf ### Release Stage -FROM scratch AS release +FROM scratch as release LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg @@ -580,6 +590,3 @@ CMD ["--help"] ENTRYPOINT ["/bin/ffmpeg"] COPY --from=build /tmp/fakeroot/ / - -# 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/7.0/ubuntu2204/Dockerfile b/docker-images/7.0/ubuntu2204/Dockerfile deleted file mode 100644 index 872566dfe..000000000 --- a/docker-images/7.0/ubuntu2204/Dockerfile +++ /dev/null @@ -1,590 +0,0 @@ -# ffmpeg - http://ffmpeg.org/download.html -# -# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu -# -# https://hub.docker.com/r/jrottenberg/ffmpeg/ -# -# -FROM ubuntu:20.04 AS base - -WORKDIR /tmp/workdir - -RUN apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ - apt-get autoremove -y && \ - apt-get clean -y - -FROM base as build - -ENV FFMPEG_VERSION=7.0.2 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ - 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.12 \ - 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 \ - ZIMG_VERSION=3.0.5 \ - 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 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 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" - - -ARG DEBIAN_FRONTEND=noninteractive - -RUN buildDeps="autoconf \ - automake \ - cmake \ - curl \ - bzip2 \ - libexpat1-dev \ - g++ \ - gcc \ - git \ - gperf \ - libtool \ - make \ - meson \ - nasm \ - perl \ - pkg-config \ - python \ - libssl-dev \ - yasm \ - zlib1g-dev" && \ - apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ${buildDeps} -## 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://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ - 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://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ - 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} - - -## libxml2 - for libbluray -RUN \ - DIR=/tmp/libxml2 && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ - tar -xz --strip-components=1 && \ - ./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} - -# zimg https://github.com/sekrit-twc/zimg -RUN \ - DIR=/tmp/zimg && \ - mkdir -p ${DIR} && \ - cd ${DIR} && \ - curl -sL https://github.com/sekrit-twc/zimg/archive/refs/tags/release-${ZIMG_VERSION}.tar.gz | \ - tar -zx --strip-components=1 && \ - ./autogen.sh && \ - ./configure --prefix="${PREFIX}" --enable-shared && \ - make && \ - make install && \ - rm -rf ${DIR} - -## Download 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 && \ - ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ - make ; make install - - - - - -## Build ffmpeg https://ffmpeg.org/ -RUN \ - DIR=/tmp/ffmpeg && cd ${DIR} && \ - ./configure \ - --disable-debug \ - --disable-doc \ - --disable-ffplay \ - --enable-fontconfig \ - --enable-gpl \ - --enable-libaom \ - --enable-libaribb24 \ - --enable-libass \ - --enable-libbluray \ - --enable-libfdk_aac \ - --enable-libfreetype \ - --enable-libkvazaar \ - --enable-libmp3lame \ - --enable-libopencore-amrnb \ - --enable-libopencore-amrwb \ - --enable-libopenjpeg \ - --enable-libopus \ - --enable-libsrt \ - --enable-libtheora \ - --enable-libvidstab \ - --enable-libvmaf \ - --enable-libvorbis \ - --enable-libvpx \ - --enable-libwebp \ - --enable-libx264 \ - --enable-libx265 \ - --enable-libxvid \ - --enable-libzimg \ - --enable-libzmq \ - --enable-nonfree \ - --enable-openssl \ - --enable-postproc \ - --enable-shared \ - --enable-small \ - --enable-version3 \ - --extra-cflags="-I${PREFIX}/include" \ - --extra-ldflags="-L${PREFIX}/lib" \ - --extra-libs=-ldl \ - --extra-libs=-lpthread \ - --prefix="${PREFIX}" && \ - make clean && \ - 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/ - -## cleanup -RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ - cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ - mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ - done - -FROM base AS release -LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ - org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg - -ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 - -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/7.0/vaapi2204/Dockerfile b/docker-images/7.0/ubuntu2404-edge/Dockerfile similarity index 63% rename from docker-images/7.0/vaapi2204/Dockerfile rename to docker-images/7.0/ubuntu2404-edge/Dockerfile index 0c095521e..8a7177b2e 100644 --- a/docker-images/7.0/vaapi2204/Dockerfile +++ b/docker-images/7.0/ubuntu2404-edge/Dockerfile @@ -5,21 +5,17 @@ # https://hub.docker.com/r/jrottenberg/ffmpeg/ # # -FROM ubuntu:22.04 AS base +# Stage 1: Build +FROM ubuntu:24.04 AS builder -WORKDIR /tmp/workdir - -RUN apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ - apt-get autoremove -y && \ - apt-get clean -y -FROM base as build +WORKDIR /tmp/workdir ENV FFMPEG_VERSION=7.0.2 \ - AOM_VERSION=v3.8.1 \ + AOM_VERSION=v3.10.0 \ + SVTAV1_VERSION=2.2.1 \ CHROMAPRINT_VERSION=1.5.0 \ - FDKAAC_VERSION=0.1.5 \ + FDKAAC_VERSION=2.0.3 \ FONTCONFIG_VERSION=2.12.4 \ FREETYPE_VERSION=2.10.4 \ FRIBIDI_VERSION=0.19.7 \ @@ -30,28 +26,28 @@ ENV FFMPEG_VERSION=7.0.2 \ 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 \ + OGG_VERSION=1.3.5 \ + OPENCOREAMR_VERSION=0.1.6 \ + OPUS_VERSION=1.5.2 \ + OPENJPEG_VERSION=2.5.2 \ PYTHON=python3 \ 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 \ + VORBIS_VERSION=1.3.7 \ + VPX_VERSION=1.14.1 \ + WEBP_VERSION=1.4.0 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ XAU_VERSION=1.0.9 \ XORG_MACROS_VERSION=1.19.2 \ XPROTO_VERSION=7.0.31 \ - XVID_VERSION=1.3.4 \ + XVID_VERSION=1.3.7 \ LIBXML2_VERSION=2.9.12 \ LIBBLURAY_VERSION=1.1.2 \ - LIBZMQ_VERSION=4.3.2 \ - LIBSRT_VERSION=1.4.1 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ LIBARIBB24_VERSION=1.0.3 \ LIBPNG_VERSION=1.6.9 \ - LIBVMAF_VERSION=2.1.1 \ + LIBVMAF_VERSION=3.0.0 \ ZIMG_VERSION=3.0.5 \ SRC=/usr/local @@ -59,68 +55,66 @@ ARG FREETYPE_SHA256SUM="5eab795ebb23ac77001cfb68b7d4d50b5d6c7469247b0b01 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 OGG_SHA256SUM="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.4.tar.gz" +ARG OPUS_SHA256SUM="65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1 opus-1.5.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 VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.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 MAKEFLAGS="-j2" -ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ARG PREFIX="/opt/ffmpeg" ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y + +# FROM base AS build + + RUN buildDeps="autoconf \ automake \ cmake \ + build-essential \ + texinfo \ curl \ + wget \ bzip2 \ libexpat1-dev \ - g++ \ gcc \ git \ + git-core \ gperf \ libtool \ make \ meson \ + ninja-build \ nasm \ perl \ pkg-config \ - libssl-dev \ + python3 \ yasm \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ libva-dev \ - zlib1g-dev" && \ + libvdpau-dev \ + libnuma-dev" && \ apt-get -yqq update && \ apt-get install -yq --no-install-recommends ${buildDeps} -## 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/ +# opencore-amr: from source RUN \ + echo "Building opencore-amr-${OPENCOREAMR_VERSION}" && \ DIR=/tmp/opencore-amr && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -130,8 +124,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -## x264 http://www.videolan.org/developers/x264.html + +# ## x264 http://www.videolan.org/developers/x264.html RUN \ + echo "Building x264-snapshot-${X264_VERSION}" && \ DIR=/tmp/x264 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -141,46 +137,56 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -### x265 http://x265.org/ + +# ### x265 http://x265.org/ ( videolan ) RUN \ + echo "Building x265_${X265_VERSION}" && \ DIR=/tmp/x265 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265-${X265_VERSION}/build/linux && \ + 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/ + +### libogg https://www.xiph.org/ogg/ ( xiph ) RUN \ + echo "Building libogg-${OGG_VERSION}" && \ 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 && \ + curl -sLO https://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/ + +### libopus https://www.opus-codec.org/ ( xiph ) +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +# apt libopus-dev RUN \ + echo "Building opus-${OPUS_VERSION}" && \ 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 && \ + curl -sL https://github.com/xiph/opus/releases/download/v${OPUS_VERSION}/opus-${OPUS_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + # echo ${OPUS_SHA256SUM} | sha256sum --check && \ ./configure --prefix="${PREFIX}" --enable-shared && \ + # ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \ make && \ make install && \ rm -rf ${DIR} -### libvorbis https://xiph.org/vorbis/ + +### libvorbis https://xiph.org/vorbis/ ( xiph ) RUN \ + echo "Building libvorbis-${VORBIS_VERSION}" && \ DIR=/tmp/vorbis && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -191,33 +197,28 @@ RUN \ 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/ +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +### configure w/ --as=yasm ?? +### double check that this came from the correct place. RUN \ + echo "Building libvpx-${VPX_VERSION}" && \ 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 && \ + curl -sL https://chromium.googlesource.com/webm/libvpx.git/+archive/v${VPX_VERSION}.tar.gz | \ + tar -zxm && \ ./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 && \ + echo "Building libwebp-${WEBP_VERSION}" && \ + DIR=/tmp/webp && \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ @@ -226,8 +227,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ### libmp3lame http://lame.sourceforge.net/ RUN \ + echo "Building lame-${LAME_VERSION}" && \ DIR=/tmp/lame && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -237,44 +240,55 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -### xvid https://www.xvid.com/ + +### xvid (xvidcore) https://www.xvid.com/ RUN \ + echo "Building xvidcore-${XVID_VERSION}" && \ 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 && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ 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 +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +# might not need --datadir anymore RUN \ + echo "Building fdk-aac-${FDKAAC_VERSION}" && \ DIR=/tmp/fdk-aac && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/mstorsjo/fdk-aac/archive/v${FDKAAC_VERSION}.tar.gz | \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/refs/tags/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 \ + echo "Building openjpeg-${OPENJPEG_VERSION}" && \ DIR=/tmp/openjpeg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ make install && \ rm -rf ${DIR} + ## freetype https://www.freetype.org/ +# make sure to pass in --no-install-recommends for this one its globbie RUN \ + echo "Building freetype-${FREETYPE_VERSION}" && \ DIR=/tmp/freetype && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -285,8 +299,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} -## libvstab https://github.com/georgmartius/vid.stab + +## libvidstab https://github.com/georgmartius/vid.stab RUN \ + echo "Building libvidstab-${LIBVIDSTAB_VERSION}" && \ DIR=/tmp/vid.stab && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -297,8 +313,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## fridibi https://www.fribidi.org/ RUN \ + echo "Building fribidi-${FRIBIDI_VERSION}" && \ DIR=/tmp/fribidi && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -311,8 +329,10 @@ RUN \ make -j1 && \ make install && \ rm -rf ${DIR} + ## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ RUN \ + echo "Building fontconfig-${FONTCONFIG_VERSION}" && \ DIR=/tmp/fontconfig && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -322,8 +342,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## libass https://github.com/libass/libass RUN \ + echo "Building libass-${LIBASS_VERSION}" && \ DIR=/tmp/libass && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -335,8 +357,10 @@ RUN \ make && \ make install && \ rm -rf ${DIR} + ## kvazaar https://github.com/ultravideo/kvazaar RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ DIR=/tmp/kvazaar && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -347,43 +371,77 @@ RUN \ make && \ make install && \ rm -rf ${DIR} - +# lib aom +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom RUN \ + echo "Building aom-${AOM_VERSION}" && \ 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 ..; \ + # cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libsvtav1 https://gitlab.com/AOMediaCodec/SVT-AV1.git +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +# RUN \ +# echo "Installing dependencies libpng" && \ +# apt-get install -yq libsvtav1enc-dev + +RUN \ + echo "Building SVT-AV1 v${SVTAV1_VERSION}" && \ + DIR=/tmp/libsvtav1 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${SVTAV1_VERSION}/SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + cd Build && \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=Release -DBUILD_DEC=OFF -DBUILD_SHARED_LIBS=OFF ..; \ make ; \ make install ; \ rm -rf ${DIR} -## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## libdav1d https://code.videolan.org/videolan/dav1d +## https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## installed w/ apt-get in the build stage RUN \ + echo "installing libdav1d-dev with debian packages" && \ + apt-get install -yq libdav1d-dev + +## x.org: util-macros (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + echo "Building x.org: util-macros-${XORG_MACROS_VERSION}" && \ 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 && \ + 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} +## x.org: xproto RUN \ + echo "Building x.org: xproto-${XPROTO_VERSION}" && \ 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 && \ + cp /usr/share/misc/config.guess . && \ ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ make && \ make install && \ rm -rf ${DIR} +## libXau RUN \ + echo "Building x.org: libXau-${XAU_VERSION}" && \ DIR=/tmp/libXau && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -394,7 +452,9 @@ RUN \ make install && \ rm -rf ${DIR} +## libpthread-stubs RUN \ + echo "Building libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}" && \ DIR=/tmp/libpthread-stubs && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -408,6 +468,7 @@ RUN \ ## libxml2 - for libbluray RUN \ + echo "Building libxml2-${LIBXML2_VERSION}" && \ DIR=/tmp/libxml2 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -420,6 +481,7 @@ RUN \ ## libbluray - Requires libxml, freetype, and fontconfig RUN \ + echo "Building libbluray-${LIBBLURAY_VERSION}" && \ DIR=/tmp/libbluray && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -432,13 +494,14 @@ RUN \ rm -rf ${DIR} ## libzmq https://github.com/zeromq/libzmq/ +# this one pulls in a bunch of dependencies RUN \ + echo "Building libzmq-${LIBZMQ_VERSION}" && \ 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 && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" && \ make && \ @@ -446,20 +509,11 @@ RUN \ 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 +# also pulls in a bunch of stuff RUN \ + echo "Building libpng-${LIBPNG_VERSION}" && \ DIR=/tmp/png && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -472,6 +526,7 @@ RUN \ ## libaribb24 RUN \ + echo "Building libaribb24-${LIBARIBB24_VERSION}" && \ DIR=/tmp/b24 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -486,6 +541,7 @@ RUN \ # zimg https://github.com/sekrit-twc/zimg RUN \ + echo "Building zimg-${ZIMG_VERSION}" && \ DIR=/tmp/zimg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ @@ -497,21 +553,98 @@ RUN \ make install && \ rm -rf ${DIR} +### libtheora http://www.theora.org/ ( xiph ) +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +RUN \ + echo "Building libtheora-${THEORA_VERSION}" && \ + 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 && \ + # add sym link for sdl-config + # ln -s /usr/bin/sdl2-config /usr/bin/sdl-config && \ + # currently build does not find sdl-config, and thus no playback support is enabled (probably exacly, the way it was before) + # Note: consider installing doxygen so that the api documentation is built + # right now, I did not, so we can keep everything small. + # disable examples to advoid the libjpeg sizeof error still in the example code. + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +# RUN \ +# echo "installing libsrt-dev with debian package: Secure Reliable Transport UDP streaming library (OpenSSL flavour)" && \ +# apt-get install -yq libsrt1.5-openssl +# libsrt-openssl-dev +RUN \ + echo "Adding libssl-dev for libsrt build" && \ + apt-get install -yq --no-install-recommends libssl-dev + # Note: we can get the config error + # GnuTLS('libgnutls28-dev') and OpenSSL('libssl-dev') must not be enabled at the same time, + # from a previous build + # so we add libssl-dev and later in the build + + ## libsrt https://github.com/Haivision/srt +RUN \ + echo "Building libsrt-${LIBSRT_VERSION}" && \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/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} + + + +## libvmaf https://github.com/Netflix/vmaf +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + + ## Download ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (intial) ffmpeg-${FFMPEG_VERSION}" && \ 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 && \ - ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ - make ; make install - - + tar -jx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.bz2 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install ## Build ffmpeg https://ffmpeg.org/ RUN \ + echo "Building (final) ffmpeg-${FFMPEG_VERSION}" && \ DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ ./configure \ --disable-debug \ --disable-doc \ @@ -547,14 +680,12 @@ RUN \ --enable-postproc \ --enable-shared \ --enable-small \ - --enable-vaapi \ --enable-version3 \ - --extra-cflags="-I${PREFIX}/include" \ - --extra-ldflags="-L${PREFIX}/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu" \ --extra-libs=-ldl \ --extra-libs=-lpthread \ --prefix="${PREFIX}" && \ - make clean && \ make && \ make install && \ make tools/zmqsend && cp tools/zmqsend ${PREFIX}/bin/ && \ @@ -563,20 +694,33 @@ RUN \ cd tools && \ make qt-faststart && cp qt-faststart ${PREFIX}/bin/ + + ## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ cp ${PREFIX}/bin/* /usr/local/bin/ && \ cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ mkdir -p /usr/local/lib/pkgconfig && \ - for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ done -FROM base AS release +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg @@ -585,12 +729,3 @@ ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 CMD ["--help"] ENTRYPOINT ["ffmpeg"] -COPY --from=build /usr/local /usr/local/ - -RUN \ - apt-get update -y && \ - apt-get install -y --no-install-recommends libva-drm2 libva2 i965-va-driver && \ - rm -rf /var/lib/apt/lists/* - -# 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/7.0/ubuntu2404/Dockerfile b/docker-images/7.0/ubuntu2404/Dockerfile new file mode 100644 index 000000000..95d295757 --- /dev/null +++ b/docker-images/7.0/ubuntu2404/Dockerfile @@ -0,0 +1,329 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +# Stage 1: Build +FROM ubuntu:24.04 AS builder + + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=7.0.2 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y + +# FROM base AS build + + + +RUN buildDeps="autoconf \ + automake \ + cmake \ + build-essential \ + texinfo \ + curl \ + wget \ + bzip2 \ + libexpat1-dev \ + gcc \ + git \ + git-core \ + gperf \ + libtool \ + make \ + meson \ + ninja-build \ + nasm \ + perl \ + pkg-config \ + python3 \ + yasm \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ + libva-dev \ + libvdpau-dev \ + libnuma-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} + +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libsvtav1 \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu" \ + --extra-libs=-ldl \ + --extra-libs=-lm \ + --extra-libs=-lpthread \ + --ld=g++ \ + --prefix="${PREFIX}" && \ + 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/ + + + + +## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) +RUN \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ + done + +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + diff --git a/docker-images/7.0/vaapi2404/Dockerfile b/docker-images/7.0/vaapi2404/Dockerfile new file mode 100644 index 000000000..d41f95cc0 --- /dev/null +++ b/docker-images/7.0/vaapi2404/Dockerfile @@ -0,0 +1,309 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM ubuntu:24.04 as base + +WORKDIR /tmp/workdir + +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 && \ + apt-get autoremove -y && \ + apt-get clean -y + +FROM base as build + +ENV FFMPEG_VERSION=7.0.2 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive + +RUN buildDeps="autoconf \ + automake \ + cmake \ + curl \ + bzip2 \ + libexpat1-dev \ + g++ \ + gcc \ + git \ + gperf \ + libtool \ + make \ + meson \ + nasm \ + perl \ + pkg-config \ + libssl-dev \ + yasm \ + libva-dev \ + zlib1g-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-vaapi \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lpthread \ + --prefix="${PREFIX}" && \ + 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/ + + +## cleanup +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ + for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +FROM base AS release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local/ + +RUN \ + apt-get update -y && \ + apt-get install -y --no-install-recommends libva-drm2 libva2 i965-va-driver && \ + rm -rf /var/lib/apt/lists/* + +# 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/7.1/alpine320/Dockerfile b/docker-images/7.1/alpine320/Dockerfile new file mode 100644 index 000000000..5868f283b --- /dev/null +++ b/docker-images/7.1/alpine320/Dockerfile @@ -0,0 +1,369 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# + +FROM alpine:3.20 as base + +RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git + +FROM base as build + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=7.1 \ + AOM_VERSION=v3.8.1 \ + CHROMAPRINT_VERSION=1.5.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.6 \ + OPUS_VERSION=1.2 \ + OPENJPEG_VERSION=2.5.2 \ + PYTHON=python3 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.5 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.0.2 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.7 \ + LIBXML2_VERSION=2.9.12 \ + LIBBLURAY_VERSION=1.1.2 \ + # LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=2.3.1 \ + ZIMG_VERSION=3.0.5 \ + 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 LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + + +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 libDeps="libgomp \ + # https://github.com/zeromq/libzmq/ + zeromq \ + zeromq-dev \ + # https://sourceforge.net/projects/opencore-amr/ + opencore-amr \ + opencore-amr-dev \ + # https://www.xiph.org/ogg/ + libogg \ + libogg-static \ + libogg-dev \ + # libtheora http://www.theora.org/ + libtheora \ + libtheora-static \ + libtheora-dev \ + # http://www.videolan.org/developers/x264.html + x264 \ + x264-libs \ + x264-dev \ + # http://x265.org/ + x265 \ + x265-libs \ + x265-dev \ + # https://www.opus-codec.org/ + opus \ + opus-tools \ + opus-dev \ + # https://xiph.org/vorbis/ + libvorbis \ + libvorbis-static \ + libvorbis-dev \ + # https://www.webmproject.org/code/ + libvpx \ + libvpx-utils \ + libvpx-dev \ + # https://developers.google.com/speed/webp/ + libwebp \ + libwebp-dev \ + libwebp-static \ + libwebp-tools \ + # http://lame.sourceforge.net/ + lame \ + lame-libs \ + lame-dev \ + # https://www.xvid.com/ + xvidcore \ + xvidcore-static \ + xvidcore-dev \ + # https://github.com/mstorsjo/fdk-aac + fdk-aac \ + fdk-aac-dev \ + # https://github.com/uclouvain/openjpeg + openjpeg \ + openjpeg-tools \ + openjpeg-dev \ + # https://www.freetype.org/ + freetype \ + freetype-static \ + freetype-dev \ + # https://github.com/georgmartius/vid.stab + vidstab \ + vidstab-dev \ + ## https://www.fribidi.org/ + fribidi \ + fribidi-static \ + fribidi-dev \ + # fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ + fontconfig \ + fontconfig-static \ + fontconfig-dev \ + # https://github.com/libass/libass + libass \ + libass-dev \ + # https://aomedia.googlesource.com/aom + aom \ + aom-libs \ + aom-dev \ + # https://xcb.freedesktop.org/ + # https://www.x.org/archive//individual/util/util-macros- + util-macros \ + # https://www.x.org/archive/individual/proto/xproto- + xorgproto \ + # https://www.x.org/archive/individual/lib/libXau- + libxau \ + libxau-dev \ + # https://github.com/GNOME/libxml2/ + libxml2 \ + libxml2-static \ + libxml2-utils \ + libxml2-dev \ + # https://github.com/Haivision/srt + libsrt \ + libsrt-progs \ + libsrt-dev \ + # https://git.code.sf.net/p/libpng/code + libpng \ + libpng-static \ + libpng-utils \ + libpng-dev \ + # https://github.com/sekrit-twc/zimg + zimg \ + zimg-dev" && \ + apk add --no-cache --update ${libDeps} + + +RUN buildDeps="autoconf \ + automake \ + bash \ + binutils \ + bzip2 \ + cmake \ + coreutils \ + curl \ + diffutils \ + expat-dev \ + file \ + g++ \ + gcc \ + gperf \ + libtool \ + make \ + nasm \ + openssl-dev \ + python3 \ + tar \ + xcb-proto \ + yasm \ + zlib-dev \ + alpine-sdk \ + linux-headers" && \ + apk add --no-cache --update ${buildDeps} +## 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 + +## 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} + +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? +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} + + +## 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} + +## 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} + +## Download 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 && \ + ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ + make ; make install + + + + + +# ## Build ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libsvtav1 \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lm \ + --extra-libs=-lpthread \ + --ld=g++ \ + --prefix="${PREFIX}" && \ + make clean && \ + 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/lib/ && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + mkdir -p /usr/local/include && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +### Release Stage +FROM base as release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local diff --git a/docker-images/7.1/nvidia2204/Dockerfile b/docker-images/7.1/nvidia2204/Dockerfile new file mode 100644 index 000000000..51ca3e3b9 --- /dev/null +++ b/docker-images/7.1/nvidia2204/Dockerfile @@ -0,0 +1,335 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# + +FROM nvcr.io/nvidia/cuda:12.3.1-devel-ubuntu22.04 AS devel-base +ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video +ENV DEBIAN_FRONTEND=noninteractive +WORKDIR /tmp/workdir + +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 python3 && \ + apt-get autoremove -y && \ + apt-get clean -y + +FROM nvcr.io/nvidia/cuda:12.3.1-runtime-ubuntu22.04 AS runtime-base + +ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video +ENV DEBIAN_FRONTEND=nonintercative +WORKDIR /tmp/workdir + +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 libxcb-shape0-dev && \ + apt-get autoremove -y && \ + apt-get clean -y + + +FROM devel-base as build + +ENV NVIDIA_HEADERS_VERSION=11.1.5.3 + +ENV FFMPEG_VERSION=7.1 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +RUN buildDeps="autoconf \ + automake \ + cmake \ + curl \ + bzip2 \ + libexpat1-dev \ + g++ \ + gcc \ + git \ + gperf \ + libtool \ + make \ + nasm \ + perl \ + pkg-config \ + python3 \ + libssl-dev \ + yasm \ + zlib1g-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} + +RUN \ + DIR=/tmp/nv-codec-headers && \ + git clone https://github.com/FFmpeg/nv-codec-headers ${DIR} && \ + cd ${DIR} && \ + git checkout n${NVIDIA_HEADERS_VERSION} && \ + make PREFIX="${PREFIX}" && \ + make install PREFIX="${PREFIX}" && \ + rm -rf ${DIR} + +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-cuda \ + --enable-cuvid \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libnpp \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-nvenc \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include -I${PREFIX}/include/ffnvcodec -I/usr/local/cuda/include/" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/" \ + --extra-libs=-ldl \ + --extra-libs=-lpthread \ + --prefix="${PREFIX}" && \ + 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/ + + +## cleanup +RUN \ + LD_LIBRARY_PATH="${PREFIX}/lib:${PREFIX}/lib64:${LD_LIBRARY_PATH}" ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ + for lib in /usr/local/lib/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/* /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ + done + + + +FROM runtime-base AS release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +# copy only needed files, without copying nvidia dev files +COPY --from=build /usr/local/bin /usr/local/bin/ +COPY --from=build /usr/local/share /usr/local/share/ +COPY --from=build /usr/local/lib /usr/local/lib/ +COPY --from=build /usr/local/include /usr/local/include/ + +# 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/7.0/alpine313/Dockerfile b/docker-images/7.1/scratch320/Dockerfile similarity index 78% rename from docker-images/7.0/alpine313/Dockerfile rename to docker-images/7.1/scratch320/Dockerfile index e9b75eac3..ca1d90c77 100644 --- a/docker-images/7.0/alpine313/Dockerfile +++ b/docker-images/7.1/scratch320/Dockerfile @@ -4,74 +4,72 @@ # # -FROM alpine:3.13 AS base - -RUN apk add --no-cache --update libgcc libstdc++ ca-certificates libcrypto1.1 libssl1.1 libgomp expat git - - -FROM base AS build +FROM alpine:3.20 as build WORKDIR /tmp/workdir -ENV FFMPEG_VERSION=7.0.2 \ - AOM_VERSION=v3.8.1 \ - CHROMAPRINT_VERSION=1.5.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 \ - PYTHON=python3 \ +ENV FFMPEG_VERSION=7.1 \ + LIBVMAF_VERSION=2.3.1 \ + OPENCOREAMR_VERSION=0.1.6 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + OGG_VERSION=1.3.5 \ + OPUS_VERSION=1.3 \ + VORBIS_VERSION=1.3.7 \ 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 \ + WEBP_VERSION=1.4.0 \ + LAME_VERSION=3.100 \ + XVID_VERSION=1.3.7 \ + FDKAAC_VERSION=2.0.3 \ + OPENJPEG_VERSION=2.5.2 \ + FREETYPE_VERSION=2.13.3 \ + LIBVIDSTAB_VERSION=1.1.1 \ + FRIBIDI_VERSION=1.0.16 \ + FONTCONFIG_VERSION=2.15.0 \ + LIBASS_VERSION=0.17.3 \ + KVAZAAR_VERSION=2.3.1 \ + AOM_VERSION=v3.10.0 \ + XORG_MACROS_VERSION=1.20.1 \ XPROTO_VERSION=7.0.31 \ - XVID_VERSION=1.3.4 \ - LIBXML2_VERSION=2.9.12 \ - LIBBLURAY_VERSION=1.1.2 \ - LIBZMQ_VERSION=4.3.2 \ - LIBSRT_VERSION=1.4.1 \ + XAU_VERSION=1.0.11 \ + LIBPTHREAD_STUBS_VERSION=0.5 \ + LIBXML2_VERSION=2.13.4 \ + LIBBLURAY_VERSION=1.3.4 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBPNG_VERSION=1.6.44 \ LIBARIBB24_VERSION=1.0.3 \ - LIBPNG_VERSION=1.6.9 \ - LIBVMAF_VERSION=2.1.1 \ ZIMG_VERSION=3.0.5 \ 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" +# + # CHROMAPRINT_VERSION=1.5.0 \ + # LIBXCB_VERSION=1.13.1 \ + # XCBPROTO_VERSION=1.13 \ + # PYTHON=python3 \ + +ARG OGG_SHA256SUM="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.5.tar.gz" +ARG OPUS_SHA256SUM="4f3d69aefdf2dbaf9825408e452a8a414ffc60494c70633560700398820dc550 opus-1.3.tar.gz" +ARG VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.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 LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" -ARG LIBZMQ_SHA256SUM="02ecc88466ae38cf2c8d79f09cfd2675ba299a439680b64ade733e26a349edeb v4.3.2.tar.gz" +ARG FREETYPE_SHA256SUM="5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 freetype-2.13.3.tar.gz" +# ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 1.0.16.tar.gz" +# ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +# ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBBLURAY_SHA512SUM="94dbf3b68d1c23fe4648c153cc2f0c251886fac0a6b6bbe3a77caabaa5322682f712afe4a7b6b16ca3f06744fbc0e1ca872209a32898dcf0ae182055d335aec1 libbluray-1.3.4.tar.bz2" +ARG LIBZMQ_SHA256SUM="ae933b1e98411fd7cb8309f9502d2737 zeromq-4.3.5.tar.gz" ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + 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 apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git libgomp + RUN buildDeps="autoconf \ automake \ bash \ @@ -94,8 +92,13 @@ RUN buildDeps="autoconf \ tar \ xcb-proto \ yasm \ - zlib-dev" && \ + zlib-dev \ + alpine-sdk \ + linux-headers" && \ apk add --no-cache --update ${buildDeps} + +#RUN apk add --no-cache --update meson samuri + ## libvmaf https://github.com/Netflix/vmaf RUN \ if which meson || false; then \ @@ -143,9 +146,9 @@ RUN \ DIR=/tmp/x265 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265-${X265_VERSION}/build/linux && \ + 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 && \ @@ -189,6 +192,7 @@ RUN \ make install && \ rm -rf ${DIR} ### libtheora http://www.theora.org/ +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure RUN \ DIR=/tmp/theora && \ mkdir -p ${DIR} && \ @@ -196,7 +200,7 @@ RUN \ 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 && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --build="aarch64-unknown-linux-gnu" --enable-shared && \ make && \ make install && \ rm -rf ${DIR} @@ -214,7 +218,7 @@ RUN \ rm -rf ${DIR} ### libwebp https://developers.google.com/speed/webp/ RUN \ - DIR=/tmp/vebp && \ + DIR=/tmp/webp && \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ @@ -239,8 +243,7 @@ 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 && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ cd xvidcore/build/generic && \ ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ @@ -264,9 +267,10 @@ RUN \ DIR=/tmp/openjpeg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ make install && \ rm -rf ${DIR} @@ -288,7 +292,7 @@ RUN \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ - echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + # echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -299,9 +303,9 @@ 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 && \ + curl -sLO https://github.com/fribidi/fribidi/archive/refs/tags/v${FRIBIDI_VERSION}.tar.gz && \ + # echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f fribidi-${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 && \ @@ -313,19 +317,19 @@ 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 && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz && \ + tar -zx --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 +## libass v 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 && \ + # echo ${LIBASS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -337,7 +341,7 @@ RUN \ DIR=/tmp/kvazaar && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v2.3.1/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -358,12 +362,13 @@ RUN \ rm -rf ${DIR} ## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## util-macros 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 && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.xz && \ + tar -Jx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ make && \ make install && \ @@ -391,6 +396,7 @@ RUN \ make install && \ rm -rf ${DIR} +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? RUN \ DIR=/tmp/libpthread-stubs && \ mkdir -p ${DIR} && \ @@ -421,21 +427,22 @@ RUN \ 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 && \ + echo ${LIBBLURAY_SHA512SUM} | sha512sum --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} +# Update Use the zeromq zeromq-dev packages from the alpine repository ## 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 && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha512sum --check && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" && \ make && \ @@ -448,7 +455,7 @@ RUN \ DIR=/tmp/srt && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/v${LIBSRT_VERSION}.tar.gz && \ tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -506,7 +513,7 @@ RUN \ -## Build ffmpeg https://ffmpeg.org/ +# ## Build ffmpeg https://ffmpeg.org/ RUN \ DIR=/tmp/ffmpeg && cd ${DIR} && \ ./configure \ @@ -519,7 +526,8 @@ RUN \ --enable-libaribb24 \ --enable-libass \ --enable-libbluray \ - --enable-libfdk_aac \ + --enable-libdav1d \ + --enable-libfdk-aac \ --enable-libfreetype \ --enable-libkvazaar \ --enable-libmp3lame \ @@ -528,8 +536,10 @@ RUN \ --enable-libopenjpeg \ --enable-libopus \ --enable-libsrt \ + --enable-libsvtav1 \ --enable-libtheora \ --enable-libvidstab \ + --enable-libvmaf \ --enable-libvorbis \ --enable-libvpx \ --enable-libwebp \ @@ -547,7 +557,9 @@ RUN \ --extra-cflags="-I${PREFIX}/include" \ --extra-ldflags="-L${PREFIX}/lib" \ --extra-libs=-ldl \ + --extra-libs=-lm \ --extra-libs=-lpthread \ + --ld=g++ \ --prefix="${PREFIX}" && \ make clean && \ make && \ @@ -560,29 +572,21 @@ RUN \ RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ - mkdir -p /usr/local/include && \ - cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ - mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ - done + mkdir -p /tmp/fakeroot/lib && \ + ldd ${PREFIX}/bin/ffmpeg | cut -d ' ' -f 3 | strings | xargs -I R cp R /tmp/fakeroot/lib/ && \ + for lib in /tmp/fakeroot/lib/*; do strip --strip-all $lib; done && \ + cp -r ${PREFIX}/bin /tmp/fakeroot/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /tmp/fakeroot/share/ && \ + LD_LIBRARY_PATH=/tmp/fakeroot/lib /tmp/fakeroot/bin/ffmpeg -buildconf ### Release Stage -FROM base AS release +FROM scratch as release LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 CMD ["--help"] -ENTRYPOINT ["ffmpeg"] - -COPY --from=build /usr/local /usr/local +ENTRYPOINT ["/bin/ffmpeg"] -# Let's make sure the app built correctly -# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output +COPY --from=build /tmp/fakeroot/ / diff --git a/docker-images/7.1/ubuntu2404-edge/Dockerfile b/docker-images/7.1/ubuntu2404-edge/Dockerfile new file mode 100644 index 000000000..73dcd8feb --- /dev/null +++ b/docker-images/7.1/ubuntu2404-edge/Dockerfile @@ -0,0 +1,731 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +# Stage 1: Build +FROM ubuntu:24.04 AS builder + + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=7.1 \ + AOM_VERSION=v3.10.0 \ + SVTAV1_VERSION=2.2.1 \ + CHROMAPRINT_VERSION=1.5.0 \ + FDKAAC_VERSION=2.0.3 \ + 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.5 \ + OPENCOREAMR_VERSION=0.1.6 \ + OPUS_VERSION=1.5.2 \ + OPENJPEG_VERSION=2.5.2 \ + PYTHON=python3 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.7 \ + VPX_VERSION=1.14.1 \ + WEBP_VERSION=1.4.0 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.7 \ + LIBXML2_VERSION=2.9.12 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=3.0.0 \ + ZIMG_VERSION=3.0.5 \ + 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="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.4.tar.gz" +ARG OPUS_SHA256SUM="65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1 opus-1.5.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y + +# FROM base AS build + + + +RUN buildDeps="autoconf \ + automake \ + cmake \ + build-essential \ + texinfo \ + curl \ + wget \ + bzip2 \ + libexpat1-dev \ + gcc \ + git \ + git-core \ + gperf \ + libtool \ + make \ + meson \ + ninja-build \ + nasm \ + perl \ + pkg-config \ + python3 \ + yasm \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ + libva-dev \ + libvdpau-dev \ + libnuma-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} + +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +# opencore-amr: from source +RUN \ + echo "Building opencore-amr-${OPENCOREAMR_VERSION}" && \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ + 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 \ + echo "Building x264-snapshot-${X264_VERSION}" && \ + 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/ ( videolan ) +RUN \ + echo "Building x265_${X265_VERSION}" && \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${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/ ( xiph ) +RUN \ + echo "Building libogg-${OGG_VERSION}" && \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://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/ ( xiph ) +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +# apt libopus-dev +RUN \ + echo "Building opus-${OPUS_VERSION}" && \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/xiph/opus/releases/download/v${OPUS_VERSION}/opus-${OPUS_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + # echo ${OPUS_SHA256SUM} | sha256sum --check && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + # ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +### libvorbis https://xiph.org/vorbis/ ( xiph ) +RUN \ + echo "Building libvorbis-${VORBIS_VERSION}" && \ + 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} + +### libvpx https://www.webmproject.org/code/ +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +### configure w/ --as=yasm ?? +### double check that this came from the correct place. +RUN \ + echo "Building libvpx-${VPX_VERSION}" && \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://chromium.googlesource.com/webm/libvpx.git/+archive/v${VPX_VERSION}.tar.gz | \ + tar -zxm && \ + ./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 \ + echo "Building libwebp-${WEBP_VERSION}" && \ + DIR=/tmp/webp && \ + 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 \ + echo "Building lame-${LAME_VERSION}" && \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} + +### xvid (xvidcore) https://www.xvid.com/ +RUN \ + echo "Building xvidcore-${XVID_VERSION}" && \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + 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 +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +# might not need --datadir anymore +RUN \ + echo "Building fdk-aac-${FDKAAC_VERSION}" && \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/refs/tags/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 \ + echo "Building openjpeg-${OPENJPEG_VERSION}" && \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## freetype https://www.freetype.org/ +# make sure to pass in --no-install-recommends for this one its globbie +RUN \ + echo "Building freetype-${FREETYPE_VERSION}" && \ + 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} + +## libvidstab https://github.com/georgmartius/vid.stab +RUN \ + echo "Building libvidstab-${LIBVIDSTAB_VERSION}" && \ + 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 \ + echo "Building fribidi-${FRIBIDI_VERSION}" && \ + 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 \ + echo "Building fontconfig-${FONTCONFIG_VERSION}" && \ + 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 \ + echo "Building libass-${LIBASS_VERSION}" && \ + 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 \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + 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} +# lib aom +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +RUN \ + echo "Building aom-${AOM_VERSION}" && \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + # cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libsvtav1 https://gitlab.com/AOMediaCodec/SVT-AV1.git +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +# RUN \ +# echo "Installing dependencies libpng" && \ +# apt-get install -yq libsvtav1enc-dev + +RUN \ + echo "Building SVT-AV1 v${SVTAV1_VERSION}" && \ + DIR=/tmp/libsvtav1 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${SVTAV1_VERSION}/SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + cd Build && \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=Release -DBUILD_DEC=OFF -DBUILD_SHARED_LIBS=OFF ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libdav1d https://code.videolan.org/videolan/dav1d +## https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## installed w/ apt-get in the build stage +RUN \ + echo "installing libdav1d-dev with debian packages" && \ + apt-get install -yq libdav1d-dev + +## x.org: util-macros (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + echo "Building x.org: util-macros-${XORG_MACROS_VERSION}" && \ + 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} + +## x.org: xproto +RUN \ + echo "Building x.org: xproto-${XPROTO_VERSION}" && \ + 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 && \ + cp /usr/share/misc/config.guess . && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libXau +RUN \ + echo "Building x.org: libXau-${XAU_VERSION}" && \ + 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} + +## libpthread-stubs +RUN \ + echo "Building libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}" && \ + 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} + + +## libxml2 - for libbluray +RUN \ + echo "Building libxml2-${LIBXML2_VERSION}" && \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ + tar -xz --strip-components=1 && \ + ./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 \ + echo "Building libbluray-${LIBBLURAY_VERSION}" && \ + 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/ +# this one pulls in a bunch of dependencies +RUN \ + echo "Building libzmq-${LIBZMQ_VERSION}" && \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + + +## libpng +# also pulls in a bunch of stuff +RUN \ + echo "Building libpng-${LIBPNG_VERSION}" && \ + 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 \ + echo "Building libaribb24-${LIBARIBB24_VERSION}" && \ + 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} + +# zimg https://github.com/sekrit-twc/zimg +RUN \ + echo "Building zimg-${ZIMG_VERSION}" && \ + DIR=/tmp/zimg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/sekrit-twc/zimg/archive/refs/tags/release-${ZIMG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +### libtheora http://www.theora.org/ ( xiph ) +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +RUN \ + echo "Building libtheora-${THEORA_VERSION}" && \ + 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 && \ + # add sym link for sdl-config + # ln -s /usr/bin/sdl2-config /usr/bin/sdl-config && \ + # currently build does not find sdl-config, and thus no playback support is enabled (probably exacly, the way it was before) + # Note: consider installing doxygen so that the api documentation is built + # right now, I did not, so we can keep everything small. + # disable examples to advoid the libjpeg sizeof error still in the example code. + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +# RUN \ +# echo "installing libsrt-dev with debian package: Secure Reliable Transport UDP streaming library (OpenSSL flavour)" && \ +# apt-get install -yq libsrt1.5-openssl +# libsrt-openssl-dev +RUN \ + echo "Adding libssl-dev for libsrt build" && \ + apt-get install -yq --no-install-recommends libssl-dev + # Note: we can get the config error + # GnuTLS('libgnutls28-dev') and OpenSSL('libssl-dev') must not be enabled at the same time, + # from a previous build + # so we add libssl-dev and later in the build + + ## libsrt https://github.com/Haivision/srt +RUN \ + echo "Building libsrt-${LIBSRT_VERSION}" && \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/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} + + + +## libvmaf https://github.com/Netflix/vmaf +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +## Build ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (final) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu" \ + --extra-libs=-ldl \ + --extra-libs=-lpthread \ + --prefix="${PREFIX}" && \ + 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/ + + + +## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) +RUN \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ + done + +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + diff --git a/docker-images/7.1/ubuntu2404/Dockerfile b/docker-images/7.1/ubuntu2404/Dockerfile new file mode 100644 index 000000000..39852c519 --- /dev/null +++ b/docker-images/7.1/ubuntu2404/Dockerfile @@ -0,0 +1,329 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +# Stage 1: Build +FROM ubuntu:24.04 AS builder + + +WORKDIR /tmp/workdir + +ENV FFMPEG_VERSION=7.1 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y + +# FROM base AS build + + + +RUN buildDeps="autoconf \ + automake \ + cmake \ + build-essential \ + texinfo \ + curl \ + wget \ + bzip2 \ + libexpat1-dev \ + gcc \ + git \ + git-core \ + gperf \ + libtool \ + make \ + meson \ + ninja-build \ + nasm \ + perl \ + pkg-config \ + python3 \ + yasm \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ + libva-dev \ + libvdpau-dev \ + libnuma-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} + +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libdav1d \ + --enable-libfdk-aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libsvtav1 \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu" \ + --extra-libs=-ldl \ + --extra-libs=-lm \ + --extra-libs=-lpthread \ + --ld=g++ \ + --prefix="${PREFIX}" && \ + 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/ + + + + +## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) +RUN \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/pkgconfig && \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ + done + +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + diff --git a/docker-images/7.1/vaapi2404/Dockerfile b/docker-images/7.1/vaapi2404/Dockerfile new file mode 100644 index 000000000..ba1ba833d --- /dev/null +++ b/docker-images/7.1/vaapi2404/Dockerfile @@ -0,0 +1,309 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# +FROM ubuntu:24.04 as base + +WORKDIR /tmp/workdir + +RUN apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 && \ + apt-get autoremove -y && \ + apt-get clean -y + +FROM base as build + +ENV FFMPEG_VERSION=7.1 \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" + + +ARG DEBIAN_FRONTEND=noninteractive + +RUN buildDeps="autoconf \ + automake \ + cmake \ + curl \ + bzip2 \ + libexpat1-dev \ + g++ \ + gcc \ + git \ + gperf \ + libtool \ + make \ + meson \ + nasm \ + perl \ + pkg-config \ + libssl-dev \ + yasm \ + libva-dev \ + zlib1g-dev" && \ + apt-get -yqq update && \ + apt-get install -yq --no-install-recommends ${buildDeps} +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + --disable-debug \ + --disable-doc \ + --disable-ffplay \ + --enable-fontconfig \ + --enable-gpl \ + --enable-libaom \ + --enable-libaribb24 \ + --enable-libass \ + --enable-libbluray \ + --enable-libfdk_aac \ + --enable-libfreetype \ + --enable-libkvazaar \ + --enable-libmp3lame \ + --enable-libopencore-amrnb \ + --enable-libopencore-amrwb \ + --enable-libopenjpeg \ + --enable-libopus \ + --enable-libsrt \ + --enable-libtheora \ + --enable-libvidstab \ + --enable-libvmaf \ + --enable-libvorbis \ + --enable-libvpx \ + --enable-libwebp \ + --enable-libx264 \ + --enable-libx265 \ + --enable-libxvid \ + --enable-libzimg \ + --enable-libzmq \ + --enable-nonfree \ + --enable-openssl \ + --enable-postproc \ + --enable-shared \ + --enable-small \ + --enable-vaapi \ + --enable-version3 \ + --extra-cflags="-I${PREFIX}/include" \ + --extra-ldflags="-L${PREFIX}/lib" \ + --extra-libs=-ldl \ + --extra-libs=-lpthread \ + --prefix="${PREFIX}" && \ + 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/ + + +## cleanup +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ + for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +FROM base AS release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local/ + +RUN \ + apt-get update -y && \ + apt-get install -y --no-install-recommends libva-drm2 libva2 i965-va-driver && \ + rm -rf /var/lib/apt/lists/* + +# 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 8d096eb92..fe1c61ee4 100644 --- a/docker-images/azure-jobs.yml +++ b/docker-images/azure-jobs.yml @@ -8,289 +8,217 @@ jobs: maxParallel: 10 matrix: - ubuntu2204_7.0.2: + ubuntu2404_7.1: MAJOR_VERSION: 7 - VERSION: 7.0 - LONG_VERSION: 7.0.2 - VARIANT: ubuntu2204 + VERSION: 7.1 + LONG_VERSION: 7.1 + VARIANT: ubuntu2404 PARENT: ubuntu ISPARENT: True - alpine313_7.0.2: + ubuntu2404-edge_7.1: MAJOR_VERSION: 7 - VERSION: 7.0 - LONG_VERSION: 7.0.2 - VARIANT: alpine313 - PARENT: alpine + VERSION: 7.1 + LONG_VERSION: 7.1 + VARIANT: ubuntu2404-edge + PARENT: ubuntu-edge ISPARENT: True - scratch313_7.0.2: + alpine320_7.1: MAJOR_VERSION: 7 - VERSION: 7.0 - LONG_VERSION: 7.0.2 - VARIANT: scratch313 - PARENT: scratch + VERSION: 7.1 + LONG_VERSION: 7.1 + VARIANT: alpine320 + PARENT: alpine ISPARENT: True - vaapi2204_7.0.2: + scratch320_7.1: MAJOR_VERSION: 7 - VERSION: 7.0 - LONG_VERSION: 7.0.2 - VARIANT: vaapi2204 - PARENT: vaapi + VERSION: 7.1 + LONG_VERSION: 7.1 + VARIANT: scratch320 + PARENT: scratch ISPARENT: True - nvidia2204_7.0.2: + vaapi2404_7.1: MAJOR_VERSION: 7 - VERSION: 7.0 - LONG_VERSION: 7.0.2 - VARIANT: nvidia2204 - PARENT: nvidia - ISPARENT: True - - - ubuntu2204_6.1.2: - MAJOR_VERSION: 6 - VERSION: 6.1 - LONG_VERSION: 6.1.2 - VARIANT: ubuntu2204 - PARENT: ubuntu - ISPARENT: True - - - vaapi2204_6.1.2: - MAJOR_VERSION: 6 - VERSION: 6.1 - LONG_VERSION: 6.1.2 - VARIANT: vaapi2204 + VERSION: 7.1 + LONG_VERSION: 7.1 + VARIANT: vaapi2404 PARENT: vaapi ISPARENT: True - nvidia2204_6.1.2: - MAJOR_VERSION: 6 - VERSION: 6.1 - LONG_VERSION: 6.1.2 + nvidia2204_7.1: + MAJOR_VERSION: 7 + VERSION: 7.1 + LONG_VERSION: 7.1 VARIANT: nvidia2204 PARENT: nvidia ISPARENT: True - ubuntu2204_5.1.6: - MAJOR_VERSION: 5 - VERSION: 5.1 - LONG_VERSION: 5.1.6 - VARIANT: ubuntu2204 + ubuntu2404_7.0.2: + MAJOR_VERSION: 7 + VERSION: 7.0 + LONG_VERSION: 7.0.2 + VARIANT: ubuntu2404 PARENT: ubuntu ISPARENT: True - alpine313_5.1.6: - MAJOR_VERSION: 5 - VERSION: 5.1 - LONG_VERSION: 5.1.6 - VARIANT: alpine313 - PARENT: alpine - ISPARENT: True - - - vaapi2204_5.1.6: - MAJOR_VERSION: 5 - VERSION: 5.1 - LONG_VERSION: 5.1.6 - VARIANT: vaapi2204 - PARENT: vaapi - ISPARENT: True - - - nvidia2204_5.1.6: - MAJOR_VERSION: 5 - VERSION: 5.1 - LONG_VERSION: 5.1.6 - VARIANT: nvidia2204 - PARENT: nvidia - ISPARENT: True - - - ubuntu2204_4.4.5: - MAJOR_VERSION: 4 - VERSION: 4.4 - LONG_VERSION: 4.4.5 - VARIANT: ubuntu2204 - PARENT: ubuntu + ubuntu2404-edge_7.0.2: + MAJOR_VERSION: 7 + VERSION: 7.0 + LONG_VERSION: 7.0.2 + VARIANT: ubuntu2404-edge + PARENT: ubuntu-edge ISPARENT: True - alpine313_4.4.5: - MAJOR_VERSION: 4 - VERSION: 4.4 - LONG_VERSION: 4.4.5 - VARIANT: alpine313 + alpine320_7.0.2: + MAJOR_VERSION: 7 + VERSION: 7.0 + LONG_VERSION: 7.0.2 + VARIANT: alpine320 PARENT: alpine ISPARENT: True - scratch313_4.4.5: - MAJOR_VERSION: 4 - VERSION: 4.4 - LONG_VERSION: 4.4.5 - VARIANT: scratch313 + scratch320_7.0.2: + MAJOR_VERSION: 7 + VERSION: 7.0 + LONG_VERSION: 7.0.2 + VARIANT: scratch320 PARENT: scratch ISPARENT: True - vaapi2204_4.4.5: - MAJOR_VERSION: 4 - VERSION: 4.4 - LONG_VERSION: 4.4.5 - VARIANT: vaapi2204 + vaapi2404_7.0.2: + MAJOR_VERSION: 7 + VERSION: 7.0 + LONG_VERSION: 7.0.2 + VARIANT: vaapi2404 PARENT: vaapi ISPARENT: True - nvidia2204_4.4.5: - MAJOR_VERSION: 4 - VERSION: 4.4 - LONG_VERSION: 4.4.5 + nvidia2204_7.0.2: + MAJOR_VERSION: 7 + VERSION: 7.0 + LONG_VERSION: 7.0.2 VARIANT: nvidia2204 PARENT: nvidia ISPARENT: True - ubuntu2204_4.3.8: - MAJOR_VERSION: 4 - VERSION: 4.3 - LONG_VERSION: 4.3.8 - VARIANT: ubuntu2204 + ubuntu2404_6.1.2: + MAJOR_VERSION: 6 + VERSION: 6.1 + LONG_VERSION: 6.1.2 + VARIANT: ubuntu2404 PARENT: ubuntu ISPARENT: True - vaapi2204_4.3.8: - MAJOR_VERSION: 4 - VERSION: 4.3 - LONG_VERSION: 4.3.8 - VARIANT: vaapi2204 - PARENT: vaapi - ISPARENT: True - - - nvidia2204_4.3.8: - MAJOR_VERSION: 4 - VERSION: 4.3 - LONG_VERSION: 4.3.8 - VARIANT: nvidia2204 - PARENT: nvidia + ubuntu2404-edge_6.1.2: + MAJOR_VERSION: 6 + VERSION: 6.1 + LONG_VERSION: 6.1.2 + VARIANT: ubuntu2404-edge + PARENT: ubuntu-edge ISPARENT: True - ubuntu2204_4.2.10: - MAJOR_VERSION: 4 - VERSION: 4.2 - LONG_VERSION: 4.2.10 - VARIANT: ubuntu2204 - PARENT: ubuntu + alpine320_6.1.2: + MAJOR_VERSION: 6 + VERSION: 6.1 + LONG_VERSION: 6.1.2 + VARIANT: alpine320 + PARENT: alpine ISPARENT: True - scratch313_4.2.10: - MAJOR_VERSION: 4 - VERSION: 4.2 - LONG_VERSION: 4.2.10 - VARIANT: scratch313 + scratch320_6.1.2: + MAJOR_VERSION: 6 + VERSION: 6.1 + LONG_VERSION: 6.1.2 + VARIANT: scratch320 PARENT: scratch ISPARENT: True - vaapi2204_4.2.10: - MAJOR_VERSION: 4 - VERSION: 4.2 - LONG_VERSION: 4.2.10 - VARIANT: vaapi2204 + vaapi2404_6.1.2: + MAJOR_VERSION: 6 + VERSION: 6.1 + LONG_VERSION: 6.1.2 + VARIANT: vaapi2404 PARENT: vaapi ISPARENT: True - nvidia2204_4.2.10: - MAJOR_VERSION: 4 - VERSION: 4.2 - LONG_VERSION: 4.2.10 + nvidia2204_6.1.2: + MAJOR_VERSION: 6 + VERSION: 6.1 + LONG_VERSION: 6.1.2 VARIANT: nvidia2204 PARENT: nvidia ISPARENT: True - ubuntu2204_3.4.13: - MAJOR_VERSION: 3 - VERSION: 3.4 - LONG_VERSION: 3.4.13 - VARIANT: ubuntu2204 + ubuntu2404_5.1.6: + MAJOR_VERSION: 5 + VERSION: 5.1 + LONG_VERSION: 5.1.6 + VARIANT: ubuntu2404 PARENT: ubuntu ISPARENT: True - alpine313_3.4.13: - MAJOR_VERSION: 3 - VERSION: 3.4 - LONG_VERSION: 3.4.13 - VARIANT: alpine313 - PARENT: alpine - ISPARENT: True - - - scratch313_3.4.13: - MAJOR_VERSION: 3 - VERSION: 3.4 - LONG_VERSION: 3.4.13 - VARIANT: scratch313 - PARENT: scratch - ISPARENT: True - - - vaapi2204_3.4.13: - MAJOR_VERSION: 3 - VERSION: 3.4 - LONG_VERSION: 3.4.13 - VARIANT: vaapi2204 - PARENT: vaapi + ubuntu2404-edge_5.1.6: + MAJOR_VERSION: 5 + VERSION: 5.1 + LONG_VERSION: 5.1.6 + VARIANT: ubuntu2404-edge + PARENT: ubuntu-edge ISPARENT: True - nvidia2204_3.4.13: - MAJOR_VERSION: 3 - VERSION: 3.4 - LONG_VERSION: 3.4.13 - VARIANT: nvidia2204 - PARENT: nvidia + alpine320_5.1.6: + MAJOR_VERSION: 5 + VERSION: 5.1 + LONG_VERSION: 5.1.6 + VARIANT: alpine320 + PARENT: alpine ISPARENT: True - ubuntu2204_2.8.22: - MAJOR_VERSION: 2 - VERSION: 2.8 - LONG_VERSION: 2.8.22 - VARIANT: ubuntu2204 - PARENT: ubuntu + scratch320_5.1.6: + MAJOR_VERSION: 5 + VERSION: 5.1 + LONG_VERSION: 5.1.6 + VARIANT: scratch320 + PARENT: scratch ISPARENT: True - vaapi2204_2.8.22: - MAJOR_VERSION: 2 - VERSION: 2.8 - LONG_VERSION: 2.8.22 - VARIANT: vaapi2204 + vaapi2404_5.1.6: + MAJOR_VERSION: 5 + VERSION: 5.1 + LONG_VERSION: 5.1.6 + VARIANT: vaapi2404 PARENT: vaapi ISPARENT: True - nvidia2204_2.8.22: - MAJOR_VERSION: 2 - VERSION: 2.8 - LONG_VERSION: 2.8.22 + nvidia2204_5.1.6: + MAJOR_VERSION: 5 + VERSION: 5.1 + LONG_VERSION: 5.1.6 VARIANT: nvidia2204 PARENT: nvidia ISPARENT: True diff --git a/docker-images/gitlab-ci.yml b/docker-images/gitlab-ci.yml index 07ce64280..065b8a667 100644 --- a/docker-images/gitlab-ci.yml +++ b/docker-images/gitlab-ci.yml @@ -4,356 +4,269 @@ stages: - nvidia - scratch - ubuntu + - ubuntu-edge - vaapi -7.0.2-ubuntu2204: +7.1-ubuntu2404: extends: .docker stage: ubuntu variables: MAJOR_VERSION: 7 - VERSION: "7.0" - LONG_VERSION: "7.0.2" - VARIANT: ubuntu2204 + VERSION: "7.1" + LONG_VERSION: "7.1" + VARIANT: ubuntu2404 PARENT: "ubuntu" ISPARENT: "True" -7.0.2-alpine313: +7.1-ubuntu2404-edge: + extends: .docker + stage: ubuntu-edge + variables: + MAJOR_VERSION: 7 + VERSION: "7.1" + LONG_VERSION: "7.1" + VARIANT: ubuntu2404-edge + PARENT: "ubuntu-edge" + ISPARENT: "True" + +7.1-alpine320: extends: .docker stage: alpine variables: MAJOR_VERSION: 7 - VERSION: "7.0" - LONG_VERSION: "7.0.2" - VARIANT: alpine313 + VERSION: "7.1" + LONG_VERSION: "7.1" + VARIANT: alpine320 PARENT: "alpine" ISPARENT: "True" -7.0.2-scratch313: +7.1-scratch320: extends: .docker stage: scratch variables: MAJOR_VERSION: 7 - VERSION: "7.0" - LONG_VERSION: "7.0.2" - VARIANT: scratch313 + VERSION: "7.1" + LONG_VERSION: "7.1" + VARIANT: scratch320 PARENT: "scratch" ISPARENT: "True" -7.0.2-vaapi2204: +7.1-vaapi2404: extends: .docker stage: vaapi variables: MAJOR_VERSION: 7 - VERSION: "7.0" - LONG_VERSION: "7.0.2" - VARIANT: vaapi2204 + VERSION: "7.1" + LONG_VERSION: "7.1" + VARIANT: vaapi2404 PARENT: "vaapi" ISPARENT: "True" -7.0.2-nvidia2204: +7.1-nvidia2204: extends: .docker stage: nvidia variables: MAJOR_VERSION: 7 - VERSION: "7.0" - LONG_VERSION: "7.0.2" - VARIANT: nvidia2204 - PARENT: "nvidia" - ISPARENT: "True" - -6.1.2-ubuntu2204: - extends: .docker - stage: ubuntu - variables: - MAJOR_VERSION: 6 - VERSION: "6.1" - LONG_VERSION: "6.1.2" - VARIANT: ubuntu2204 - PARENT: "ubuntu" - ISPARENT: "True" - -6.1.2-vaapi2204: - extends: .docker - stage: vaapi - variables: - MAJOR_VERSION: 6 - VERSION: "6.1" - LONG_VERSION: "6.1.2" - VARIANT: vaapi2204 - PARENT: "vaapi" - ISPARENT: "True" - -6.1.2-nvidia2204: - extends: .docker - stage: nvidia - variables: - MAJOR_VERSION: 6 - VERSION: "6.1" - LONG_VERSION: "6.1.2" + VERSION: "7.1" + LONG_VERSION: "7.1" VARIANT: nvidia2204 PARENT: "nvidia" ISPARENT: "True" -5.1.6-ubuntu2204: +7.0.2-ubuntu2404: extends: .docker stage: ubuntu variables: - MAJOR_VERSION: 5 - VERSION: "5.1" - LONG_VERSION: "5.1.6" - VARIANT: ubuntu2204 + MAJOR_VERSION: 7 + VERSION: "7.0" + LONG_VERSION: "7.0.2" + VARIANT: ubuntu2404 PARENT: "ubuntu" ISPARENT: "True" -5.1.6-alpine313: - extends: .docker - stage: alpine - variables: - MAJOR_VERSION: 5 - VERSION: "5.1" - LONG_VERSION: "5.1.6" - VARIANT: alpine313 - PARENT: "alpine" - ISPARENT: "True" - -5.1.6-vaapi2204: +7.0.2-ubuntu2404-edge: extends: .docker - stage: vaapi + stage: ubuntu-edge variables: - MAJOR_VERSION: 5 - VERSION: "5.1" - LONG_VERSION: "5.1.6" - VARIANT: vaapi2204 - PARENT: "vaapi" - ISPARENT: "True" - -5.1.6-nvidia2204: - extends: .docker - stage: nvidia - variables: - MAJOR_VERSION: 5 - VERSION: "5.1" - LONG_VERSION: "5.1.6" - VARIANT: nvidia2204 - PARENT: "nvidia" - ISPARENT: "True" - -4.4.5-ubuntu2204: - extends: .docker - stage: ubuntu - variables: - MAJOR_VERSION: 4 - VERSION: "4.4" - LONG_VERSION: "4.4.5" - VARIANT: ubuntu2204 - PARENT: "ubuntu" + MAJOR_VERSION: 7 + VERSION: "7.0" + LONG_VERSION: "7.0.2" + VARIANT: ubuntu2404-edge + PARENT: "ubuntu-edge" ISPARENT: "True" -4.4.5-alpine313: +7.0.2-alpine320: extends: .docker stage: alpine variables: - MAJOR_VERSION: 4 - VERSION: "4.4" - LONG_VERSION: "4.4.5" - VARIANT: alpine313 + MAJOR_VERSION: 7 + VERSION: "7.0" + LONG_VERSION: "7.0.2" + VARIANT: alpine320 PARENT: "alpine" ISPARENT: "True" -4.4.5-scratch313: +7.0.2-scratch320: extends: .docker stage: scratch variables: - MAJOR_VERSION: 4 - VERSION: "4.4" - LONG_VERSION: "4.4.5" - VARIANT: scratch313 + MAJOR_VERSION: 7 + VERSION: "7.0" + LONG_VERSION: "7.0.2" + VARIANT: scratch320 PARENT: "scratch" ISPARENT: "True" -4.4.5-vaapi2204: +7.0.2-vaapi2404: extends: .docker stage: vaapi variables: - MAJOR_VERSION: 4 - VERSION: "4.4" - LONG_VERSION: "4.4.5" - VARIANT: vaapi2204 + MAJOR_VERSION: 7 + VERSION: "7.0" + LONG_VERSION: "7.0.2" + VARIANT: vaapi2404 PARENT: "vaapi" ISPARENT: "True" -4.4.5-nvidia2204: +7.0.2-nvidia2204: extends: .docker stage: nvidia variables: - MAJOR_VERSION: 4 - VERSION: "4.4" - LONG_VERSION: "4.4.5" + MAJOR_VERSION: 7 + VERSION: "7.0" + LONG_VERSION: "7.0.2" VARIANT: nvidia2204 PARENT: "nvidia" ISPARENT: "True" -4.3.8-ubuntu2204: +6.1.2-ubuntu2404: extends: .docker stage: ubuntu variables: - MAJOR_VERSION: 4 - VERSION: "4.3" - LONG_VERSION: "4.3.8" - VARIANT: ubuntu2204 + MAJOR_VERSION: 6 + VERSION: "6.1" + LONG_VERSION: "6.1.2" + VARIANT: ubuntu2404 PARENT: "ubuntu" ISPARENT: "True" -4.3.8-vaapi2204: +6.1.2-ubuntu2404-edge: extends: .docker - stage: vaapi - variables: - MAJOR_VERSION: 4 - VERSION: "4.3" - LONG_VERSION: "4.3.8" - VARIANT: vaapi2204 - PARENT: "vaapi" - ISPARENT: "True" - -4.3.8-nvidia2204: - extends: .docker - stage: nvidia + stage: ubuntu-edge variables: - MAJOR_VERSION: 4 - VERSION: "4.3" - LONG_VERSION: "4.3.8" - VARIANT: nvidia2204 - PARENT: "nvidia" + MAJOR_VERSION: 6 + VERSION: "6.1" + LONG_VERSION: "6.1.2" + VARIANT: ubuntu2404-edge + PARENT: "ubuntu-edge" ISPARENT: "True" -4.2.10-ubuntu2204: +6.1.2-alpine320: extends: .docker - stage: ubuntu + stage: alpine variables: - MAJOR_VERSION: 4 - VERSION: "4.2" - LONG_VERSION: "4.2.10" - VARIANT: ubuntu2204 - PARENT: "ubuntu" + MAJOR_VERSION: 6 + VERSION: "6.1" + LONG_VERSION: "6.1.2" + VARIANT: alpine320 + PARENT: "alpine" ISPARENT: "True" -4.2.10-scratch313: +6.1.2-scratch320: extends: .docker stage: scratch variables: - MAJOR_VERSION: 4 - VERSION: "4.2" - LONG_VERSION: "4.2.10" - VARIANT: scratch313 + MAJOR_VERSION: 6 + VERSION: "6.1" + LONG_VERSION: "6.1.2" + VARIANT: scratch320 PARENT: "scratch" ISPARENT: "True" -4.2.10-vaapi2204: +6.1.2-vaapi2404: extends: .docker stage: vaapi variables: - MAJOR_VERSION: 4 - VERSION: "4.2" - LONG_VERSION: "4.2.10" - VARIANT: vaapi2204 + MAJOR_VERSION: 6 + VERSION: "6.1" + LONG_VERSION: "6.1.2" + VARIANT: vaapi2404 PARENT: "vaapi" ISPARENT: "True" -4.2.10-nvidia2204: +6.1.2-nvidia2204: extends: .docker stage: nvidia variables: - MAJOR_VERSION: 4 - VERSION: "4.2" - LONG_VERSION: "4.2.10" + MAJOR_VERSION: 6 + VERSION: "6.1" + LONG_VERSION: "6.1.2" VARIANT: nvidia2204 PARENT: "nvidia" ISPARENT: "True" -3.4.13-ubuntu2204: +5.1.6-ubuntu2404: extends: .docker stage: ubuntu variables: - MAJOR_VERSION: 3 - VERSION: "3.4" - LONG_VERSION: "3.4.13" - VARIANT: ubuntu2204 + MAJOR_VERSION: 5 + VERSION: "5.1" + LONG_VERSION: "5.1.6" + VARIANT: ubuntu2404 PARENT: "ubuntu" ISPARENT: "True" -3.4.13-alpine313: - extends: .docker - stage: alpine - variables: - MAJOR_VERSION: 3 - VERSION: "3.4" - LONG_VERSION: "3.4.13" - VARIANT: alpine313 - PARENT: "alpine" - ISPARENT: "True" - -3.4.13-scratch313: - extends: .docker - stage: scratch - variables: - MAJOR_VERSION: 3 - VERSION: "3.4" - LONG_VERSION: "3.4.13" - VARIANT: scratch313 - PARENT: "scratch" - ISPARENT: "True" - -3.4.13-vaapi2204: +5.1.6-ubuntu2404-edge: extends: .docker - stage: vaapi + stage: ubuntu-edge variables: - MAJOR_VERSION: 3 - VERSION: "3.4" - LONG_VERSION: "3.4.13" - VARIANT: vaapi2204 - PARENT: "vaapi" + MAJOR_VERSION: 5 + VERSION: "5.1" + LONG_VERSION: "5.1.6" + VARIANT: ubuntu2404-edge + PARENT: "ubuntu-edge" ISPARENT: "True" -3.4.13-nvidia2204: +5.1.6-alpine320: extends: .docker - stage: nvidia + stage: alpine variables: - MAJOR_VERSION: 3 - VERSION: "3.4" - LONG_VERSION: "3.4.13" - VARIANT: nvidia2204 - PARENT: "nvidia" + MAJOR_VERSION: 5 + VERSION: "5.1" + LONG_VERSION: "5.1.6" + VARIANT: alpine320 + PARENT: "alpine" ISPARENT: "True" -2.8.22-ubuntu2204: +5.1.6-scratch320: extends: .docker - stage: ubuntu + stage: scratch variables: - MAJOR_VERSION: 2 - VERSION: "2.8" - LONG_VERSION: "2.8.22" - VARIANT: ubuntu2204 - PARENT: "ubuntu" + MAJOR_VERSION: 5 + VERSION: "5.1" + LONG_VERSION: "5.1.6" + VARIANT: scratch320 + PARENT: "scratch" ISPARENT: "True" -2.8.22-vaapi2204: +5.1.6-vaapi2404: extends: .docker stage: vaapi variables: - MAJOR_VERSION: 2 - VERSION: "2.8" - LONG_VERSION: "2.8.22" - VARIANT: vaapi2204 + MAJOR_VERSION: 5 + VERSION: "5.1" + LONG_VERSION: "5.1.6" + VARIANT: vaapi2404 PARENT: "vaapi" ISPARENT: "True" -2.8.22-nvidia2204: +5.1.6-nvidia2204: extends: .docker stage: nvidia variables: - MAJOR_VERSION: 2 - VERSION: "2.8" - LONG_VERSION: "2.8.22" + MAJOR_VERSION: 5 + VERSION: "5.1" + LONG_VERSION: "5.1.6" VARIANT: nvidia2204 PARENT: "nvidia" ISPARENT: "True" diff --git a/generate-list-of-recent-images.py b/generate-list-of-recent-images.py new file mode 100644 index 000000000..48e7f9ddd --- /dev/null +++ b/generate-list-of-recent-images.py @@ -0,0 +1,55 @@ +import requests +import json + +""" +To run this script you need the requests library. You can install it with pip: +in a venv as follows: + +$ python3 -mvenv .venv +$ source .venv/bin/activate +$ pip install requests +$ python3 ./generate-list-of-recent-images.py > list_of_recent_images.txt +$ deactivate +$ rm -rf .venv + +you will now have a file called list_of_recent_images.txt with the list of images +""" + +def make_api_request(page, page_size): + url = "https://registry.hub.docker.com/v2/repositories/jrottenberg/ffmpeg/tags" + params = {"page": page, "page_size": page_size} + response = requests.get(url, params=params) + return response.json() + +def process_data(data): + data = json.loads(data) + sorted_data = sorted(data, key=lambda x: x["name"], reverse=True) + for item in sorted_data: + if item["tag_status"].lower() == "active": + size_mb = round(item["full_size"] / 1048576) + name_padding = " " * (20 - len(item["name"])) + size_padding = " " * (8 - len(str(size_mb))) + last_updated = item["last_updated"][:10] + # print("-" * 50) + # print(json.dumps(item, indent=4)) + print(f"{item['name']}{name_padding}{size_mb}mb{size_padding}{last_updated}") + # print(f'{item["last_updater_username"]}') + +def main(): + page = 1 + page_size = 100 + data = [] + + while True: + response = make_api_request(page, page_size) + data.extend(response["results"]) + + if len(response["results"]) < page_size: + break + + page += 1 + + process_data(json.dumps(data)) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/templates/Dockerfile-env b/templates/Dockerfile-env-alpine similarity index 82% rename from templates/Dockerfile-env rename to templates/Dockerfile-env-alpine index 23c21971c..874deebae 100644 --- a/templates/Dockerfile-env +++ b/templates/Dockerfile-env-alpine @@ -13,27 +13,27 @@ FFMPEG_VERSION=%%FFMPEG_VERSION%% \ LIBXCB_VERSION=1.13.1 \ XCBPROTO_VERSION=1.13 \ OGG_VERSION=1.3.2 \ - OPENCOREAMR_VERSION=0.1.5 \ + OPENCOREAMR_VERSION=0.1.6 \ OPUS_VERSION=1.2 \ - OPENJPEG_VERSION=2.1.2 \ + OPENJPEG_VERSION=2.5.2 \ PYTHON=python3 \ 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 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ XAU_VERSION=1.0.9 \ XORG_MACROS_VERSION=1.19.2 \ XPROTO_VERSION=7.0.31 \ - XVID_VERSION=1.3.4 \ + XVID_VERSION=1.3.7 \ LIBXML2_VERSION=2.9.12 \ LIBBLURAY_VERSION=1.1.2 \ - LIBZMQ_VERSION=4.3.2 \ - LIBSRT_VERSION=1.4.1 \ + # LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ LIBARIBB24_VERSION=1.0.3 \ LIBPNG_VERSION=1.6.9 \ - LIBVMAF_VERSION=2.1.1 \ + LIBVMAF_VERSION=2.3.1 \ ZIMG_VERSION=3.0.5 \ SRC=/usr/local @@ -45,9 +45,7 @@ ARG OGG_SHA256SUM="e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd4101 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 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" diff --git a/templates/Dockerfile-env-alpine-scratch b/templates/Dockerfile-env-alpine-scratch new file mode 100644 index 000000000..9a10ad403 --- /dev/null +++ b/templates/Dockerfile-env-alpine-scratch @@ -0,0 +1,58 @@ +FFMPEG_VERSION=%%FFMPEG_VERSION%% \ + LIBVMAF_VERSION=2.3.1 \ + OPENCOREAMR_VERSION=0.1.6 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + OGG_VERSION=1.3.5 \ + OPUS_VERSION=1.3 \ + VORBIS_VERSION=1.3.7 \ + THEORA_VERSION=1.1.1 \ + VPX_VERSION=1.8.0 \ + WEBP_VERSION=1.4.0 \ + LAME_VERSION=3.100 \ + XVID_VERSION=1.3.7 \ + FDKAAC_VERSION=2.0.3 \ + OPENJPEG_VERSION=2.5.2 \ + FREETYPE_VERSION=2.13.3 \ + LIBVIDSTAB_VERSION=1.1.1 \ + FRIBIDI_VERSION=1.0.16 \ + FONTCONFIG_VERSION=2.15.0 \ + LIBASS_VERSION=0.17.3 \ + KVAZAAR_VERSION=2.3.1 \ + AOM_VERSION=v3.10.0 \ + XORG_MACROS_VERSION=1.20.1 \ + XPROTO_VERSION=7.0.31 \ + XAU_VERSION=1.0.11 \ + LIBPTHREAD_STUBS_VERSION=0.5 \ + LIBXML2_VERSION=2.13.4 \ + LIBBLURAY_VERSION=1.3.4 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBPNG_VERSION=1.6.44 \ + LIBARIBB24_VERSION=1.0.3 \ + ZIMG_VERSION=3.0.5 \ + SRC=/usr/local +# + # CHROMAPRINT_VERSION=1.5.0 \ + # LIBXCB_VERSION=1.13.1 \ + # XCBPROTO_VERSION=1.13 \ + # PYTHON=python3 \ + +ARG OGG_SHA256SUM="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.5.tar.gz" +ARG OPUS_SHA256SUM="4f3d69aefdf2dbaf9825408e452a8a414ffc60494c70633560700398820dc550 opus-1.3.tar.gz" +ARG VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG FREETYPE_SHA256SUM="5c3a8e78f7b24c20b25b54ee575d6daa40007a5f4eea2845861c3409b3021747 freetype-2.13.3.tar.gz" +# ARG FRIBIDI_SHA256SUM="3fc96fa9473bd31dcb5500bdf1aa78b337ba13eb8c301e7c28923fea982453a8 1.0.16.tar.gz" +# ARG LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +# ARG LIBASS_SHA256SUM="8fadf294bf701300d4605e6f1d92929304187fca4b8d8a47889315526adbafd7 0.13.7.tar.gz" +ARG LIBBLURAY_SHA512SUM="94dbf3b68d1c23fe4648c153cc2f0c251886fac0a6b6bbe3a77caabaa5322682f712afe4a7b6b16ca3f06744fbc0e1ca872209a32898dcf0ae182055d335aec1 libbluray-1.3.4.tar.bz2" +ARG LIBZMQ_SHA256SUM="ae933b1e98411fd7cb8309f9502d2737 zeromq-4.3.5.tar.gz" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + + + +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" diff --git a/templates/Dockerfile-env-ubuntu b/templates/Dockerfile-env-ubuntu new file mode 100644 index 000000000..894a277c1 --- /dev/null +++ b/templates/Dockerfile-env-ubuntu @@ -0,0 +1,96 @@ +FFMPEG_VERSION=%%FFMPEG_VERSION%% \ + KVAZAAR_VERSION=2.3.1 \ + LIBVMAF_VERSION=3.0.0 + +## opencore-amr - https://sourceforge.net/projects/opencore-amr/ +## x264 - http://www.videolan.org/developers/x264.html +## x265 - http://x265.org/ ( videolan ) +## libogg - https://www.xiph.org/ogg/ ( xiph ) +## libopus - https://www.opus-codec.org/ ( xiph ) +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +## libvorbis - https://xiph.org/vorbis/ ( xiph ) +## libvpx - https://www.webmproject.org/code/ +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +## libwebp - https://developers.google.com/speed/webp/ +## libmp3lame - http://lame.sourceforge.net/ +## xvid - https://www.xvid.com/ (xvidcore) +## fdk-aac - https://github.com/mstorsjo/fdk-aac +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +## openjpeg - https://github.com/uclouvain/openjpeg +## freetype - https://www.freetype.org/ +## consider passing --no-install-recommends for this one its globbie (if you do, pass in libfreetype6) +## libvidstab - https://github.com/georgmartius/vid.stab +## fridibi - https://www.fribidi.org/ +## fontconfig - https://www.freedesktop.org/wiki/Software/fontconfig/ +## libass - https://github.com/libass/libass +## lib aom - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +## libsvtav1 - https://gitlab.com/AOMediaCodec/SVT-AV1.git +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +## libdav1d - https://code.videolan.org/videolan/dav1d +## - https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## util-macros - (x.org) (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## xproto - (x.org) +## libXau - +## libpthread - libpthread-stubs +## libxml2 - for libbluray +## libbluray - Requires libxml, freetype, and fontconfig +## libzmq - https://github.com/zeromq/libzmq/ +## this one pulls in a bunch of dependencies +## libpng - this one also pulls in a bunch of stuff +## libaribb24 - +## zimg - https://github.com/sekrit-twc/zimg +## libtheora - http://www.theora.org/ ( xiph ) +## - https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +## libsrt - https://github.com/Haivision/srt +## Secure Reliable Transport UDP streaming library +## multiple flavors (OpenSSL flavour) and ( GnuTLS flavour) +ARG OPENCORE_PKGS="libopencore-amrnb-dev libopencore-amrnb0 libopencore-amrwb-dev libopencore-amrwb0" +ARG X264_PKGS="libx264-164 libx264-dev" +ARG X265_PKGS="libnuma1 libx265-199 libx265-dev" +# libnuma-dev +ARG OGG_PKGS="libogg-dev libogg0" +ARG OPUS_PKGS="libopus-dev libopus0" +ARG VORBIS_PKGS="libvorbis-dev libvorbis0a libvorbisenc2 libvorbisfile3" +ARG VPX_PKGS="libvpx-dev libvpx9" +ARG WEBP_PKGS="libsharpyuv-dev libsharpyuv0 libwebp-dev libwebp7 libwebpdecoder3 libwebpdemux2 libwebpmux3" +ARG MP3LAME_PKGS="libmp3lame-dev libmp3lame0" +ARG XVIDCORE_PKGS="libxvidcore-dev libxvidcore4" +ARG FDKAAC_PKGS="libfdk-aac-dev libfdk-aac2" +ARG OPENJP_PKGS="libopenjp2-7 libopenjp2-7-dev" +# bzip2-doc fontconfig-config fonts-dejavu-core fonts-dejavu-mono libaom3 libbrotli-dev +# libbrotli1 libbsd0 libbz2-dev libc-dev-bin libc-devtools libc6-dev libcrypt-dev libde265-0 +# libdeflate0 libfontconfig1 libfreetype6 libgd3 libheif-plugin-aomdec +# libheif-plugin-aomenc libheif-plugin-libde265 libheif1 libjbig0 libjpeg-turbo8 +# libjpeg8 liblerc4 libpng-dev libpng-tools libpng16-16t64 libsharpyuv0 libtiff6 +# libwebp7 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev +# manpages manpages-dev rpcsvc-proto zlib1g-dev +ARG FREETYPE_PKGS="libfreetype6-dev" +ARG FONTCONFIG_PKGS="libfontconfig-dev libfontconfig1 fontconfig-config fontconfig-config fonts-dejavu-core fonts-dejavu-mono" +ARG VIDSTAB_PKGS="libvidstab-dev libvidstab1.1" +ARG FRIBIDI_PKGS="libfribidi-dev libfribidi0" +# libass-dev wanted to install a boat-load of packages +ARG LIBASS_PKGS="libass-dev libass9" +ARG AOM_PKGS="libaom-dev libaom3" +ARG SVTAV1_PKGS="libsvtav1-dev libsvtav1enc-dev libsvtav1enc1d1 libsvtav1dec-dev libsvtav1dec0" +ARG DAV1D_PKGS="libdav1d-dev libdav1d7" +# LIBDRM_PKGS picks ups some of the XORG_MACROS_PKGS as well +ARG XORG_MACROS_PKGS="libxcb-shm0-dev libxcb-shm0 libxcb-xfixes0 libxcb-xfixes0-dev" +ARG XPROTO_PKGS="x11proto-core-dev x11proto-dev" +ARG XAU_PKGS="libxau-dev libxau6" +ARG PTHREADS_STUBS_PKGS="libpthread-stubs0-dev" +ARG XML2_PKGS="libxml2-dev libxml2" +ARG BLURAY_PKGS="libbluray-dev libbluray2" +ARG ZMQ_PKGS="libzmq3-dev libzmq5" +# libpng-tools +ARG PNG_PKGS="libpng-dev libpng16-16t64" +ARG ARIBB24_PKGS="libaribb24-dev" +ARG ZIMG_PKGS="libzimg-dev libzimg2" +ARG THEORA_PKGS="libtheora-dev libtheora0" +ARG SRT_PKGS="libssl-dev libsrt-openssl-dev libsrt1.5-openssl" +ARG LIBDRM_PKGS="libbsd0 libdrm-dev libdrm2 libxcb1-dev libxcb1" + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" + +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" diff --git a/templates/Dockerfile-env-ubuntu-edge b/templates/Dockerfile-env-ubuntu-edge new file mode 100644 index 000000000..ffbceffdc --- /dev/null +++ b/templates/Dockerfile-env-ubuntu-edge @@ -0,0 +1,56 @@ +FFMPEG_VERSION=%%FFMPEG_VERSION%% \ + AOM_VERSION=v3.10.0 \ + SVTAV1_VERSION=2.2.1 \ + CHROMAPRINT_VERSION=1.5.0 \ + FDKAAC_VERSION=2.0.3 \ + 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.5 \ + OPENCOREAMR_VERSION=0.1.6 \ + OPUS_VERSION=1.5.2 \ + OPENJPEG_VERSION=2.5.2 \ + PYTHON=python3 \ + THEORA_VERSION=1.1.1 \ + VORBIS_VERSION=1.3.7 \ + VPX_VERSION=1.14.1 \ + WEBP_VERSION=1.4.0 \ + X264_VERSION=20191217-2245-stable \ + X265_VERSION=4.0 \ + XAU_VERSION=1.0.9 \ + XORG_MACROS_VERSION=1.19.2 \ + XPROTO_VERSION=7.0.31 \ + XVID_VERSION=1.3.7 \ + LIBXML2_VERSION=2.9.12 \ + LIBBLURAY_VERSION=1.1.2 \ + LIBZMQ_VERSION=4.3.5 \ + LIBSRT_VERSION=1.5.3 \ + LIBARIBB24_VERSION=1.0.3 \ + LIBPNG_VERSION=1.6.9 \ + LIBVMAF_VERSION=3.0.0 \ + ZIMG_VERSION=3.0.5 \ + 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="0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 libogg-1.3.4.tar.gz" +ARG OPUS_SHA256SUM="65c1d2f78b9f2fb20082c38cbe47c951ad5839345876e46941612ee87f9a7ce1 opus-1.5.2.tar.gz" +ARG THEORA_SHA256SUM="40952956c47811928d1e7922cda3bc1f427eb75680c3c37249c91e949054916b libtheora-1.1.1.tar.gz" +ARG VORBIS_SHA256SUM="0e982409a9c3fc82ee06e08205b1355e5c6aa4c36bca58146ef399621b0ce5ab libvorbis-1.3.7.tar.gz" +ARG LIBBLURAY_SHA256SUM="a3dd452239b100dc9da0d01b30e1692693e2a332a7d29917bf84bb10ea7c0b42 libbluray-1.1.2.tar.bz2" +ARG LIBARIBB24_SHA256SUM="f61560738926e57f9173510389634d8c06cabedfa857db4b28fb7704707ff128 v1.0.3.tar.gz" + + +ARG MAKEFLAGS="-j2" +ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" +ARG PREFIX="/opt/ffmpeg" +ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" diff --git a/templates/Dockerfile-run-alpine b/templates/Dockerfile-run-alpine new file mode 100644 index 000000000..0e5f1136d --- /dev/null +++ b/templates/Dockerfile-run-alpine @@ -0,0 +1,99 @@ +## 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 + +## 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} + +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? +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} + + +## 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} + +## 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} + +## Download 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 && \ + ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ + make ; make install + + + + + +# ## Build ffmpeg https://ffmpeg.org/ +RUN \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + ./configure \ + %%FFMPEG_CONFIG_FLAGS%% && \ + make clean && \ + 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/ diff --git a/templates/Dockerfile-run b/templates/Dockerfile-run-alpine-scratch similarity index 87% rename from templates/Dockerfile-run rename to templates/Dockerfile-run-alpine-scratch index 73abe7302..7e43d298e 100644 --- a/templates/Dockerfile-run +++ b/templates/Dockerfile-run-alpine-scratch @@ -45,9 +45,9 @@ RUN \ DIR=/tmp/x265 && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/videolan/x265/archive/refs/tags/${X265_VERSION}.tar.gz | \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${X265_VERSION}.tar.gz | \ tar -zx && \ - cd x265-${X265_VERSION}/build/linux && \ + 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 && \ @@ -91,6 +91,7 @@ RUN \ make install && \ rm -rf ${DIR} ### libtheora http://www.theora.org/ +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure RUN \ DIR=/tmp/theora && \ mkdir -p ${DIR} && \ @@ -98,7 +99,7 @@ RUN \ 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 && \ + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --build="aarch64-unknown-linux-gnu" --enable-shared && \ make && \ make install && \ rm -rf ${DIR} @@ -116,7 +117,7 @@ RUN \ rm -rf ${DIR} ### libwebp https://developers.google.com/speed/webp/ RUN \ - DIR=/tmp/vebp && \ + DIR=/tmp/webp && \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${WEBP_VERSION}.tar.gz | \ @@ -141,8 +142,7 @@ 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 && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ tar -zx -f xvidcore-${XVID_VERSION}.tar.gz && \ cd xvidcore/build/generic && \ ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" && \ @@ -166,9 +166,10 @@ RUN \ DIR=/tmp/openjpeg && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sL https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz | \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ tar -zx --strip-components=1 && \ - cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ make install && \ rm -rf ${DIR} @@ -190,7 +191,7 @@ RUN \ mkdir -p ${DIR} && \ cd ${DIR} && \ curl -sLO https://github.com/georgmartius/vid.stab/archive/v${LIBVIDSTAB_VERSION}.tar.gz && \ - echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ + # echo ${LIBVIDSTAB_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f v${LIBVIDSTAB_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -201,9 +202,9 @@ 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 && \ + curl -sLO https://github.com/fribidi/fribidi/archive/refs/tags/v${FRIBIDI_VERSION}.tar.gz && \ + # echo ${FRIBIDI_SHA256SUM} | sha256sum --check && \ + tar -zx --strip-components=1 -f fribidi-${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 && \ @@ -215,19 +216,19 @@ 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 && \ + curl -sLO https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz && \ + tar -zx --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 +## libass v 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 && \ + # echo ${LIBASS_SHA256SUM} | sha256sum --check && \ tar -zx --strip-components=1 -f ${LIBASS_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -239,7 +240,7 @@ RUN \ DIR=/tmp/kvazaar && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/ultravideo/kvazaar/archive/v${KVAZAAR_VERSION}.tar.gz && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v2.3.1/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f v${KVAZAAR_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ @@ -260,12 +261,13 @@ RUN \ rm -rf ${DIR} ## libxcb (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +## util-macros 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 && \ + curl -sLO https://www.x.org/archive//individual/util/util-macros-${XORG_MACROS_VERSION}.tar.xz && \ + tar -Jx --strip-components=1 -f util-macros-${XORG_MACROS_VERSION}.tar.gz && \ ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ make && \ make install && \ @@ -293,6 +295,7 @@ RUN \ make install && \ rm -rf ${DIR} +# libevent && libevent-dev has usr/lib/libevent_pthreads ??? RUN \ DIR=/tmp/libpthread-stubs && \ mkdir -p ${DIR} && \ @@ -323,21 +326,22 @@ RUN \ 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 && \ + echo ${LIBBLURAY_SHA512SUM} | sha512sum --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} +# Update Use the zeromq zeromq-dev packages from the alpine repository ## 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 && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + echo ${LIBZMQ_SHA256SUM} | sha512sum --check && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ ./autogen.sh && \ ./configure --prefix="${PREFIX}" && \ make && \ @@ -350,7 +354,7 @@ RUN \ DIR=/tmp/srt && \ mkdir -p ${DIR} && \ cd ${DIR} && \ - curl -sLO https://github.com/Haivision/srt/archive/v${LIBSRT_VERSION}.tar.gz && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/v${LIBSRT_VERSION}.tar.gz && \ tar -xz --strip-components=1 -f v${LIBSRT_VERSION}.tar.gz && \ cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ make && \ @@ -408,7 +412,7 @@ RUN \ -## Build ffmpeg https://ffmpeg.org/ +# ## Build ffmpeg https://ffmpeg.org/ RUN \ DIR=/tmp/ffmpeg && cd ${DIR} && \ ./configure \ diff --git a/templates/Dockerfile-run-ubuntu b/templates/Dockerfile-run-ubuntu new file mode 100644 index 000000000..ca557d98f --- /dev/null +++ b/templates/Dockerfile-run-ubuntu @@ -0,0 +1,97 @@ +RUN \ + echo "Installing dependencies..." && \ + apt-get install -yq --no-install-recommends ${OPENCORE_PKGS} ${X264_PKGS} ${X265_PKGS} ${OGG_PKGS} ${OPUS_PKGS} ${VORBIS_PKGS} ${VPX_PKGS} ${WEBP_PKGS} ${MP3LAME_PKGS} ${XVIDCORE_PKGS} ${FDKAAC_PKGS} ${OPENJP_PKGS} ${FREETYPE_PKGS} ${VIDSTAB_PKGS} ${FRIBIDI_PKGS} ${FONTCONFIG_PKGS} ${LIBASS_PKGS} ${AOM_PKGS} ${SVTAV1_PKGS} ${DAV1D_PKGS} ${XORG_MACROS_PKGS} ${XPROTO_PKGS} ${XAU_PKGS} ${PTHREADS_STUBS_PKGS} ${XML2_PKGS} ${BLURAY_PKGS} ${ZMQ_PKGS} ${PNG_PKGS} ${ARIBB24_PKGS} ${ZIMG_PKGS} ${THEORA_PKGS} ${SRT_PKGS} ${LIBDRM_PKGS} + + # apt install libdrm-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + +#### Do we really need to build ffmpeg twice? seems silly + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# Here is a list of things that we enable in the ffmpeg build: that are not in the +# track configuration guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg +# --enable-fontconfig +# --enable-libaribb24 +# --enable-libbluray +# --enable-libkvazaar +# --enable-libopencore-amrnb +# --enable-libopencore-amrwb +# --enable-libopenjpeg +# --enable-libsrt +# --enable-libtheora +# --enable-libvmaf +# --enable-libwebp +# --enable-libxvid +# --enable-libzimg +# --enable-libzmq +# --enable-openssl +# --enable-postproc +# --enable-small +# --enable-version3 +RUN \ + echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + %%FFMPEG_CONFIG_FLAGS%% && \ + 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/ + diff --git a/templates/Dockerfile-run-ubuntu-edge b/templates/Dockerfile-run-ubuntu-edge new file mode 100644 index 000000000..56e869ad3 --- /dev/null +++ b/templates/Dockerfile-run-ubuntu-edge @@ -0,0 +1,543 @@ +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +# opencore-amr: from source +RUN \ + echo "Building opencore-amr-${OPENCOREAMR_VERSION}" && \ + DIR=/tmp/opencore-amr && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-${OPENCOREAMR_VERSION}.tar.gz/download | \ + 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 \ + echo "Building x264-snapshot-${X264_VERSION}" && \ + 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/ ( videolan ) +RUN \ + echo "Building x265_${X265_VERSION}" && \ + DIR=/tmp/x265 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL http://ftp.videolan.org/pub/videolan/x265/x265_${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/ ( xiph ) +RUN \ + echo "Building libogg-${OGG_VERSION}" && \ + DIR=/tmp/ogg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://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/ ( xiph ) +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +# apt libopus-dev +RUN \ + echo "Building opus-${OPUS_VERSION}" && \ + DIR=/tmp/opus && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/xiph/opus/releases/download/v${OPUS_VERSION}/opus-${OPUS_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + # echo ${OPUS_SHA256SUM} | sha256sum --check && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + # ./configure --prefix="$HOME/ffmpeg_build" --disable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +### libvorbis https://xiph.org/vorbis/ ( xiph ) +RUN \ + echo "Building libvorbis-${VORBIS_VERSION}" && \ + 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} + +### libvpx https://www.webmproject.org/code/ +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +### configure w/ --as=yasm ?? +### double check that this came from the correct place. +RUN \ + echo "Building libvpx-${VPX_VERSION}" && \ + DIR=/tmp/vpx && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://chromium.googlesource.com/webm/libvpx.git/+archive/v${VPX_VERSION}.tar.gz | \ + tar -zxm && \ + ./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 \ + echo "Building libwebp-${WEBP_VERSION}" && \ + DIR=/tmp/webp && \ + 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 \ + echo "Building lame-${LAME_VERSION}" && \ + DIR=/tmp/lame && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://sourceforge.net/projects/lame/files/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz/download | \ + tar -zx --strip-components=1 && \ + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + make && \ + make install && \ + rm -rf ${DIR} + +### xvid (xvidcore) https://www.xvid.com/ +RUN \ + echo "Building xvidcore-${XVID_VERSION}" && \ + DIR=/tmp/xvid && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://downloads.xvid.com/downloads/xvidcore-${XVID_VERSION}.tar.gz && \ + 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 +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +# might not need --datadir anymore +RUN \ + echo "Building fdk-aac-${FDKAAC_VERSION}" && \ + DIR=/tmp/fdk-aac && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/mstorsjo/fdk-aac/archive/refs/tags/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 \ + echo "Building openjpeg-${OPENJPEG_VERSION}" && \ + DIR=/tmp/openjpeg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/uclouvain/openjpeg/archive/refs/tags/v${OPENJPEG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + # cmake -DBUILD_THIRDPARTY:BOOL=ON -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" . && \ + make && \ + make install && \ + rm -rf ${DIR} + +## freetype https://www.freetype.org/ +# make sure to pass in --no-install-recommends for this one its globbie +RUN \ + echo "Building freetype-${FREETYPE_VERSION}" && \ + 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} + +## libvidstab https://github.com/georgmartius/vid.stab +RUN \ + echo "Building libvidstab-${LIBVIDSTAB_VERSION}" && \ + 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 \ + echo "Building fribidi-${FRIBIDI_VERSION}" && \ + 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 \ + echo "Building fontconfig-${FONTCONFIG_VERSION}" && \ + 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 \ + echo "Building libass-${LIBASS_VERSION}" && \ + 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 \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + 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} +# lib aom +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +RUN \ + echo "Building aom-${AOM_VERSION}" && \ + DIR=/tmp/aom && \ + git clone --branch ${AOM_VERSION} --depth 1 https://aomedia.googlesource.com/aom ${DIR} ; \ + cd ${DIR} ; \ + mkdir -p ./aom_build ; \ + cd ./aom_build ; \ + # cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ..; \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libsvtav1 https://gitlab.com/AOMediaCodec/SVT-AV1.git +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +# RUN \ +# echo "Installing dependencies libpng" && \ +# apt-get install -yq libsvtav1enc-dev + +RUN \ + echo "Building SVT-AV1 v${SVTAV1_VERSION}" && \ + DIR=/tmp/libsvtav1 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v${SVTAV1_VERSION}/SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f SVT-AV1-v${SVTAV1_VERSION}.tar.gz && \ + cd Build && \ + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DCMAKE_BUILD_TYPE=Release -DBUILD_DEC=OFF -DBUILD_SHARED_LIBS=OFF ..; \ + make ; \ + make install ; \ + rm -rf ${DIR} + +## libdav1d https://code.videolan.org/videolan/dav1d +## https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## installed w/ apt-get in the build stage +RUN \ + echo "installing libdav1d-dev with debian packages" && \ + apt-get install -yq libdav1d-dev + +## x.org: util-macros (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + echo "Building x.org: util-macros-${XORG_MACROS_VERSION}" && \ + 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} + +## x.org: xproto +RUN \ + echo "Building x.org: xproto-${XPROTO_VERSION}" && \ + 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 && \ + cp /usr/share/misc/config.guess . && \ + ./configure --srcdir=${DIR} --prefix="${PREFIX}" && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libXau +RUN \ + echo "Building x.org: libXau-${XAU_VERSION}" && \ + 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} + +## libpthread-stubs +RUN \ + echo "Building libpthread-stubs-${LIBPTHREAD_STUBS_VERSION}" && \ + 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} + + +## libxml2 - for libbluray +RUN \ + echo "Building libxml2-${LIBXML2_VERSION}" && \ + DIR=/tmp/libxml2 && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/GNOME/libxml2/archive/refs/tags/v${LIBXML2_VERSION}.tar.gz | \ + tar -xz --strip-components=1 && \ + ./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 \ + echo "Building libbluray-${LIBBLURAY_VERSION}" && \ + 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/ +# this one pulls in a bunch of dependencies +RUN \ + echo "Building libzmq-${LIBZMQ_VERSION}" && \ + DIR=/tmp/libzmq && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/zeromq/libzmq/releases/download/v${LIBZMQ_VERSION}/zeromq-${LIBZMQ_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f zeromq-${LIBZMQ_VERSION}.tar.gz && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" && \ + make && \ + make check && \ + make install && \ + rm -rf ${DIR} + + +## libpng +# also pulls in a bunch of stuff +RUN \ + echo "Building libpng-${LIBPNG_VERSION}" && \ + 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 \ + echo "Building libaribb24-${LIBARIBB24_VERSION}" && \ + 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} + +# zimg https://github.com/sekrit-twc/zimg +RUN \ + echo "Building zimg-${ZIMG_VERSION}" && \ + DIR=/tmp/zimg && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sL https://github.com/sekrit-twc/zimg/archive/refs/tags/release-${ZIMG_VERSION}.tar.gz | \ + tar -zx --strip-components=1 && \ + ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +### libtheora http://www.theora.org/ ( xiph ) +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +RUN \ + echo "Building libtheora-${THEORA_VERSION}" && \ + 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 && \ + # add sym link for sdl-config + # ln -s /usr/bin/sdl2-config /usr/bin/sdl-config && \ + # currently build does not find sdl-config, and thus no playback support is enabled (probably exacly, the way it was before) + # Note: consider installing doxygen so that the api documentation is built + # right now, I did not, so we can keep everything small. + # disable examples to advoid the libjpeg sizeof error still in the example code. + ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libsrt https://github.com/Haivision/srt +# RUN \ +# echo "installing libsrt-dev with debian package: Secure Reliable Transport UDP streaming library (OpenSSL flavour)" && \ +# apt-get install -yq libsrt1.5-openssl +# libsrt-openssl-dev +RUN \ + echo "Adding libssl-dev for libsrt build" && \ + apt-get install -yq --no-install-recommends libssl-dev + # Note: we can get the config error + # GnuTLS('libgnutls28-dev') and OpenSSL('libssl-dev') must not be enabled at the same time, + # from a previous build + # so we add libssl-dev and later in the build + + ## libsrt https://github.com/Haivision/srt +RUN \ + echo "Building libsrt-${LIBSRT_VERSION}" && \ + DIR=/tmp/srt && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Haivision/srt/archive/refs/tags/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} + + + +## libvmaf https://github.com/Netflix/vmaf +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial) ffmpeg-${FFMPEG_VERSION}" && \ + 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 +# ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ +# make ; make install + + + +## Build ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (final) ffmpeg-${FFMPEG_VERSION}" && \ + DIR=/tmp/ffmpeg && cd ${DIR} && \ + export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ + ./configure \ + %%FFMPEG_CONFIG_FLAGS%% && \ + 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/ diff --git a/templates/Dockerfile-run-ubuntu.backup b/templates/Dockerfile-run-ubuntu.backup new file mode 100644 index 000000000..c5bbcfb74 --- /dev/null +++ b/templates/Dockerfile-run-ubuntu.backup @@ -0,0 +1,272 @@ +## opencore-amr https://sourceforge.net/projects/opencore-amr/ +# opencore-amr: from packages +RUN \ + echo "installing opencore-amr with debian packages" && \ + apt-get install -yq libopencore-amrnb-dev libopencore-amrwb-dev + +# ## x264 http://www.videolan.org/developers/x264.html +RUN \ + echo "installing x264 with debian packages" && \ + apt-get install -yq libx264-dev + +### x265 http://x265.org/ ( videolan ) +RUN \ + echo "installing x265 with debian packages" && \ + apt-get install -yq libx265-dev libnuma-dev + +### libogg https://www.xiph.org/ogg/ ( xiph ) +RUN \ + echo "installing libogg with debian packages" && \ + apt-get install -yq libogg-dev + +### libopus https://www.opus-codec.org/ ( xiph ) +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libopus +RUN \ + echo "installing libopus with debian packages" && \ + apt-get install -yq libopus-dev + +### libvorbis https://xiph.org/vorbis/ ( xiph ) +RUN \ + echo "installing libvorbis with debian packages" && \ + apt-get install -yq libvorbis-dev + +### libvpx https://www.webmproject.org/code/ +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libvpx +RUN \ + echo "installing libvpx-dev with debian packages" && \ + apt-get install -yq libvpx-dev + # dpkg -s libvpx-dev | grep -o '^Version:' | cut -d ' ' -f 2 + + +### libwebp https://developers.google.com/speed/webp/ +RUN \ + echo "installing libwebp with debian packages" && \ + apt-get install -yq libwebp-dev + +### libmp3lame http://lame.sourceforge.net/ +RUN \ + echo "installing libmp3lame with debian packages" && \ + apt-get install -yq libmp3lame-dev + +### xvid (xvidcore) https://www.xvid.com/ +RUN \ + echo "installing xvidcore with debian packages" && \ + apt-get install -yq libxvidcore-dev + +### fdk-aac https://github.com/mstorsjo/fdk-aac +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libfdk-aac +RUN \ + echo "installing libfdk-aac-dev with debian packages" && \ + apt-get install -yq libfdk-aac-dev + +## openjpeg https://github.com/uclouvain/openjpeg +RUN \ + echo "installing libopenjp2-7-dev with debian packages" && \ + apt-get install -yq libopenjp2-7-dev + +## freetype https://www.freetype.org/ +# make sure to pass in --no-install-recommends for this one its globbie +RUN \ + echo "installing libfreetype6-dev with debian packages" && \ + apt-get install -yq --no-install-recommends libfreetype6-dev libfreetype6 + +## libvidstab https://github.com/georgmartius/vid.stab +RUN \ + echo "installing libvidstab-dev with debian packages" && \ + apt-get install -yq libvidstab-dev + +## fridibi https://www.fribidi.org/ +RUN \ + echo "installing libfribidi-dev with debian packages" && \ + apt-get install -yq libfribidi-dev + +## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ +RUN \ + echo "installing libfontconfig-dev with debian packages" && \ + apt-get install -yq --no-install-recommends libfontconfig-dev fontconfig-config + +## libass https://github.com/libass/libass +RUN \ + echo "installing libass-dev with debian packages" && \ + apt-get install -yq libass-dev + +# lib aom +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libaom +RUN \ + echo "installing libaom-dev with debian packages" && \ + apt-get install -yq libaom-dev + +## libsvtav1 https://gitlab.com/AOMediaCodec/SVT-AV1.git +# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libsvtav1 +RUN \ + echo "installing libsvtav1-dev with debian packages" && \ + apt-get install -yq libsvtav1-dev libsvtav1enc-dev libsvtav1dec-dev + +## libdav1d https://code.videolan.org/videolan/dav1d +## https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#libdav1d +## installed w/ apt-get in the build stage +RUN \ + echo "installing libdav1d-dev with debian packages" && \ + apt-get install -yq libdav1d-dev + +## x.org: util-macros (and supporting libraries) for screen capture https://xcb.freedesktop.org/ +RUN \ + echo "installing libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev with debian packages" && \ + apt-get install -yq libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev + +## x.org: xproto +RUN \ + echo "installing x11proto-core-dev with debian packages" && \ + apt-get install -yq x11proto-core-dev + +## libXau +RUN \ + echo "installing libxau-dev with debian packages" && \ + apt-get install -yq libxau-dev + +## libpthread-stubs +RUN \ + echo "installing libpthread-stubs0-dev with debian packages" && \ + apt-get install -yq libpthread-stubs0-dev + +## libxml2 - for libbluray +RUN \ + echo "installing libxml2-dev with debian packages" && \ + apt-get install -yq libxml2-dev + +## libbluray - Requires libxml, freetype, and fontconfig +RUN \ + echo "installing libbluray-dev with debian packages" && \ + apt-get install -yq libbluray-dev + +## libzmq https://github.com/zeromq/libzmq/ +# this one pulls in a bunch of dependencies +RUN \ + echo "installing libzmq3-dev with debian packages" && \ + apt-get install -yq libzmq3-dev + + +## libpng +# also pulls in a bunch of stuff +RUN \ + echo "installing libpng-dev with debian packages" && \ + apt-get install -yq libpng-dev + +## libaribb24 +RUN \ + echo "installing libaribb24-dev with debian packages" && \ + apt-get install -yq libaribb24-dev + +# zimg https://github.com/sekrit-twc/zimg +RUN \ + echo "installing zimg-dev with debian packages" && \ + apt-get install -yq libzimg-dev + +### libtheora http://www.theora.org/ ( xiph ) +# https://stackoverflow.com/questions/4810996/how-to-resolve-configure-guessing-build-type-failure +RUN \ + echo "installing libtheora-dev with debian packages" && \ + apt-get install -yq libtheora-dev + +## libsrt https://github.com/Haivision/srt +RUN \ + echo "installing libsrt-dev with debian package: Secure Reliable Transport UDP streaming library (OpenSSL flavour)" && \ + apt-get install -yq libsrt-openssl-dev + +## kvazaar https://github.com/ultravideo/kvazaar +RUN \ + echo "Building kvazaar-${KVAZAAR_VERSION}" && \ + DIR=/tmp/kvazaar && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/ultravideo/kvazaar/releases/download/v${KVAZAAR_VERSION}/kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + tar -zx --strip-components=1 -f kvazaar-${KVAZAAR_VERSION}.tar.gz && \ + # ./autogen.sh && \ + ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ + make && \ + make install && \ + rm -rf ${DIR} + +## libvmaf https://github.com/Netflix/vmaf +RUN \ + echo "Adding g++ for VMAF build" && \ + apt-get install -yq g++ + +# https://github.com/Netflix/vmaf/issues/788 +RUN \ + if which meson || false; then \ + echo "Building VMAF v${LIBVMAF_VERSION}" && \ + DIR=/tmp/vmaf && \ + mkdir -p ${DIR} && \ + cd ${DIR} && \ + curl -sLO https://github.com/Netflix/vmaf/archive/refs/tags/v${LIBVMAF_VERSION}.tar.gz && \ + tar -xz --strip-components=1 -f v${LIBVMAF_VERSION}.tar.gz && \ + ls -al && \ + mkdir ./libvmaf/build && \ + cd ./libvmaf/build && \ + meson setup -Denable_tests=false -Denable_docs=false --buildtype=release --default-library=static .. --prefix "${PREFIX}" && \ + ninja && \ + ninja install && \ + # 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 + + +## Download ffmpeg https://ffmpeg.org/ +RUN \ + echo "Building (intial configure) ffmpeg-${FFMPEG_VERSION}" && \ + 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 && \ + ./configure --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-gpl --extra-libs=-ldl && \ + make ; make install + + + +# ## Build ffmpeg https://ffmpeg.org/ +# RUN \ +# echo "Building (final detailed configure) ffmpeg-${FFMPEG_VERSION}" && \ +# echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" && \ +# dpkg -l |grep srt && \ +# DIR=/tmp/ffmpeg && cd ${DIR} && \ +# # 0.095 PKG_CONFIG_PATH=/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig +# # 0.131 ii libsrt-openssl-dev:amd64 1.5.3-1build2 amd64 Secure Reliable Transport UDP streaming library (OpenSSL flavour development) +# # 0.131 ii libsrt1.5-openssl:amd64 1.5.3-1build2 amd64 Secure Reliable Transport UDP streaming library (OpenSSL flavour) +# # 46.40 ERROR: srt >= 1.3.0 not found using pkg-config +# # libvmaf >= 2.0.0 not found using pkg-config +# # $ dpkg -L libsrt-openssl-dev +# # /usr/include/srt/srt.h +# # /usr/lib/x86_64-linux-gnu/libsrt.a +# # /usr/lib/x86_64-linux-gnu/pkgconfig/srt.pc +# # /usr/lib/x86_64-linux-gnu/libsrt.so +# # $ dpkg -L libsrt1.5-openssl +# # /usr/lib/x86_64-linux-gnu/libsrt.so.1.5.3 +# # /usr/share/lintian/overrides/libsrt1.5-openssl +# # /usr/lib/x86_64-linux-gnu/libsrt.so.1.5 +# # /usr/lib/x86_64-linux-gnu/libsrt.so +# # /usr/lib/x86_64-linux-gnu/pkgconfig/ +# export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} && \ +# ./configure \ +# %%FFMPEG_CONFIG_FLAGS%% +# # make clean && \ +# # 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 \ +# echo "look at the ffmpeg build log" \ +# cat /tmp/ffmpeg/config.log \ +# echo "ffmpeg build log end" \ +# echo "look at the environement" \ +# env + diff --git a/templates/Dockerfile-template.alpine313 b/templates/Dockerfile-template.alpine313 deleted file mode 100644 index 2635c114b..000000000 --- a/templates/Dockerfile-template.alpine313 +++ /dev/null @@ -1,70 +0,0 @@ -# ffmpeg - http://ffmpeg.org/download.html -# -# https://hub.docker.com/r/jrottenberg/ffmpeg/ -# -# - -FROM alpine:3.13 AS base - -RUN apk add --no-cache --update libgcc libstdc++ ca-certificates libcrypto1.1 libssl1.1 libgomp expat git - - -FROM base AS build - -WORKDIR /tmp/workdir - -ENV %%ENV%% - -RUN buildDeps="autoconf \ - automake \ - bash \ - binutils \ - bzip2 \ - cmake \ - coreutils \ - curl \ - diffutils \ - expat-dev \ - file \ - g++ \ - gcc \ - gperf \ - libtool \ - make \ - nasm \ - openssl-dev \ - python3 \ - tar \ - xcb-proto \ - yasm \ - zlib-dev" && \ - apk add --no-cache --update ${buildDeps} -%%RUN%% - -RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.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/lib ffmpeg -buildconf && \ - mkdir -p /usr/local/include && \ - cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ - mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ - done - -### Release Stage -FROM base AS release -LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ - org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg - -ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 - -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/templates/Dockerfile-template.alpine320 b/templates/Dockerfile-template.alpine320 new file mode 100644 index 000000000..81bb74a39 --- /dev/null +++ b/templates/Dockerfile-template.alpine320 @@ -0,0 +1,173 @@ +# ffmpeg - http://ffmpeg.org/download.html +# +# https://hub.docker.com/r/jrottenberg/ffmpeg/ +# +# + +FROM alpine:3.20 as base + +RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git + +FROM base as build + +WORKDIR /tmp/workdir + +ENV %%ENV%% + +RUN libDeps="libgomp \ + # https://github.com/zeromq/libzmq/ + zeromq \ + zeromq-dev \ + # https://sourceforge.net/projects/opencore-amr/ + opencore-amr \ + opencore-amr-dev \ + # https://www.xiph.org/ogg/ + libogg \ + libogg-static \ + libogg-dev \ + # libtheora http://www.theora.org/ + libtheora \ + libtheora-static \ + libtheora-dev \ + # http://www.videolan.org/developers/x264.html + x264 \ + x264-libs \ + x264-dev \ + # http://x265.org/ + x265 \ + x265-libs \ + x265-dev \ + # https://www.opus-codec.org/ + opus \ + opus-tools \ + opus-dev \ + # https://xiph.org/vorbis/ + libvorbis \ + libvorbis-static \ + libvorbis-dev \ + # https://www.webmproject.org/code/ + libvpx \ + libvpx-utils \ + libvpx-dev \ + # https://developers.google.com/speed/webp/ + libwebp \ + libwebp-dev \ + libwebp-static \ + libwebp-tools \ + # http://lame.sourceforge.net/ + lame \ + lame-libs \ + lame-dev \ + # https://www.xvid.com/ + xvidcore \ + xvidcore-static \ + xvidcore-dev \ + # https://github.com/mstorsjo/fdk-aac + fdk-aac \ + fdk-aac-dev \ + # https://github.com/uclouvain/openjpeg + openjpeg \ + openjpeg-tools \ + openjpeg-dev \ + # https://www.freetype.org/ + freetype \ + freetype-static \ + freetype-dev \ + # https://github.com/georgmartius/vid.stab + vidstab \ + vidstab-dev \ + ## https://www.fribidi.org/ + fribidi \ + fribidi-static \ + fribidi-dev \ + # fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ + fontconfig \ + fontconfig-static \ + fontconfig-dev \ + # https://github.com/libass/libass + libass \ + libass-dev \ + # https://aomedia.googlesource.com/aom + aom \ + aom-libs \ + aom-dev \ + # https://xcb.freedesktop.org/ + # https://www.x.org/archive//individual/util/util-macros- + util-macros \ + # https://www.x.org/archive/individual/proto/xproto- + xorgproto \ + # https://www.x.org/archive/individual/lib/libXau- + libxau \ + libxau-dev \ + # https://github.com/GNOME/libxml2/ + libxml2 \ + libxml2-static \ + libxml2-utils \ + libxml2-dev \ + # https://github.com/Haivision/srt + libsrt \ + libsrt-progs \ + libsrt-dev \ + # https://git.code.sf.net/p/libpng/code + libpng \ + libpng-static \ + libpng-utils \ + libpng-dev \ + # https://github.com/sekrit-twc/zimg + zimg \ + zimg-dev" && \ + apk add --no-cache --update ${libDeps} + + +RUN buildDeps="autoconf \ + automake \ + bash \ + binutils \ + bzip2 \ + cmake \ + coreutils \ + curl \ + diffutils \ + expat-dev \ + file \ + g++ \ + gcc \ + gperf \ + libtool \ + make \ + nasm \ + openssl-dev \ + python3 \ + tar \ + xcb-proto \ + yasm \ + zlib-dev \ + alpine-sdk \ + linux-headers" && \ + apk add --no-cache --update ${buildDeps} +%%RUN%% + +RUN \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ + cp ${PREFIX}/bin/* /usr/local/bin/ && \ + cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ + LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ + mkdir -p /usr/local/include && \ + cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ + mkdir -p /usr/local/lib/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/lib/pkgconfig/"${pc##*/}"; \ + done + +### Release Stage +FROM base as release +LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ + org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg + +ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 + +CMD ["--help"] +ENTRYPOINT ["ffmpeg"] + +COPY --from=build /usr/local /usr/local diff --git a/templates/Dockerfile-template.scratch313 b/templates/Dockerfile-template.scratch320 similarity index 76% rename from templates/Dockerfile-template.scratch313 rename to templates/Dockerfile-template.scratch320 index 733f28e99..febb8ab1b 100644 --- a/templates/Dockerfile-template.scratch313 +++ b/templates/Dockerfile-template.scratch320 @@ -4,18 +4,19 @@ # # -FROM alpine:3.13 AS build +FROM alpine:3.20 as build WORKDIR /tmp/workdir ENV %%ENV%% +RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl expat git libgomp + RUN buildDeps="autoconf \ automake \ bash \ binutils \ bzip2 \ - ca-certificates \ cmake \ coreutils \ curl \ @@ -24,12 +25,7 @@ RUN buildDeps="autoconf \ file \ g++ \ gcc \ - git \ gperf \ - libcrypto1.1 \ - libgcc \ - libssl1.1 \ - libstdc++ \ libtool \ make \ nasm \ @@ -38,8 +34,12 @@ RUN buildDeps="autoconf \ tar \ xcb-proto \ yasm \ - zlib-dev" && \ - apk add --update ${buildDeps} + zlib-dev \ + alpine-sdk \ + linux-headers" && \ + apk add --no-cache --update ${buildDeps} + +#RUN apk add --no-cache --update meson samuri %%RUN%% @@ -52,7 +52,7 @@ RUN \ LD_LIBRARY_PATH=/tmp/fakeroot/lib /tmp/fakeroot/bin/ffmpeg -buildconf ### Release Stage -FROM scratch AS release +FROM scratch as release LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg @@ -62,6 +62,3 @@ CMD ["--help"] ENTRYPOINT ["/bin/ffmpeg"] COPY --from=build /tmp/fakeroot/ / - -# 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/templates/Dockerfile-template.ubuntu2204 b/templates/Dockerfile-template.ubuntu2404 similarity index 53% rename from templates/Dockerfile-template.ubuntu2204 rename to templates/Dockerfile-template.ubuntu2404 index a1d5ddb9a..0bf8f32ad 100644 --- a/templates/Dockerfile-template.ubuntu2204 +++ b/templates/Dockerfile-template.ubuntu2404 @@ -5,58 +5,84 @@ # https://hub.docker.com/r/jrottenberg/ffmpeg/ # # -FROM ubuntu:20.04 AS base +# Stage 1: Build +FROM ubuntu:24.04 AS builder + WORKDIR /tmp/workdir +ENV %%ENV%% + +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ - apt-get autoremove -y && \ - apt-get clean -y + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 +# apt-get autoremove -y && \ +# apt-get clean -y -FROM base as build +# FROM base AS build -ENV %%ENV%% -ARG DEBIAN_FRONTEND=noninteractive RUN buildDeps="autoconf \ automake \ cmake \ + build-essential \ + texinfo \ curl \ + wget \ bzip2 \ libexpat1-dev \ - g++ \ gcc \ git \ + git-core \ gperf \ libtool \ make \ meson \ + ninja-build \ nasm \ perl \ pkg-config \ - python \ - libssl-dev \ + python3 \ yasm \ - zlib1g-dev" && \ + zlib1g-dev \ + libfreetype6-dev \ + libgnutls28-dev \ + libsdl2-dev \ + libva-dev \ + libvdpau-dev \ + libnuma-dev" && \ apt-get -yqq update && \ apt-get install -yq --no-install-recommends ${buildDeps} + %%RUN%% + + ## cleanup +# This is used for both the source and packages version ( be robust about looking for libs to copy ) RUN \ - ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ - for lib in /usr/local/lib/*.so.*; do ln -s "${lib##*/}" "${lib%%.so.*}".so; done && \ + if ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep x86_64-linux-gnu | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + if ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | grep -q . ; then \ + ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/; \ + fi && \ + for lib in /usr/local/lib/*.so.*; do ln -sf "${lib##*/}" "${lib%%.so.*}".so; done && \ cp ${PREFIX}/bin/* /usr/local/bin/ && \ cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf && \ cp -r ${PREFIX}/include/libav* ${PREFIX}/include/libpostproc ${PREFIX}/include/libsw* /usr/local/include && \ mkdir -p /usr/local/lib/pkgconfig && \ - for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc; do \ sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ done -FROM base AS release +# FROM base AS release + +# # Stage 2: Final Image +FROM ubuntu:24.04 +COPY --from=builder /usr/local /usr/local/ + LABEL org.opencontainers.image.authors="julien@rottenberg.info" \ org.opencontainers.image.source=https://github.com/jrottenberg/ffmpeg @@ -65,7 +91,3 @@ ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64 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/templates/Dockerfile-template.vaapi2204 b/templates/Dockerfile-template.vaapi2404 similarity index 97% rename from templates/Dockerfile-template.vaapi2204 rename to templates/Dockerfile-template.vaapi2404 index 22a5f817f..d0b78e79b 100644 --- a/templates/Dockerfile-template.vaapi2204 +++ b/templates/Dockerfile-template.vaapi2404 @@ -5,12 +5,12 @@ # https://hub.docker.com/r/jrottenberg/ffmpeg/ # # -FROM ubuntu:22.04 AS base +FROM ubuntu:24.04 as base WORKDIR /tmp/workdir RUN apt-get -yqq update && \ - apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ + apt-get install -yq --no-install-recommends ca-certificates openssl expat libgomp1 && \ apt-get autoremove -y && \ apt-get clean -y diff --git a/update.py b/update.py index f36152f90..fe4b653e2 100755 --- a/update.py +++ b/update.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 - +import datetime import json import os import shutil @@ -8,36 +8,54 @@ FFMPEG_RELEASES = "https://endoflife.date/api/ffmpeg.json" -with open("templates/Dockerfile-env", "r") as tmpfile: - ENV_CONTENT = tmpfile.read() -with open("templates/Dockerfile-run", "r") as tmpfile: - RUN_CONTENT = tmpfile.read() - DIR_FORMAT_STR = "docker-images/{0}/{1}" IMAGE_FORMAT_STR = "{0}/Dockerfile".format(DIR_FORMAT_STR) TEMPLATE_STR = "templates/Dockerfile-template.{0}" # https://ffmpeg.org/olddownload.html # https://endoflife.date/ffmpeg - -with request.urlopen(FFMPEG_RELEASES) as conn: - ffmpeg_releases = conn.read().decode("utf-8") -keep_version = [] - -for v in json.loads(ffmpeg_releases): - if not v["eol"]: - if "0.0" in v["latest"]: - v["latest"] = v["latest"].replace("0.0", "0") - keep_version.append(v["latest"]) - - +# We use the endoflife.date API to find the most recent ffmpeg versions. However, +# to simplify image maintenance, we only consider versions released within the +# last YEARS years (currently set to 3). Including very older versions compatibility +# issues with different libraries and operating system versions. By focusing on +# recent versions, we keep things manageable. +# Note: the older builds will be preserved in the the docker hub registry. +RELEASED_YEARS_AGO = 3 + +def is_too_old(date_str, years): + date_obj = datetime.datetime.strptime(date_str, '%Y-%m-%d') + diff = datetime.datetime.now() - date_obj + # Check if the difference is more than x years + return diff.days > (years * 365) + +def get_eol_versions(): + keep_version = [] + with request.urlopen(FFMPEG_RELEASES) as conn: + ffmpeg_releases = conn.read().decode("utf-8") + + for v in json.loads(ffmpeg_releases): + if not v["eol"]: + if "0.0" in v["latest"]: + v["latest"] = v["latest"].replace("0.0", "0") + release_date = v["releaseDate"] + if not is_too_old(release_date, years=RELEASED_YEARS_AGO): + keep_version.append(v["latest"]) + return keep_version + +keep_version = get_eol_versions() +print("The following versions of ffmpeg is still supported:") +for version in keep_version: + print(version) VARIANTS = [ - {"name": "ubuntu2204", "parent": "ubuntu"}, - {"name": "alpine313", "parent": "alpine"}, - {"name": "scratch313", "parent": "scratch"}, - {"name": "vaapi2204", "parent": "vaapi"}, + {"name": "ubuntu2404", "parent": "ubuntu"}, + {"name": "ubuntu2404-edge", "parent": "ubuntu-edge"}, + {"name": "alpine320", "parent": "alpine"}, + {"name": "scratch320", "parent": "scratch"}, + # Video Acceleration API (VAAPI) https://trac.ffmpeg.org/wiki/HWAccelIntro#VAAPI + {"name": "vaapi2404", "parent": "vaapi"}, {"name": "nvidia2204", "parent": "nvidia"}, ] +current_variant_names = [v["name"] for v in VARIANTS] all_parents = sorted(set([sub["parent"] for sub in VARIANTS])) @@ -47,14 +65,19 @@ for parent in all_parents: gitlabci.append(f" - {parent}\n") - +# Note: Skip variants and the is_too_old() check, work together to allow us to skip building things +# Skip variants allow us to skip some variants for specific versions +# is_too_old() check allow us to skip versions that are too old SKIP_VARIANTS = { - "2.8": ["alpine313", "nvidia2004", "vaapi2004", "scratch313"], - "4.2": ["alpine313"], - "4.3": ["alpine313", "scratch313"], - "5.1": ["scratch313"], - "6.0": ["alpine313", "nvidia2004"], - "6.1": ["alpine313", "nvidia2004", "scratch313"], + "2.8": ["nvidia2204", "vaapi2204"] + [v["name"] for v in VARIANTS], + "3.4": ["alpine313", "nvidia2204", "scratch313", "vaapi2204"] + [v["name"] for v in VARIANTS], + "4.2": ["alpine313", "ubuntu2404"] + [v["name"] for v in VARIANTS], + "4.3": ["nvidia2204", "vaapi2204"] + [v["name"] for v in VARIANTS], + "4.4": ["alpine313", "nvidia2204", "scratch313"] + [v["name"] for v in VARIANTS], + "5.1": [], + "6.1": [], + "7.0": [], + "7.1": [], } @@ -74,10 +97,25 @@ def get_major_version(version): return f"{major}" +def read_ffmpeg_template(variant_name, env_or_run="env"): + """ Read the ffmpeg template file and return the content """ + if variant_name == "scratch": + distro_name = "alpine-scratch" + elif variant_name == "alpine": + distro_name = "alpine" + elif variant_name == "ubuntu-edge": + distro_name = "ubuntu-edge" + else: + distro_name = "ubuntu" + + with open(f"templates/Dockerfile-{env_or_run}-{distro_name}", "r") as tmpfile: + return tmpfile.read() + + print("Preparing docker images for ffmpeg versions: ") + for version in keep_version: - print(version) skip_variants = None for k, v in SKIP_VARIANTS.items(): if version.startswith(k): @@ -85,6 +123,7 @@ def get_major_version(version): compatible_variants = [ v for v in VARIANTS if skip_variants is None or v["name"] not in skip_variants ] + short_version = get_shorten_version(version) major_version = get_major_version(version) ver_path = os.path.join("docker-images", short_version) @@ -92,8 +131,14 @@ def get_major_version(version): for existing_variant in os.listdir(ver_path): if existing_variant not in compatible_variants: shutil.rmtree(DIR_FORMAT_STR.format(short_version, existing_variant)) - + + print(f"Preparing Dockerfile for ffmpeg-{version}") for variant in compatible_variants: + print(f"{' '*25}{version}-{variant['name']}") + + ENV_CONTENT = read_ffmpeg_template(variant["parent"], "env") + RUN_CONTENT = read_ffmpeg_template(variant["parent"], "run") + siblings = [ v["name"] for v in compatible_variants if v["parent"] == variant["parent"] ] @@ -125,18 +170,20 @@ def get_major_version(version): ISPARENT: {is_parent} """ ) - with open(TEMPLATE_STR.format(variant["name"]), "r") as tmpfile: + with open(TEMPLATE_STR.format(variant["name"].replace('-edge', '')), "r") as tmpfile: template = tmpfile.read() - + # Note: the debug, doc, ffplay, -ldl, gpl. ( the first 6 flags) are prebuilt in Docker-run-ubuntu template + # To prevent conflicts FFMPEG_CONFIG_FLAGS = [ "--disable-debug", "--disable-doc", "--disable-ffplay", - "--enable-fontconfig", + "--enable-shared", + "--extra-libs=-ldl", "--enable-gpl", + "--enable-fontconfig", "--enable-libass", "--enable-libbluray", - "--enable-libfdk_aac", "--enable-libfreetype", "--enable-libmp3lame", "--enable-libopencore-amrnb", @@ -155,10 +202,8 @@ def get_major_version(version): "--enable-nonfree", "--enable-openssl", "--enable-postproc", - "--enable-shared", "--enable-small", "--enable-version3", - "--extra-libs=-ldl", '--prefix="${PREFIX}"', ] CFLAGS = [ @@ -209,6 +254,22 @@ def get_major_version(version): FFMPEG_CONFIG_FLAGS.append("--enable-cuda") FFMPEG_CONFIG_FLAGS.append("--enable-cuvid") FFMPEG_CONFIG_FLAGS.append("--enable-libnpp") + + if variant["parent"] in ["ubuntu", "alpine", "scratch"] and float(version[0:3]) >= 5.1: + # from https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu#FFmpeg + FFMPEG_CONFIG_FLAGS.append("--extra-libs=-lm") # add math library + FFMPEG_CONFIG_FLAGS.append("--ld=g++") # use g++ as linker + # FFMPEG_CONFIG_FLAGS.append("--enable-gnutls") + FFMPEG_CONFIG_FLAGS.append("--enable-libfdk-aac") + FFMPEG_CONFIG_FLAGS.append("--enable-libsvtav1") + FFMPEG_CONFIG_FLAGS.append("--enable-libdav1d") + else: # for older versions + FFMPEG_CONFIG_FLAGS.append("--enable-libfdk_aac") # this was likely misstyped before + + if "ubuntu" in variant["parent"] and float(version[0:3]) >= 5.1: + CFLAGS.append("-I/usr/include/x86_64-linux-gnu") + LDFLAGS.append("-L/usr/lib/x86_64-linux-gnu") + cflags = '--extra-cflags="{0}"'.format(" ".join(CFLAGS)) ldflags = '--extra-ldflags="{0}"'.format(" ".join(LDFLAGS)) FFMPEG_CONFIG_FLAGS.append(cflags) @@ -216,7 +277,6 @@ def get_major_version(version): FFMPEG_CONFIG_FLAGS.sort() COMBINED_CONFIG_FLAGS = " \\\n ".join(FFMPEG_CONFIG_FLAGS) - run_content = RUN_CONTENT.replace( "%%FFMPEG_CONFIG_FLAGS%%", COMBINED_CONFIG_FLAGS )