From e85277ef25cc08b5898c78c135b02ec845a8b894 Mon Sep 17 00:00:00 2001 From: Julien Rottenberg Date: Sun, 26 Apr 2026 23:15:52 -0700 Subject: [PATCH 1/2] Multi-arch Docker builds with native ARM64 runners via GitHub Actions - Add multi-arch (amd64/arm64) support using native ARM64 GitHub runners - Switch unreliable freedesktop.org download URLs to stable mirrors (www.x.org, xcb.freedesktop.org, gitlab.freedesktop.org) - Build fontconfig with meson from GitLab source archive - Add HTTP 418 (anti-bot) retry handling in download_tarballs.sh - Update README: refresh versions to 8.0/8.1, add arch column, fix Jekyll rendering of details block - Add GitHub Pages deployment workflow - Remove Azure Pipelines config --- .dockerignore | 8 + .github/dependabot.yml | 6 + .github/workflows/build.yml | 183 +++++++++ .github/workflows/jekyll-gh-pages.yml | 47 +++ .gitignore | 5 +- .gitlab-ci.yml | 5 +- .pre-commit-config.yaml | 2 +- CONTRIBUTING.md | 11 + README.md | 95 ++--- azure-pipelines.yml | 37 -- azure-steps.yml | 44 -- build_source.sh | 46 ++- docker-images/8.0/alpine320/Dockerfile | 2 +- docker-images/8.0/alpine320/build_source.sh | 51 ++- .../8.0/alpine320/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- docker-images/8.0/alpine320/install_ffmpeg.sh | 26 +- docker-images/8.0/nvidia2404/Dockerfile | 4 +- docker-images/8.0/nvidia2404/build_source.sh | 51 ++- .../8.0/nvidia2404/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- .../8.0/nvidia2404/install_ffmpeg.sh | 26 +- docker-images/8.0/scratch320/Dockerfile | 7 +- docker-images/8.0/scratch320/build_source.sh | 51 ++- .../8.0/scratch320/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- .../8.0/scratch320/install_ffmpeg.sh | 26 +- docker-images/8.0/ubuntu2404-edge/Dockerfile | 6 +- .../8.0/ubuntu2404-edge/build_source.sh | 51 ++- .../8.0/ubuntu2404-edge/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- .../8.0/ubuntu2404-edge/install_ffmpeg.sh | 26 +- docker-images/8.0/ubuntu2404/Dockerfile | 4 +- docker-images/8.0/ubuntu2404/build_source.sh | 51 ++- .../8.0/ubuntu2404/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- .../8.0/ubuntu2404/install_ffmpeg.sh | 26 +- docker-images/8.0/vaapi2404/Dockerfile | 4 +- docker-images/8.0/vaapi2404/build_source.sh | 51 ++- .../8.0/vaapi2404/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- docker-images/8.0/vaapi2404/install_ffmpeg.sh | 26 +- docker-images/8.1/alpine320/Dockerfile | 2 +- docker-images/8.1/alpine320/build_source.sh | 51 ++- .../8.1/alpine320/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- docker-images/8.1/alpine320/install_ffmpeg.sh | 26 +- docker-images/8.1/nvidia2404/Dockerfile | 4 +- docker-images/8.1/nvidia2404/build_source.sh | 51 ++- .../8.1/nvidia2404/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- .../8.1/nvidia2404/install_ffmpeg.sh | 26 +- docker-images/8.1/scratch320/Dockerfile | 7 +- docker-images/8.1/scratch320/build_source.sh | 51 ++- .../8.1/scratch320/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- .../8.1/scratch320/install_ffmpeg.sh | 26 +- docker-images/8.1/ubuntu2404-edge/Dockerfile | 6 +- .../8.1/ubuntu2404-edge/build_source.sh | 51 ++- .../8.1/ubuntu2404-edge/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- .../8.1/ubuntu2404-edge/install_ffmpeg.sh | 26 +- docker-images/8.1/ubuntu2404/Dockerfile | 4 +- docker-images/8.1/ubuntu2404/build_source.sh | 51 ++- .../8.1/ubuntu2404/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- .../8.1/ubuntu2404/install_ffmpeg.sh | 26 +- docker-images/8.1/vaapi2404/Dockerfile | 4 +- docker-images/8.1/vaapi2404/build_source.sh | 51 ++- .../8.1/vaapi2404/download_tarballs.sh | 20 +- ...enerate-source-of-truth-ffmpeg-versions.py | 151 ++----- docker-images/8.1/vaapi2404/install_ffmpeg.sh | 26 +- docker-images/azure-jobs.yml | 131 ------ docker-images/github-actions-matrix.json | 386 ++++++++++++++++++ docker-images/gitlab-ci.yml | 12 + docs/Dockerfile | 13 + docs/_config.yml | 10 + docs/assets/css/style.scss | 13 + download_tarballs.sh | 20 +- generate-source-of-truth-ffmpeg-versions.py | 151 ++----- install_ffmpeg.sh | 26 +- templates/Dockerfile-env-alpine | 2 +- templates/Dockerfile-env-alpine-scratch | 2 +- templates/Dockerfile-env-nvidia | 4 +- templates/Dockerfile-env-ubuntu | 4 +- templates/Dockerfile-env-ubuntu-edge | 2 +- templates/Dockerfile-env-vaapi | 4 +- templates/Dockerfile-run-alpine-scratch | 5 +- templates/Dockerfile-run-ubuntu-edge | 4 +- templates/azure.template | 12 - update.py | 87 ++-- 91 files changed, 2175 insertions(+), 2232 deletions(-) create mode 100644 .dockerignore create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/jekyll-gh-pages.yml delete mode 100644 azure-pipelines.yml delete mode 100644 azure-steps.yml delete mode 100644 docker-images/azure-jobs.yml create mode 100644 docker-images/github-actions-matrix.json create mode 100644 docs/Dockerfile create mode 100644 docs/_config.yml create mode 100644 docs/assets/css/style.scss delete mode 100644 templates/azure.template diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..d35fb755e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git +.github +__pycache__ +*.pyc +.DS_Store +*.md +!README.md +.pre-commit-config.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..ca79ca5b4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..5c055eb1b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,183 @@ +name: Build Docker Images + +on: + push: + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + packages: write + pages: write + id-token: write + +env: + DOCKER: jrottenberg/ffmpeg + GHCR: ghcr.io/jrottenberg/ffmpeg + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.14" + - run: pip install pre-commit packaging + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + - run: pre-commit run --all-files --show-diff-on-failure + + generate-matrix: + runs-on: ubuntu-latest + outputs: + build: ${{ steps.matrix.outputs.build }} + manifest: ${{ steps.matrix.outputs.manifest }} + steps: + - uses: actions/checkout@v4 + - id: matrix + run: | + echo "build=$(jq -c '.build' docker-images/github-actions-matrix.json)" >> "$GITHUB_OUTPUT" + echo "manifest=$(jq -c '.manifest' docker-images/github-actions-matrix.json)" >> "$GITHUB_OUTPUT" + + build: + needs: [lint, generate-matrix] + runs-on: ${{ matrix.runner }} + timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.generate-matrix.outputs.build) }} + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + if: github.event_name == 'push' + with: + username: ${{ secrets.DOCKER_LOGIN }} + password: ${{ secrets.DOCKER_PASSWORD }} + - uses: docker/login-action@v4 + if: github.event_name == 'push' + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v6 + with: + context: docker-images/${{ matrix.version }}/${{ matrix.variant }} + platforms: ${{ matrix.platform }} + push: ${{ github.event_name == 'push' }} + tags: | + ${{ env.DOCKER }}:${{ matrix.long_version }}-${{ matrix.variant }}-${{ matrix.arch }} + ${{ env.GHCR }}:${{ matrix.long_version }}-${{ matrix.variant }}-${{ matrix.arch }} + cache-from: type=gha,scope=${{ matrix.version }}-${{ matrix.variant }}-${{ matrix.arch }} + cache-to: type=gha,mode=max,scope=${{ matrix.version }}-${{ matrix.variant }}-${{ matrix.arch }} + - name: Load image for smoke test + uses: docker/build-push-action@v6 + with: + context: docker-images/${{ matrix.version }}/${{ matrix.variant }} + load: true + tags: smoke-test:latest + cache-from: type=gha,scope=${{ matrix.version }}-${{ matrix.variant }}-${{ matrix.arch }} + - name: Smoke test + run: | + docker run --rm smoke-test:latest -version + docker run --rm smoke-test:latest -buildconf + CODECS=$(docker run --rm smoke-test:latest -codecs) + for codec in libx264 libx265 libvpx libopus; do + echo "Checking $codec..." + echo "$CODECS" | grep -q "$codec" || { echo "MISSING: $codec"; exit 1; } + done + echo "All codec checks passed" + + create-manifests: + if: github.event_name == 'push' + needs: [build, generate-matrix] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.generate-matrix.outputs.manifest) }} + steps: + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKER_LOGIN }} + password: ${{ secrets.DOCKER_PASSWORD }} + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Create multi-arch manifests + env: + PLATFORMS: ${{ matrix.platforms }} + VARIANT: ${{ matrix.variant }} + PARENT: ${{ matrix.parent }} + VERSION: ${{ matrix.version }} + LONG_VERSION: ${{ matrix.long_version }} + MAJOR_VERSION: ${{ matrix.major_version }} + ISPARENT: ${{ matrix.is_parent }} + ISLATEST: ${{ matrix.is_latest }} + run: | + DOCKER_SOURCES="" + GHCR_SOURCES="" + IFS=',' read -ra ARCHS <<< "${PLATFORMS}" + for platform in "${ARCHS[@]}"; do + arch="${platform#linux/}" + DOCKER_SOURCES="${DOCKER_SOURCES} ${{ env.DOCKER }}:${LONG_VERSION}-${VARIANT}-${arch}" + GHCR_SOURCES="${GHCR_SOURCES} ${{ env.GHCR }}:${LONG_VERSION}-${VARIANT}-${arch}" + done + + DOCKER_TAGS="${{ env.DOCKER }}:${VERSION}-${VARIANT} ${{ env.DOCKER }}:${LONG_VERSION}-${VARIANT}" + GHCR_TAGS="${{ env.GHCR }}/${VERSION}-${VARIANT} ${{ env.GHCR }}/${LONG_VERSION}-${VARIANT}" + + if [ "${ISPARENT}" == "True" ] && [ "${VARIANT}" != "${PARENT}" ]; then + DOCKER_TAGS="${DOCKER_TAGS} ${{ env.DOCKER }}:${VERSION}-${PARENT} ${{ env.DOCKER }}:${MAJOR_VERSION}-${PARENT}" + GHCR_TAGS="${GHCR_TAGS} ${{ env.GHCR }}:${VERSION}-${PARENT} ${{ env.GHCR }}:${MAJOR_VERSION}-${PARENT}" + fi + + if [ "${ISLATEST}" == "True" ]; then + DOCKER_TAGS="${DOCKER_TAGS} ${{ env.DOCKER }}:latest" + GHCR_TAGS="${GHCR_TAGS} ${{ env.GHCR }}:latest" + fi + + for tag in ${DOCKER_TAGS}; do + docker buildx imagetools create -t "${tag}" ${DOCKER_SOURCES} + done + for tag in ${GHCR_TAGS}; do + docker buildx imagetools create -t "${tag}" ${GHCR_SOURCES} + done + + deploy-docs: + if: github.event_name != 'pull_request' + needs: [lint] + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - uses: actions/checkout@v4 + - name: Sync README to docs + run: | + mkdir -p docs + printf -- '---\nlayout: default\ntitle: FFmpeg Docker Images\n---\n\n' > docs/index.md + cat README.md >> docs/index.md + - uses: actions/configure-pages@v5 + - uses: actions/jekyll-build-pages@v1 + with: + source: ./docs + destination: ./_site + - uses: actions/upload-pages-artifact@v3 + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml new file mode 100644 index 000000000..05fcc7bc8 --- /dev/null +++ b/.github/workflows/jekyll-gh-pages.yml @@ -0,0 +1,47 @@ +name: Deploy Jekyll with GitHub Pages dependencies preinstalled + +on: + push: + branches: ["main"] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Sync README to docs + run: | + mkdir -p docs + printf -- '---\n---\n\n' > docs/index.md + cat README.md >> docs/index.md + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./docs + destination: ./_site + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v5 diff --git a/.gitignore b/.gitignore index e6faaf320..f7649536b 100644 --- a/.gitignore +++ b/.gitignore @@ -142,8 +142,6 @@ venv.bak/ # Rope project settings .ropeproject -# mkdocs documentation -/site # mypy .mypy_cache/ @@ -165,3 +163,6 @@ cython_debug/ # 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/ +docs/index.md # Generated +docs/_site +docs/.jekyll-cache diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7e16b9bcc..2d562f259 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,8 +17,11 @@ pre-commit: - docker:19-dind before_script: - export IMAGE="ffmpeg:${VERSION}-${VARIANT:-ubuntu}" + - docker run --rm --privileged tonistiigi/binfmt --install all + - docker buildx create --name multiarch --driver docker-container --use + - docker buildx inspect --bootstrap script: - - docker build -t "${IMAGE}" --build-arg MAKEFLAGS="-j$(($(nproc) + 1))" docker-images/${VERSION}/${VARIANT} + - docker buildx build --platform ${PLATFORMS} -t "${IMAGE}" --build-arg MAKEFLAGS="-j$(($(nproc) + 1))" docker-images/${VERSION}/${VARIANT} - docker images after_script: - docker run --rm ${IMAGE} -buildconf diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ca76ec4d8..0deebd92b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: # pre-commit autoupdate [--in-place, --remove-all-unused-imports, --remove-unused-variables] - repo: https://github.com/pycqa/isort - rev: 8.0.1 + rev: 9.0.0a3 hooks: - id: isort diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9db58cf9..fe8bd84a9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -123,6 +123,17 @@ In the bash shell, run the following commands ``` +## Previewing GitHub Pages locally + +The project site is built from `README.md` using Jekyll. To preview it locally: + +```sh +docker build -t docs -f docs/Dockerfile . +docker run --rm -p 4000:4000 docs +``` + +Then open http://localhost:4000. + # Reviewing diff --git a/README.md b/README.md index 446219b45..be35c52f3 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,14 @@ [![Docker Automated build](https://img.shields.io/docker/automated/jrottenberg/ffmpeg.svg?logo=docker)](https://hub.docker.com/r/jrottenberg/ffmpeg/tags) [![Github Container Registry Images](https://img.shields.io/badge/images-automated-blue?logo=github&style=plastic)](https://github.com/jrottenberg/ffmpeg/pkgs/container/ffmpeg) [![gitlab pipeline status](https://gitlab.com/jrottenberg/ffmpeg/badges/main/pipeline.svg)](https://gitlab.com/jrottenberg/ffmpeg/commits/main) -[![Azure Build Status](https://dev.azure.com/video-tools/ffmpeg/_apis/build/status/jrottenberg.ffmpeg)](https://dev.azure.com/video-tools/ffmpeg/_build/latest?definitionId=1) +[![GitHub Actions Build Status](https://github.com/jrottenberg/ffmpeg/actions/workflows/build.yml/badge.svg)](https://github.com/jrottenberg/ffmpeg/actions/workflows/build.yml) This project prepares a minimalist Docker image with FFmpeg. It compiles FFmpeg from sources following instructions from the [Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide). -You can install the latest build of this image by running `docker pull jrottenberg/ffmpeg:${VERSION}-${VARIANT}` or `docker pull ghcr.io/jrottenberg/ffmpeg:${VERSION}-${VARIANT}`. +You can install the latest build of this image by running `docker pull ghcr.io/jrottenberg/ffmpeg:${VERSION}-${VARIANT}` or `docker pull jrottenberg/ffmpeg:${VERSION}-${VARIANT}`. -For the latest FFmpeg version on Ubuntu LTS, you can use: `docker pull jrottenberg/ffmpeg:latest` or `docker pull ghcr.io/jrottenberg/ffmpeg:latest`. +For the latest FFmpeg version on Ubuntu LTS, you can use: `docker pull ghcr.io/jrottenberg/ffmpeg:latest` or `docker pull jrottenberg/ffmpeg:latest`. This image can be used as a base for an encoding farm. @@ -23,27 +23,27 @@ 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 | 6.x - 7.x | [ubuntu](https://releases.ubuntu.com/) | external libraries are installed from os packages, and ffmpeg is built from source. See [Ubuntu Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) for details on this. | -| ffmpeg-7.1-ubuntu2404-edge | 24.04 | 6.x - 7.x | [ubuntu](https://releases.ubuntu.com/) | libs and ffmpeg are built from source. See [Ubuntu Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) for details on this. | -| ffmpeg-7.1-vaapi2404 | 24.04 | 6.x - 7.x | [ubuntu](https://releases.ubuntu.com/) | like: `ubuntu2404` but enables: [Video Acceleration API (VAAPI)](https://trac.ffmpeg.org/wiki/HWAccelIntro#VAAPI) in ffmpeg | -| ffmpeg-7.1-nvidia2204-edge | 22.04 | 6.x - 7.x | [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 | 6.x - 7.x | [alpine](https://alpinelinux.org/releases/) | vendor libs, but ffmpeg is built from source | -| ffmpeg-7.1-scratch | 3.20 | 6.x - 7.x | [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 | +| image name | OS ver | ffmpeg ver | arch | variant | description | +| --- | --- | --- | --- | --- | --- | +| ffmpeg-8.1-ubuntu2404 | 24.04 | 8.x | amd64, arm64 | [ubuntu](https://releases.ubuntu.com/) | external libraries are installed from os packages, and ffmpeg is built from source. See [Ubuntu Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) for details on this. | +| ffmpeg-8.1-ubuntu2404-edge | 24.04 | 8.x | amd64, arm64 | [ubuntu](https://releases.ubuntu.com/) | libs and ffmpeg are built from source. See [Ubuntu Compilation Guide](https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu) for details on this. | +| ffmpeg-8.1-vaapi2404 | 24.04 | 8.x | amd64 | [ubuntu](https://releases.ubuntu.com/) | like: `ubuntu2404` but enables: [Video Acceleration API (VAAPI)](https://trac.ffmpeg.org/wiki/HWAccelIntro#VAAPI) in ffmpeg | +| ffmpeg-8.1-nvidia2404 | 24.04 | 8.x | amd64 | [ubuntu](https://releases.ubuntu.com/) | Built w/ [NVIDIA's hardware-accelerated encoding and decoding APIs](https://trac.ffmpeg.org/wiki/HWAccelIntro#CUDANVENCNVDEC) enabled | +| ffmpeg-8.1-alpine320 | 3.20 | 8.x | amd64, arm64 | [alpine](https://alpinelinux.org/releases/) | vendor libs, but ffmpeg is built from source | +| ffmpeg-8.1-scratch320 | 3.20 | 8.x | amd64, arm64 | [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: `6.1`, `7.0`, `7.1` with the above table. +ffmpeg `` can be one of the following: `8.0`, `8.1` with the above table. -Note: The current versions of ffmpeg supported are anything newer than 3 years old and not exceeded the end-of-life +Note: The current versions of ffmpeg supported are anything newer than 3 years old and not exceeded the end-of-life -
Here are some additional older builds +
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`) +- alpine based images `ffmpeg:-alpine` or `ffmpeg:-alpine320` (old versions with `ffmpeg:-alpine313` , `ffmpeg:-alpine312`) + - alpine based scratch images `ffmpeg:-scratch` or `ffmpeg:-scratch320` (old versions with `ffmpeg:-scratch313` , `ffmpeg:-scratch312`) +- ubuntu based images `ffmpeg:-ubuntu` or `ffmpeg:-ubuntu2404` (old versions with `ffmpeg:-ubuntu2004` , `ffmpeg:-ubuntu1804`) + - ubuntu based nvidia images `ffmpeg:-nvidia` or `ffmpeg:-nvidia2404` (old versions with `ffmpeg:-nvidia2204`, `ffmpeg:-nvidia2004`) + - ubuntu based vaapi images `ffmpeg:-vaapi2404` (old versions with `ffmpeg:-vaapi2004`, `ffmpeg:-vaapi1804`)
@@ -59,7 +59,7 @@ This image is just like the above `ubuntu2404` container image, except we build **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** +**nvidia2404** 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** @@ -266,50 +266,37 @@ for i in ogg amr vorbis theora mp3lame opus vpx xvid fdk x264 x265;do echo $i; f ## FFMPEG Supported Libraries The following libraries are used by FFMPEG. The version number and release date are provided along with the license information. -These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'. -These libs are included in the package images as well, but the version numbers might vary slightly. -| Libraries | Version | Release Date | License | -|-----------|---------|--------------|---------| -| [ffmpeg](http://ffmpeg.org/) | [7.1](http://ffmpeg.org/releases/) | | [GNU Lesser General Public License (LGPL) version 2.1](https://ffmpeg.org/legal.html)| -| [libogg](https://www.xiph.org/ogg/) | [1.3.4](https://xiph.org/downloads/) | 08-2019 | [BSD-style license](https://git.xiph.org/?p=mirrors/ogg.git;a=blob_plain;f=COPYING;hb=HEAD)| -| [libopencore-amr](https://sourceforge.net/projects/opencore-amr/) | [0.1.6](https://sourceforge.net/projects/opencore-amr/files/opencore-amr/) | 08-2022 | [Apache License](https://sourceforge.net/p/opencore-amr/code/ci/master/tree/LICENSE)| - - -See `generate-source-of-truth-ffmpeg-versions.py` to update a version - -## FFMPEG Supported Libraries -The following libraries are used by FFMPEG. The version number and release date are provided along with the license information. -These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'. +These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'. These libs are included in the package images as well, but the version numbers might vary slightly. | Libraries | Version | Release Date | Download Source | Checksum | License | |-----------|---------|--------------|------------ | --- | ---------| -| [libopencore-amr](https://sourceforge.net/projects/opencore-amr/) | [0.1.6](https://sourceforge.net/projects/opencore-amr/files/opencore-amr/) | 2022-08-01 | [opencore-amr-0.1.6.tar.gz](https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.6.tar.gz) | No | [Apache License](https://sourceforge.net/p/opencore-amr/code/ci/master/tree/LICENSE) | -| [libx264](https://www.videolan.org/developers/x264.html) | [20191217-2245-stable](https://download.videolan.org/pub/videolan/x264/snapshots/) | 2019-12-17 | [x264-snapshot-20191217-2245-stable.tar.bz2](https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20191217-2245-stable.tar.bz2) | No | [GNU General Public License (GPL) version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) | -| [libx265](http://x265.org/) | [4.0](http://ftp.videolan.org/pub/videolan/x265/) | 2024-09-13 | [x265_4.0.tar.gz](http://ftp.videolan.org/pub/videolan/x265/x265_4.0.tar.gz) | No | [GNU General Public License (GPL) version 2](https://bitbucket.org/multicoreware/x265/raw/f8ae7afc1f61ed0db3b2f23f5d581706fe6ed677/COPYING) | +| [aom](https://aomedia.googlesource.com/aom) | [3.10.0](https://aomedia.googlesource.com/aom/+refs) | 2024-08-01 | [v3.10.0](https://aomedia.googlesource.com/aom/+/refs/tags/v3.10.0) | No | [Alliance for Open Media](https://aomedia.org/license/software-license/) | +| [fontconfig](https://gitlab.freedesktop.org/fontconfig/fontconfig) | [2.15.0](https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags) | 2023-12-22 | [fontconfig-2.15.0.tar.gz](https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/2.15.0/fontconfig-2.15.0.tar.gz) | No | []() | +| [freetype](https://www.freetype.org/) | [2.13.3](http://download.savannah.gnu.org/releases/freetype/) | 2024-08-12 | [freetype-2.13.3.tar.gz](http://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.gz) | No | [GNU General Public License (GPL) version 2](https://www.freetype.org/license.html) | +| [kvazaar](https://github.com/ultravideo/kvazaar) | [2.3.1](https://github.com/ultravideo/kvazaar/releases) | 2024-04-10 | [kvazaar-2.3.1.tar.gz](https://github.com/ultravideo/kvazaar/releases/download/v2.3.1/kvazaar-2.3.1.tar.gz) | No | [BSD 3-Clause](https://github.com/ultravideo/kvazaar/blob/master/LICENSE`) | +| [libbluray](https://www.videolan.org/developers/libbluray.html) | [1.3.4](https://download.videolan.org/pub/videolan/libbluray/) | 2022-11-26 | [libbluray-1.3.4.tar.bz2](https://download.videolan.org/pub/videolan/libbluray/1.3.4/libbluray-1.3.4.tar.bz2) | No | [GNU General Public License (GPL) version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) | +| [libfdk-aac](https://github.com/mstorsjo/fdk-aac) | [2.0.3](https://github.com/mstorsjo/fdk-aac/tags) | 2023-12-21 | [fdk-aac-2.0.3.tar.gz](https://github.com/mstorsjo/fdk-aac/archive/refs/tags/v2.0.3.tar.gz) | No | [Liberal but not a license of patented technologies](https://github.com/mstorsjo/fdk-aac/blob/master/NOTICE) | +| [libmp3lame](http://lame.sourceforge.net/) | [3.100](http://lame.sourceforge.net/download.php) | 2017-10-13 | [lame-3.100.tar.gz](https://sourceforge.net/projects/lame/files/lame/3.100/lame-3.100.tar.gz) | No | [GNU Lesser General Public License (LGPL) version 2.1](http://lame.cvs.sourceforge.net/viewvc/lame/lame/LICENSE?revision=1.9) | | [libogg](https://www.xiph.org/ogg/) | [1.3.5](https://xiph.org/downloads/) | 2021-06-04 | [libogg-1.3.5.tar.gz](https://downloads.xiph.org/releases/ogg/libogg-1.3.5.tar.gz) | No | [BSD-style license](https://git.xiph.org/?p=mirrors/ogg.git;a=blob_plain;f=COPYING;hb=HEAD) | +| [libopencore-amr](https://sourceforge.net/projects/opencore-amr/) | [0.1.6](https://sourceforge.net/projects/opencore-amr/files/opencore-amr/) | 2022-08-01 | [opencore-amr-0.1.6.tar.gz](https://sourceforge.net/projects/opencore-amr/files/opencore-amr/opencore-amr-0.1.6.tar.gz) | No | [Apache License](https://sourceforge.net/p/opencore-amr/code/ci/master/tree/LICENSE) | | [libopus](https://www.opus-codec.org/) | [1.5.2](https://www.opus-codec.org/downloads/) | 2024-04-12 | [opus-1.5.2.tar.gz](https://github.com/xiph/opus/releases/download/v1.5.2/opus-1.5.2.tar.gz) | Yes | [BSD-style license](https://www.xiph.org/licenses/bsd/) | +| [libpthread-stubs](https://www.x.org/releases/individual/lib/) | [0.5](https://www.x.org/releases/individual/lib/) | 2023-07-18 | [libpthread-stubs-0.5.tar.xz](https://www.x.org/releases/individual/lib/libpthread-stubs-0.5.tar.xz) | No | [The MIT License](https://opensource.org/licenses/MIT) | +| [libsvtav1](https://gitlab.com/AOMediaCodec/SVT-AV1) | [2.2.1](https://gitlab.com/AOMediaCodec/SVT-AV1/-/tags) | 2024-08-01 | [SVT-AV1-v2.2.1.tar.gz](https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v2.2.1/SVT-AV1-v2.2.1.tar.gz) | No | [BSD 3-Clause Clear License](https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/LICENSE.md?ref_type=heads) | +| [libvidstab](https://github.com/georgmartius/vid.stab) | [1.1.1](https://github.com/georgmartius/vid.stab/tags) | 2022-05-30 | [vid.stab-1.1.1.tar.gz](https://github.com/georgmartius/vid.stab/archive/v1.1.1.tar.gz) | No | [GNU General Public License (GPL) version 2](https://github.com/georgmartius/vid.stab/blob/master/LICENSE) | | [libvorbis](https://xiph.org/vorbis/) | [1.3.7](https://xiph.org/downloads/) | 2020-07-04 | [libvorbis-1.3.7.tar.gz](http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.7.tar.gz) | Yes | [BSD-style license](https://www.xiph.org/licenses/bsd/) | -| [libvpx](https://www.webmproject.org/code/) | [1.14.1](https://chromium.googlesource.com/webm/libvpx.git/) | 2024-05-30 | | No | [BSD-style license](https://github.com/webmproject/libvpx/blob/master/LICENSE) | +| [libvpx](https://www.webmproject.org/code/) | [1.14.1](https://chromium.googlesource.com/webm/libvpx.git/) | 2024-05-30 | [v1.14.1](https://chromium.googlesource.com/webm/libvpx.git/+/refs/tags/v1.14.1) | No | [BSD-style license](https://github.com/webmproject/libvpx/blob/master/LICENSE) | | [libwebp](https://developers.google.com/speed/webp/) | [1.4.0](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html) | 2024-04-13 | [libwebp-1.4.0.tar.gz](https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.4.0.tar.gz) | No | [BSD-style license](https://github.com/webmproject/libvpx/blob/master/LICENSE) | -| [libmp3lame](http://lame.sourceforge.net/) | [3.100](http://lame.sourceforge.net/download.php) | 2017-10-13 | [lame-3.100.tar.gz](https://sourceforge.net/projects/lame/files/lame/3.100/lame-3.100.tar.gz) | No | [GNU Lesser General Public License (LGPL) version 2.1](http://lame.cvs.sourceforge.net/viewvc/lame/lame/LICENSE?revision=1.9) | +| [libx264](https://www.videolan.org/developers/x264.html) | [20191217-2245-stable](https://download.videolan.org/pub/videolan/x264/snapshots/) | 2019-12-17 | [x264-snapshot-20191217-2245-stable.tar.bz2](https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20191217-2245-stable.tar.bz2) | No | [GNU General Public License (GPL) version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) | +| [libx265](http://x265.org/) | [4.0](http://ftp.videolan.org/pub/videolan/x265/) | 2024-09-13 | [x265_4.0.tar.gz](http://ftp.videolan.org/pub/videolan/x265/x265_4.0.tar.gz) | No | [GNU General Public License (GPL) version 2](https://bitbucket.org/multicoreware/x265/raw/f8ae7afc1f61ed0db3b2f23f5d581706fe6ed677/COPYING) | | [libxvid](https://www.xvid.com/) | [1.3.7](https://labs.xvid.com/source/) | 2019 | [xvidcore-1.3.7.tar.gz](https://downloads.xvid.com/downloads/xvidcore-1.3.7.tar.gz) | No | [GNU General Public Licence (GPL) version 2](http://websvn.xvid.org/cvs/viewvc.cgi/trunk/xvidcore/LICENSE?revision=851) | -| [libfdk-aac](https://github.com/mstorsjo/fdk-aac) | [2.0.3](https://github.com/mstorsjo/fdk-aac/tags) | 2023-12-21 | [fdk-aac-2.0.3.tar.gz](https://github.com/mstorsjo/fdk-aac/archive/refs/tags/v2.0.3.tar.gz) | No | [Liberal but not a license of patented technologies](https://github.com/mstorsjo/fdk-aac/blob/master/NOTICE) | -| [openjpeg](https://github.com/uclouvain/openjpeg) | [2.5.2](https://github.com/uclouvain/openjpeg/releases) | 2024-02-28 | [openjpeg-2.5.2.tar.gz](https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.2.tar.gz) | No | [BSD-style license](https://github.com/uclouvain/openjpeg/blob/master/LICENSE) | -| [freetype](https://www.freetype.org/) | [2.13.3](http://download.savannah.gnu.org/releases/freetype/) | 2024-08-12 | [freetype-2.13.3.tar.gz](http://download.savannah.gnu.org/releases/freetype/freetype-2.13.3.tar.gz) | No | [GNU General Public License (GPL) version 2](https://www.freetype.org/license.html) | -| [libvidstab](https://github.com/georgmartius/vid.stab) | [1.1.1](https://github.com/georgmartius/vid.stab/tags) | 2022-05-30 | [vid.stab-1.1.1.tar.gz](https://github.com/georgmartius/vid.stab/archive/v1.1.1.tar.gz) | No | [GNU General Public License (GPL) version 2](https://github.com/georgmartius/vid.stab/blob/master/LICENSE) | -| [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/) | [2.15.0](https://www.freedesktop.org/software/fontconfig/release/) | 2023-12-22 | [fontconfig-2.15.0.tar.gz](https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.15.0.tar.gz) | No | []() | -| [kvazaar](https://github.com/ultravideo/kvazaar) | [2.3.1](https://github.com/ultravideo/kvazaar/releases) | 2024-04-10 | [kvazaar-2.3.1.tar.gz](https://github.com/ultravideo/kvazaar/releases/download/v2.3.1/kvazaar-2.3.1.tar.gz) | No | [BSD 3-Clause](https://github.com/ultravideo/kvazaar/blob/master/LICENSE`) | -| [aom](https://aomedia.googlesource.com/aom) | [3.10.0](https://aomedia.googlesource.com/aom/+refs) | 2024-08-01 | | No | [Alliance for Open Media](https://aomedia.org/license/software-license/) | -| [nvidia-codec-headers](https://github.com/FFmpeg/nv-codec-headers) | [12.2.72.0]() | 2024-03-31 | [nv-codec-headers-12.2.72.0.tar.gz](https://github.com/FFmpeg/nv-codec-headers/releases/download/n12.2.72.0/nv-codec-headers-12.2.72.0.tar.gz) | No | []() | -| [libsvtav1](https://gitlab.com/AOMediaCodec/SVT-AV1) | [2.2.1](https://gitlab.com/AOMediaCodec/SVT-AV1/-/tags) | 2024-08-01 | [SVT-AV1-v2.2.1.tar.gz](https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v2.2.1/SVT-AV1-v2.2.1.tar.gz) | No | [BSD 3-Clause Clear License](https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/LICENSE.md?ref_type=heads) | -| [xproto](https://www.x.org/releases/individual/proto/) | [7.0.31](https://www.x.org/releases/individual/proto/) | 2016-09-23 | [xproto-7.0.31.tar.gz](https://www.x.org/releases/individual/proto/xproto-7.0.31.tar.gz) | No | [The MIT License](https://opensource.org/licenses/MIT) | -| [libpthread-stubs](https://www.x.org/releases/individual/lib/) | [0.5](https://www.x.org/releases/individual/lib/) | 2023-07-18 | [libpthread-stubs-0.5.tar.xz](https://www.x.org/releases/individual/lib/libpthread-stubs-0.5.tar.xz) | No | [The MIT License](https://opensource.org/licenses/MIT) | -| [libbluray](https://www.videolan.org/developers/libbluray.html) | [1.3.4](https://download.videolan.org/pub/videolan/libbluray/) | 2022-11-26 | [libbluray-1.3.4.tar.bz2](https://download.videolan.org/pub/videolan/libbluray/1.3.4/libbluray-1.3.4.tar.bz2) | No | [GNU General Public License (GPL) version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) | | [libzmq](https://github.com/zeromq/libzmq/) | [4.3.5](https://github.com/zeromq/libzmq/releases/) | 2023-10-9 | [zeromq-4.3.5.tar.gz](https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz) | No | [Mozilla Public License (MPL) version 2.0](https://github.com/zeromq/libzmq/blob/v4.3.5/LICENSE) | +| [nvidia-codec-headers](https://github.com/FFmpeg/nv-codec-headers) | [12.2.72.0]() | 2024-03-31 | [nv-codec-headers-12.2.72.0.tar.gz](https://github.com/FFmpeg/nv-codec-headers/releases/download/n12.2.72.0/nv-codec-headers-12.2.72.0.tar.gz) | No | []() | +| [openjpeg](https://github.com/uclouvain/openjpeg) | [2.5.2](https://github.com/uclouvain/openjpeg/releases) | 2024-02-28 | [openjpeg-2.5.2.tar.gz](https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.2.tar.gz) | No | [BSD-style license](https://github.com/uclouvain/openjpeg/blob/master/LICENSE) | +| [xorgproto](https://www.x.org/releases/individual/proto/) | [2024.1](https://www.x.org/releases/individual/proto/) | 2024-04-12 | [xorgproto-2024.1.tar.xz](https://www.x.org/releases/individual/proto/xorgproto-2024.1.tar.xz) | No | [The MIT License](https://opensource.org/licenses/MIT) | | [libaribb24](https://github.com/nkoriyama/aribb24/) | [1.0.3](https://github.com/nkoriyama/aribb24/releases) | 2014-08-18 | [aribb24-v1.0.3.tar.gz](https://github.com/nkoriyama/aribb24/archive/refs/tags/v1.0.3.tar.gz) | No | [GNU Lesser General Public License (LGPL) version 2.1 or newer](https://github.com/nkoriyama/aribb24/issues/9) | | [zimg](https://github.com/sekrit-twc/zimg) | [3.0.5](https://github.com/sekrit-twc/zimg/releases) | 2023-6-30 | [zimg-3.0.5.tar.gz](https://github.com/sekrit-twc/zimg/archive/refs/tags/release-3.0.5.tar.gz) | No | [WTFPL](https://github.com/sekrit-twc/zimg?tab=WTFPL-1-ov-file) | -| [libtheora](https://xiph.org/downloads/) | [1.1.1](https://xiph.org/downloads/) | 2010-01-25 | [libtheora-1.1.1.tar.gz](https://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz) | No | [BSD-style license](https://git.xiph.org/?p=mirrors/theora.git;a=blob_plain;f=COPYING;hb=HEAD) | +| [libtheora](https://xiph.org/downloads/) | [1.2.0](https://xiph.org/downloads/) | 2025-03-29 | [libtheora-1.2.0.tar.gz](https://downloads.xiph.org/releases/theora/libtheora-1.2.0.tar.gz) | No | [BSD-style license](https://git.xiph.org/?p=mirrors/theora.git;a=blob_plain;f=COPYING;hb=HEAD) | | [libsrt](https://github.com/Haivision/srt) | [1.5.3](https://github.com/Haivision/srt/releases/) | 2023-09-07 | [srt-v1.5.3.tar.gz](https://github.com/Haivision/srt/archive/refs/tags/v1.5.3.tar.gz) | No | [Mozilla Public License (MPL) version 2.0](https://github.com/Haivision/srt/blob/master/LICENSE) | | [libvmaf](https://github.com/Netflix/vmaf) | [3.0.0](https://github.com/Netflix/vmaf/releases) | 2023-12-07 | [vmaf-v3.0.0.tar.gz](https://github.com/Netflix/vmaf/archive/refs/tags/v3.0.0.tar.gz) | No | [BSD-2-Clause](https://github.com/Netflix/vmaf/blob/master/LICENSE) | | [ffmpeg-7.1](http://ffmpeg.org/) | [7.1](http://ffmpeg.org/releases/) | 2024-09-30 | [ffmpeg-7.1.tar.bz2](https://ffmpeg.org/releases/ffmpeg-7.1.tar.bz2) | No | [GNU Lesser General Public License (LGPL) version 2.1](https://ffmpeg.org/legal.html) | @@ -320,10 +307,10 @@ These libs are included in the package images as well, but the version numbers m ## Contribute -See [the contributing guide](CONTRIBUTING.md) +See [the contributing guide](https://github.com/jrottenberg/ffmpeg/blob/main/CONTRIBUTING.md) ## Legal -Those docker images use code of FFmpeg licensed under the LGPLv2.1 and their source can be downloaded on github.com/jrottenberg/ffmpeg. +Those docker images use code of [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html) and their source can be downloaded on [github.com/jrottenberg/ffmpeg](https://github.com/jrottenberg/ffmpeg). diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index dd40002ff..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,37 +0,0 @@ -variables: - - group: videotoolsbuild-dockerhub - - name: DOCKER - value: jrottenberg/ffmpeg - - name: GHCR - value: ghcr.io/jrottenberg/ffmpeg - -stages: - - stage: lint - jobs: - - job: precommit - pool: - vmImage: ubuntu-latest - variables: - PRE_COMMIT_HOME: $(Pipeline.Workspace)/pre-commit-cache - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: "3.14" - - - script: | - echo "##vso[task.setvariable variable=PY]$(python -VV)" - displayName: set version variables - - task: CacheBeta@0 - inputs: - key: pre-commit | "4" | .pre-commit-config.yaml | "$(PY)" - path: $(PRE_COMMIT_HOME) - - - script: python -m pip install --upgrade pre-commit packaging - displayName: install python deps - - script: pre-commit run --all-files --show-diff-on-failure - displayName: run pre-commit - - - stage: Build_Docker_Images - jobs: - - template: docker-images/azure-jobs.yml diff --git a/azure-steps.yml b/azure-steps.yml deleted file mode 100644 index 2c99c62df..000000000 --- a/azure-steps.yml +++ /dev/null @@ -1,44 +0,0 @@ -steps: - - bash: | - set -eu - docker build -t ${DOCKER}:${VERSION}-${VARIANT} -t ${DOCKER}:${LONG_VERSION}-${VARIANT} -t ${GHCR}/${VERSION}-${VARIANT} -t ${GHCR}/${LONG_VERSION}-${VARIANT} --build-arg MAKEFLAGS="-j$(($(grep -c ^processor /proc/cpuinfo) + 1))" docker-images/${VERSION}/${VARIANT} - docker run --rm ${DOCKER}:${LONG_VERSION}-${VARIANT} -buildconf - docker images - displayName: Build docker image - - - bash: | - set -eu - echo ${DOCKER_PASSWORD} | docker login --username ${DOCKER_LOGIN} --password-stdin - docker push ${DOCKER}:${VERSION}-${VARIANT} - docker push ${DOCKER}:${LONG_VERSION}-${VARIANT} - - echo ${GHCR_PAT} | docker login ghcr.io --username USERNAME --password-stdin - docker push ${GHCR}/${VERSION}-${VARIANT} - docker push ${GHCR}/${LONG_VERSION}-${VARIANT} - - if [ "${ISPARENT}" == "True" ] && [ "${VARIANT}" != "${PARENT}" ] - then - docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:${VERSION}-${PARENT}" - docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:${MAJOR_VERSION}-${PARENT}" - docker push "${DOCKER}:${VERSION}-${PARENT}" - docker push "${DOCKER}:${MAJOR_VERSION}-${PARENT}" - - docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${GHCR}:${VERSION}-${PARENT}" - docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${GHCR}:${MAJOR_VERSION}-${PARENT}" - docker push "${GHCR}:${VERSION}-${PARENT}" - docker push "${GHCR}:${MAJOR_VERSION}-${PARENT}" - fi - - if [ "${ISLATEST:-False}" == "True" ] - then - docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${DOCKER}:latest" - docker push "${DOCKER}:latest" - - docker tag "${DOCKER}:${LONG_VERSION}-${VARIANT}" "${GHCR}:latest" - docker push "${GHCR}:latest" - fi - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) - displayName: Push docker image - env: - DOCKER_PASSWORD: $(docker.password) - GHCR_PAT: $(ghcr.pat) diff --git a/build_source.sh b/build_source.sh index e1fe5fbab..24ace8470 100755 --- a/build_source.sh +++ b/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install diff --git a/docker-images/8.0/alpine320/Dockerfile b/docker-images/8.0/alpine320/Dockerfile index 83d7ca963..c21e3acb4 100644 --- a/docker-images/8.0/alpine320/Dockerfile +++ b/docker-images/8.0/alpine320/Dockerfile @@ -11,7 +11,7 @@ RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl ENV FFMPEG_VERSION=8.0.1 -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/docker-images/8.0/alpine320/build_source.sh b/docker-images/8.0/alpine320/build_source.sh index 217191a3d..3cbc4b7f5 100755 --- a/docker-images/8.0/alpine320/build_source.sh +++ b/docker-images/8.0/alpine320/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -370,8 +386,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.0/alpine320/download_tarballs.sh b/docker-images/8.0/alpine320/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.0/alpine320/download_tarballs.sh +++ b/docker-images/8.0/alpine320/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.0/alpine320/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.0/alpine320/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.0/alpine320/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.0/alpine320/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.0/alpine320/install_ffmpeg.sh b/docker-images/8.0/alpine320/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.0/alpine320/install_ffmpeg.sh +++ b/docker-images/8.0/alpine320/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.0/nvidia2404/Dockerfile b/docker-images/8.0/nvidia2404/Dockerfile index f062cf143..8d09abee9 100644 --- a/docker-images/8.0/nvidia2404/Dockerfile +++ b/docker-images/8.0/nvidia2404/Dockerfile @@ -43,7 +43,7 @@ ENV NVIDIA_HEADERS_VERSION=11.1.5.3 ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -103,7 +103,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/docker-images/8.0/nvidia2404/build_source.sh b/docker-images/8.0/nvidia2404/build_source.sh index 3816785f3..86575047b 100755 --- a/docker-images/8.0/nvidia2404/build_source.sh +++ b/docker-images/8.0/nvidia2404/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -375,8 +391,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I${PREFIX}/include/ffnvcodec -I/usr/local/cuda/include/ -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/ -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I${PREFIX}/include/ffnvcodec -I/usr/local/cuda/include/ -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/ -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.0/nvidia2404/download_tarballs.sh b/docker-images/8.0/nvidia2404/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.0/nvidia2404/download_tarballs.sh +++ b/docker-images/8.0/nvidia2404/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.0/nvidia2404/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.0/nvidia2404/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.0/nvidia2404/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.0/nvidia2404/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.0/nvidia2404/install_ffmpeg.sh b/docker-images/8.0/nvidia2404/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.0/nvidia2404/install_ffmpeg.sh +++ b/docker-images/8.0/nvidia2404/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.0/scratch320/Dockerfile b/docker-images/8.0/scratch320/Dockerfile index d5a99eaa1..189eaeba3 100644 --- a/docker-images/8.0/scratch320/Dockerfile +++ b/docker-images/8.0/scratch320/Dockerfile @@ -12,7 +12,7 @@ RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl ENV FFMPEG_VERSION=8.0.1 -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" @@ -81,7 +81,7 @@ COPY install_ffmpeg.sh /tmp/workdir # ex: '--library-list lib1,lib2,lib3' # for more control over the build process, and how the docker layers are cached -# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg +# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xorgproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg # dont do this πŸ‘† where all of the libs are built at one time. # by splitting them up into batches we allow docker to cache the layers ( which is a lifesaver when debugging ) # I left this line in here, as it shows the proper order of the libraries that need to be built. ( what worked ) @@ -136,8 +136,7 @@ RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh # additional batch of libraries ( split into docker layers, to allow for caching ) -# note: took out 'xproto' because of the configure.guess error -RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libxau +RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xorgproto,libxau RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh diff --git a/docker-images/8.0/scratch320/build_source.sh b/docker-images/8.0/scratch320/build_source.sh index 217191a3d..3cbc4b7f5 100755 --- a/docker-images/8.0/scratch320/build_source.sh +++ b/docker-images/8.0/scratch320/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -370,8 +386,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.0/scratch320/download_tarballs.sh b/docker-images/8.0/scratch320/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.0/scratch320/download_tarballs.sh +++ b/docker-images/8.0/scratch320/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.0/scratch320/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.0/scratch320/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.0/scratch320/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.0/scratch320/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.0/scratch320/install_ffmpeg.sh b/docker-images/8.0/scratch320/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.0/scratch320/install_ffmpeg.sh +++ b/docker-images/8.0/scratch320/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.0/ubuntu2404-edge/Dockerfile b/docker-images/8.0/ubuntu2404-edge/Dockerfile index 5fec66406..0a6fc0a53 100644 --- a/docker-images/8.0/ubuntu2404-edge/Dockerfile +++ b/docker-images/8.0/ubuntu2404-edge/Dockerfile @@ -33,7 +33,7 @@ ARG XML2_PKGS="libxml2-dev libxml2" # libpng ARG PNG_PKGS="libpng-dev libpng16-16t64" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" @@ -87,7 +87,7 @@ RUN buildDeps="autoconf \ # ex: '--library-list lib1,lib2,lib3' # for more control over the build process, and how the docker layers are cached -# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg +# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xorgproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg # dont do this πŸ‘† where all of the libs are built at one time. # by splitting them up into batches we allow docker to cache the layers ( which is a lifesaver when debugging ) # I left this line in here, as it shows the proper order of the libraries that need to be built. ( what worked ) @@ -136,7 +136,7 @@ RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh # additional batch of libraries ( split into docker layers, to allow for caching ) -RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xproto +RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xorgproto RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh diff --git a/docker-images/8.0/ubuntu2404-edge/build_source.sh b/docker-images/8.0/ubuntu2404-edge/build_source.sh index 217191a3d..3cbc4b7f5 100755 --- a/docker-images/8.0/ubuntu2404-edge/build_source.sh +++ b/docker-images/8.0/ubuntu2404-edge/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -370,8 +386,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.0/ubuntu2404-edge/download_tarballs.sh b/docker-images/8.0/ubuntu2404-edge/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.0/ubuntu2404-edge/download_tarballs.sh +++ b/docker-images/8.0/ubuntu2404-edge/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.0/ubuntu2404-edge/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.0/ubuntu2404-edge/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.0/ubuntu2404-edge/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.0/ubuntu2404-edge/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.0/ubuntu2404-edge/install_ffmpeg.sh b/docker-images/8.0/ubuntu2404-edge/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.0/ubuntu2404-edge/install_ffmpeg.sh +++ b/docker-images/8.0/ubuntu2404-edge/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.0/ubuntu2404/Dockerfile b/docker-images/8.0/ubuntu2404/Dockerfile index 74cc0164d..3ab0c5a70 100644 --- a/docker-images/8.0/ubuntu2404/Dockerfile +++ b/docker-images/8.0/ubuntu2404/Dockerfile @@ -38,7 +38,7 @@ ENV FFMPEG_VERSION=8.0.1 ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -98,7 +98,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/docker-images/8.0/ubuntu2404/build_source.sh b/docker-images/8.0/ubuntu2404/build_source.sh index 217191a3d..3cbc4b7f5 100755 --- a/docker-images/8.0/ubuntu2404/build_source.sh +++ b/docker-images/8.0/ubuntu2404/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -370,8 +386,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.0/ubuntu2404/download_tarballs.sh b/docker-images/8.0/ubuntu2404/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.0/ubuntu2404/download_tarballs.sh +++ b/docker-images/8.0/ubuntu2404/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.0/ubuntu2404/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.0/ubuntu2404/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.0/ubuntu2404/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.0/ubuntu2404/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.0/ubuntu2404/install_ffmpeg.sh b/docker-images/8.0/ubuntu2404/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.0/ubuntu2404/install_ffmpeg.sh +++ b/docker-images/8.0/ubuntu2404/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.0/vaapi2404/Dockerfile b/docker-images/8.0/vaapi2404/Dockerfile index 0eeda8c1e..721f19a4b 100644 --- a/docker-images/8.0/vaapi2404/Dockerfile +++ b/docker-images/8.0/vaapi2404/Dockerfile @@ -40,7 +40,7 @@ ENV FFMPEG_VERSION=8.0.1 ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -100,7 +100,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/docker-images/8.0/vaapi2404/build_source.sh b/docker-images/8.0/vaapi2404/build_source.sh index 53f0bcdde..447562c55 100755 --- a/docker-images/8.0/vaapi2404/build_source.sh +++ b/docker-images/8.0/vaapi2404/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -371,8 +387,9 @@ build_ffmpeg() { --enable-vaapi \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.0/vaapi2404/download_tarballs.sh b/docker-images/8.0/vaapi2404/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.0/vaapi2404/download_tarballs.sh +++ b/docker-images/8.0/vaapi2404/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.0/vaapi2404/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.0/vaapi2404/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.0/vaapi2404/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.0/vaapi2404/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.0/vaapi2404/install_ffmpeg.sh b/docker-images/8.0/vaapi2404/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.0/vaapi2404/install_ffmpeg.sh +++ b/docker-images/8.0/vaapi2404/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.1/alpine320/Dockerfile b/docker-images/8.1/alpine320/Dockerfile index fa5423cbc..2047fd3b8 100644 --- a/docker-images/8.1/alpine320/Dockerfile +++ b/docker-images/8.1/alpine320/Dockerfile @@ -11,7 +11,7 @@ RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl ENV FFMPEG_VERSION=8.1.0 -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/docker-images/8.1/alpine320/build_source.sh b/docker-images/8.1/alpine320/build_source.sh index 217191a3d..3cbc4b7f5 100755 --- a/docker-images/8.1/alpine320/build_source.sh +++ b/docker-images/8.1/alpine320/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -370,8 +386,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.1/alpine320/download_tarballs.sh b/docker-images/8.1/alpine320/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.1/alpine320/download_tarballs.sh +++ b/docker-images/8.1/alpine320/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.1/alpine320/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.1/alpine320/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.1/alpine320/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.1/alpine320/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.1/alpine320/install_ffmpeg.sh b/docker-images/8.1/alpine320/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.1/alpine320/install_ffmpeg.sh +++ b/docker-images/8.1/alpine320/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.1/nvidia2404/Dockerfile b/docker-images/8.1/nvidia2404/Dockerfile index 476bbe1a2..16c6eb135 100644 --- a/docker-images/8.1/nvidia2404/Dockerfile +++ b/docker-images/8.1/nvidia2404/Dockerfile @@ -43,7 +43,7 @@ ENV NVIDIA_HEADERS_VERSION=11.1.5.3 ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -103,7 +103,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/docker-images/8.1/nvidia2404/build_source.sh b/docker-images/8.1/nvidia2404/build_source.sh index 3816785f3..86575047b 100755 --- a/docker-images/8.1/nvidia2404/build_source.sh +++ b/docker-images/8.1/nvidia2404/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -375,8 +391,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I${PREFIX}/include/ffnvcodec -I/usr/local/cuda/include/ -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/ -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I${PREFIX}/include/ffnvcodec -I/usr/local/cuda/include/ -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/local/cuda/lib64 -L/usr/local/cuda/lib32/ -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.1/nvidia2404/download_tarballs.sh b/docker-images/8.1/nvidia2404/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.1/nvidia2404/download_tarballs.sh +++ b/docker-images/8.1/nvidia2404/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.1/nvidia2404/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.1/nvidia2404/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.1/nvidia2404/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.1/nvidia2404/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.1/nvidia2404/install_ffmpeg.sh b/docker-images/8.1/nvidia2404/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.1/nvidia2404/install_ffmpeg.sh +++ b/docker-images/8.1/nvidia2404/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.1/scratch320/Dockerfile b/docker-images/8.1/scratch320/Dockerfile index 1ef2f51d5..30e885eb2 100644 --- a/docker-images/8.1/scratch320/Dockerfile +++ b/docker-images/8.1/scratch320/Dockerfile @@ -12,7 +12,7 @@ RUN apk add --no-cache --update libgcc libstdc++ ca-certificates openssl ENV FFMPEG_VERSION=8.1.0 -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" @@ -81,7 +81,7 @@ COPY install_ffmpeg.sh /tmp/workdir # ex: '--library-list lib1,lib2,lib3' # for more control over the build process, and how the docker layers are cached -# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg +# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xorgproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg # dont do this πŸ‘† where all of the libs are built at one time. # by splitting them up into batches we allow docker to cache the layers ( which is a lifesaver when debugging ) # I left this line in here, as it shows the proper order of the libraries that need to be built. ( what worked ) @@ -136,8 +136,7 @@ RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh # additional batch of libraries ( split into docker layers, to allow for caching ) -# note: took out 'xproto' because of the configure.guess error -RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libxau +RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xorgproto,libxau RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh diff --git a/docker-images/8.1/scratch320/build_source.sh b/docker-images/8.1/scratch320/build_source.sh index 217191a3d..3cbc4b7f5 100755 --- a/docker-images/8.1/scratch320/build_source.sh +++ b/docker-images/8.1/scratch320/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -370,8 +386,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.1/scratch320/download_tarballs.sh b/docker-images/8.1/scratch320/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.1/scratch320/download_tarballs.sh +++ b/docker-images/8.1/scratch320/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.1/scratch320/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.1/scratch320/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.1/scratch320/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.1/scratch320/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.1/scratch320/install_ffmpeg.sh b/docker-images/8.1/scratch320/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.1/scratch320/install_ffmpeg.sh +++ b/docker-images/8.1/scratch320/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.1/ubuntu2404-edge/Dockerfile b/docker-images/8.1/ubuntu2404-edge/Dockerfile index be689ea7b..0e4131ce7 100644 --- a/docker-images/8.1/ubuntu2404-edge/Dockerfile +++ b/docker-images/8.1/ubuntu2404-edge/Dockerfile @@ -33,7 +33,7 @@ ARG XML2_PKGS="libxml2-dev libxml2" # libpng ARG PNG_PKGS="libpng-dev libpng16-16t64" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" @@ -87,7 +87,7 @@ RUN buildDeps="autoconf \ # ex: '--library-list lib1,lib2,lib3' # for more control over the build process, and how the docker layers are cached -# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg +# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xorgproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg # dont do this πŸ‘† where all of the libs are built at one time. # by splitting them up into batches we allow docker to cache the layers ( which is a lifesaver when debugging ) # I left this line in here, as it shows the proper order of the libraries that need to be built. ( what worked ) @@ -136,7 +136,7 @@ RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh # additional batch of libraries ( split into docker layers, to allow for caching ) -RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xproto +RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xorgproto RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh diff --git a/docker-images/8.1/ubuntu2404-edge/build_source.sh b/docker-images/8.1/ubuntu2404-edge/build_source.sh index 217191a3d..3cbc4b7f5 100755 --- a/docker-images/8.1/ubuntu2404-edge/build_source.sh +++ b/docker-images/8.1/ubuntu2404-edge/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -370,8 +386,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.1/ubuntu2404-edge/download_tarballs.sh b/docker-images/8.1/ubuntu2404-edge/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.1/ubuntu2404-edge/download_tarballs.sh +++ b/docker-images/8.1/ubuntu2404-edge/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.1/ubuntu2404-edge/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.1/ubuntu2404-edge/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.1/ubuntu2404-edge/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.1/ubuntu2404-edge/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.1/ubuntu2404-edge/install_ffmpeg.sh b/docker-images/8.1/ubuntu2404-edge/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.1/ubuntu2404-edge/install_ffmpeg.sh +++ b/docker-images/8.1/ubuntu2404-edge/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.1/ubuntu2404/Dockerfile b/docker-images/8.1/ubuntu2404/Dockerfile index 955197e67..c18f92415 100644 --- a/docker-images/8.1/ubuntu2404/Dockerfile +++ b/docker-images/8.1/ubuntu2404/Dockerfile @@ -38,7 +38,7 @@ ENV FFMPEG_VERSION=8.1.0 ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -98,7 +98,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/docker-images/8.1/ubuntu2404/build_source.sh b/docker-images/8.1/ubuntu2404/build_source.sh index 217191a3d..3cbc4b7f5 100755 --- a/docker-images/8.1/ubuntu2404/build_source.sh +++ b/docker-images/8.1/ubuntu2404/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -370,8 +386,9 @@ build_ffmpeg() { --enable-small \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.1/ubuntu2404/download_tarballs.sh b/docker-images/8.1/ubuntu2404/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.1/ubuntu2404/download_tarballs.sh +++ b/docker-images/8.1/ubuntu2404/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.1/ubuntu2404/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.1/ubuntu2404/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.1/ubuntu2404/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.1/ubuntu2404/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.1/ubuntu2404/install_ffmpeg.sh b/docker-images/8.1/ubuntu2404/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.1/ubuntu2404/install_ffmpeg.sh +++ b/docker-images/8.1/ubuntu2404/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/8.1/vaapi2404/Dockerfile b/docker-images/8.1/vaapi2404/Dockerfile index a07e88552..d6f1ab585 100644 --- a/docker-images/8.1/vaapi2404/Dockerfile +++ b/docker-images/8.1/vaapi2404/Dockerfile @@ -40,7 +40,7 @@ ENV FFMPEG_VERSION=8.1.0 ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -100,7 +100,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/docker-images/8.1/vaapi2404/build_source.sh b/docker-images/8.1/vaapi2404/build_source.sh index 53f0bcdde..447562c55 100755 --- a/docker-images/8.1/vaapi2404/build_source.sh +++ b/docker-images/8.1/vaapi2404/build_source.sh @@ -18,6 +18,12 @@ if [[ "$OS_NAME" == "Linux" ]]; then is_alpine=true fi fi + +ARCH=$(uname -m) +is_x86=false +if [[ "$ARCH" == "x86_64" ]]; then + is_x86=true +fi ######################### Callback build functions ######################### build_libopencore-amr() { ./configure --prefix="${PREFIX}" --enable-shared @@ -35,6 +41,9 @@ build_libx265() { cd build/linux sed -i "/-DEXTRA_LIB/ s/$/ -DCMAKE_INSTALL_PREFIX=\${PREFIX}/" multilib.sh sed -i "/^cmake/ s/$/ -DENABLE_CLI=OFF/" multilib.sh + if [ "$is_x86" = false ]; then + sed -i "/^cmake/ s/$/ -DENABLE_ASSEMBLY=OFF/" multilib.sh + fi ./multilib.sh make -C 8bit install } @@ -74,7 +83,11 @@ build_libvpx() { git -C libvpx pull 2> /dev/null || git clone --branch ${version} --depth 1 https://chromium.googlesource.com/webm/libvpx.git cd libvpx pwd - ./configure --prefix="${PREFIX}" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared --as=yasm + local vpx_configure_flags="--prefix=${PREFIX} --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --enable-pic --enable-shared" + if [ "$is_x86" = true ]; then + vpx_configure_flags="${vpx_configure_flags} --as=yasm" + fi + ./configure ${vpx_configure_flags} make make install } @@ -86,7 +99,11 @@ build_libwebp() { } build_libmp3lame() { - ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared --enable-nasm --disable-frontend && \ + local nasm_flag="--enable-nasm" + if [ "$is_x86" = false ]; then + nasm_flag="--disable-nasm" + fi + ./configure --prefix="${PREFIX}" --bindir="${PREFIX}/bin" --enable-shared ${nasm_flag} --disable-frontend && \ make && \ make install } @@ -137,9 +154,9 @@ build_fribidi() { } build_fontconfig() { - ./configure --prefix="${PREFIX}" --disable-static --enable-shared && \ - make && \ - make install + meson setup build --prefix="${PREFIX}" --default-library=shared && \ + ninja -C build && \ + ninja -C build install } build_libass() { @@ -171,7 +188,11 @@ build_aom() { cd ${dir} && \ mkdir -p ./aom_build && \ cd ./aom_build && \ - cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 -DENABLE_NASM=on .. && \ + local nasm_flag="-DENABLE_NASM=on" + if [ "$is_x86" = false ]; then + nasm_flag="-DENABLE_NASM=off" + fi + cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DBUILD_SHARED_LIBS=1 ${nasm_flag} .. && \ make && \ make install } @@ -198,12 +219,10 @@ build_xorg-macros() { make install } -build_xproto() { - dir=${1} - cp /usr/share/misc/config.guess . && \ - ./configure --srcdir=${dir} --prefix="${PREFIX}" && \ - make && \ - make install +build_xorgproto() { + meson setup build --prefix="${PREFIX}" && \ + ninja -C build && \ + ninja -C build install } build_libxau() { @@ -266,9 +285,6 @@ build_zimg() { # Dependancy on libogg build_libtheora() { - if [ "$is_ubuntu" = true ]; then - cp /usr/share/misc/config.guess . - fi ./configure --prefix="${PREFIX}" --with-ogg="${PREFIX}" --enable-shared --disable-examples make make install @@ -371,8 +387,9 @@ build_ffmpeg() { --enable-vaapi \ --enable-version3 \ --enable-whisper \ - --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu" \ - --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib" \ + --extra-cflags="-I${PREFIX}/include -I/usr/include/x86_64-linux-gnu -I/usr/include/aarch64-linux-gnu" \ + --extra-ldflags="-L${PREFIX}/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/aarch64-linux-gnu -L/usr/lib" \ + --extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu \ --extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu \ --extra-libs=-ldl \ --extra-libs=-lm \ diff --git a/docker-images/8.1/vaapi2404/download_tarballs.sh b/docker-images/8.1/vaapi2404/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/docker-images/8.1/vaapi2404/download_tarballs.sh +++ b/docker-images/8.1/vaapi2404/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/docker-images/8.1/vaapi2404/generate-source-of-truth-ffmpeg-versions.py b/docker-images/8.1/vaapi2404/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/docker-images/8.1/vaapi2404/generate-source-of-truth-ffmpeg-versions.py +++ b/docker-images/8.1/vaapi2404/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/docker-images/8.1/vaapi2404/install_ffmpeg.sh b/docker-images/8.1/vaapi2404/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/docker-images/8.1/vaapi2404/install_ffmpeg.sh +++ b/docker-images/8.1/vaapi2404/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/docker-images/azure-jobs.yml b/docker-images/azure-jobs.yml deleted file mode 100644 index 0849267e6..000000000 --- a/docker-images/azure-jobs.yml +++ /dev/null @@ -1,131 +0,0 @@ - - -jobs: -- job: Build_Docker_Images - pool: - vmImage: ubuntu-latest - strategy: - maxParallel: 10 - matrix: - - ubuntu2404_8.1.0: - MAJOR_VERSION: 8 - VERSION: 8.1 - LONG_VERSION: 8.1.0 - VARIANT: ubuntu2404 - PARENT: ubuntu - ISPARENT: True - ISLATEST: False - - - ubuntu2404-edge_8.1.0: - MAJOR_VERSION: 8 - VERSION: 8.1 - LONG_VERSION: 8.1.0 - VARIANT: ubuntu2404-edge - PARENT: ubuntu-edge - ISPARENT: True - ISLATEST: False - - - alpine320_8.1.0: - MAJOR_VERSION: 8 - VERSION: 8.1 - LONG_VERSION: 8.1.0 - VARIANT: alpine320 - PARENT: alpine - ISPARENT: True - ISLATEST: False - - - scratch320_8.1.0: - MAJOR_VERSION: 8 - VERSION: 8.1 - LONG_VERSION: 8.1.0 - VARIANT: scratch320 - PARENT: scratch - ISPARENT: True - ISLATEST: False - - - vaapi2404_8.1.0: - MAJOR_VERSION: 8 - VERSION: 8.1 - LONG_VERSION: 8.1.0 - VARIANT: vaapi2404 - PARENT: vaapi - ISPARENT: True - ISLATEST: False - - - nvidia2404_8.1.0: - MAJOR_VERSION: 8 - VERSION: 8.1 - LONG_VERSION: 8.1.0 - VARIANT: nvidia2404 - PARENT: nvidia - ISPARENT: True - ISLATEST: False - - - ubuntu2404_8.0.1: - MAJOR_VERSION: 8 - VERSION: 8.0 - LONG_VERSION: 8.0.1 - VARIANT: ubuntu2404 - PARENT: ubuntu - ISPARENT: True - ISLATEST: True - - - ubuntu2404-edge_8.0.1: - MAJOR_VERSION: 8 - VERSION: 8.0 - LONG_VERSION: 8.0.1 - VARIANT: ubuntu2404-edge - PARENT: ubuntu-edge - ISPARENT: True - ISLATEST: False - - - alpine320_8.0.1: - MAJOR_VERSION: 8 - VERSION: 8.0 - LONG_VERSION: 8.0.1 - VARIANT: alpine320 - PARENT: alpine - ISPARENT: True - ISLATEST: False - - - scratch320_8.0.1: - MAJOR_VERSION: 8 - VERSION: 8.0 - LONG_VERSION: 8.0.1 - VARIANT: scratch320 - PARENT: scratch - ISPARENT: True - ISLATEST: False - - - vaapi2404_8.0.1: - MAJOR_VERSION: 8 - VERSION: 8.0 - LONG_VERSION: 8.0.1 - VARIANT: vaapi2404 - PARENT: vaapi - ISPARENT: True - ISLATEST: False - - - nvidia2404_8.0.1: - MAJOR_VERSION: 8 - VERSION: 8.0 - LONG_VERSION: 8.0.1 - VARIANT: nvidia2404 - PARENT: nvidia - ISPARENT: True - ISLATEST: False - - steps: - - template: ../azure-steps.yml diff --git a/docker-images/github-actions-matrix.json b/docker-images/github-actions-matrix.json new file mode 100644 index 000000000..501747893 --- /dev/null +++ b/docker-images/github-actions-matrix.json @@ -0,0 +1,386 @@ +{ + "build": [ + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "ubuntu2404", + "parent": "ubuntu", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "ubuntu2404", + "parent": "ubuntu", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/arm64", + "arch": "arm64", + "runner": "ubuntu-24.04-arm" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "ubuntu2404-edge", + "parent": "ubuntu-edge", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "ubuntu2404-edge", + "parent": "ubuntu-edge", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/arm64", + "arch": "arm64", + "runner": "ubuntu-24.04-arm" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "alpine320", + "parent": "alpine", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "alpine320", + "parent": "alpine", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/arm64", + "arch": "arm64", + "runner": "ubuntu-24.04-arm" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "scratch320", + "parent": "scratch", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "scratch320", + "parent": "scratch", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/arm64", + "arch": "arm64", + "runner": "ubuntu-24.04-arm" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "vaapi2404", + "parent": "vaapi", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "nvidia2404", + "parent": "nvidia", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "ubuntu2404", + "parent": "ubuntu", + "is_parent": "True", + "is_latest": "True", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "ubuntu2404", + "parent": "ubuntu", + "is_parent": "True", + "is_latest": "True", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/arm64", + "arch": "arm64", + "runner": "ubuntu-24.04-arm" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "ubuntu2404-edge", + "parent": "ubuntu-edge", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "ubuntu2404-edge", + "parent": "ubuntu-edge", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/arm64", + "arch": "arm64", + "runner": "ubuntu-24.04-arm" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "alpine320", + "parent": "alpine", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "alpine320", + "parent": "alpine", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/arm64", + "arch": "arm64", + "runner": "ubuntu-24.04-arm" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "scratch320", + "parent": "scratch", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "scratch320", + "parent": "scratch", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64", + "platform": "linux/arm64", + "arch": "arm64", + "runner": "ubuntu-24.04-arm" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "vaapi2404", + "parent": "vaapi", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "nvidia2404", + "parent": "nvidia", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64", + "platform": "linux/amd64", + "arch": "amd64", + "runner": "ubuntu-latest" + } + ], + "manifest": [ + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "ubuntu2404", + "parent": "ubuntu", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "ubuntu2404-edge", + "parent": "ubuntu-edge", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "alpine320", + "parent": "alpine", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "scratch320", + "parent": "scratch", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "vaapi2404", + "parent": "vaapi", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64" + }, + { + "major_version": "8", + "version": "8.1", + "long_version": "8.1.0", + "variant": "nvidia2404", + "parent": "nvidia", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "ubuntu2404", + "parent": "ubuntu", + "is_parent": "True", + "is_latest": "True", + "platforms": "linux/amd64,linux/arm64" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "ubuntu2404-edge", + "parent": "ubuntu-edge", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "alpine320", + "parent": "alpine", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "scratch320", + "parent": "scratch", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64,linux/arm64" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "vaapi2404", + "parent": "vaapi", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64" + }, + { + "major_version": "8", + "version": "8.0", + "long_version": "8.0.1", + "variant": "nvidia2404", + "parent": "nvidia", + "is_parent": "True", + "is_latest": "False", + "platforms": "linux/amd64" + } + ] +} diff --git a/docker-images/gitlab-ci.yml b/docker-images/gitlab-ci.yml index df167ff70..530b37973 100644 --- a/docker-images/gitlab-ci.yml +++ b/docker-images/gitlab-ci.yml @@ -18,6 +18,7 @@ stages: PARENT: "ubuntu" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64,linux/arm64" 8.1.0-ubuntu2404-edge: extends: .docker @@ -30,6 +31,7 @@ stages: PARENT: "ubuntu-edge" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64,linux/arm64" 8.1.0-alpine320: extends: .docker @@ -42,6 +44,7 @@ stages: PARENT: "alpine" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64,linux/arm64" 8.1.0-scratch320: extends: .docker @@ -54,6 +57,7 @@ stages: PARENT: "scratch" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64,linux/arm64" 8.1.0-vaapi2404: extends: .docker @@ -66,6 +70,7 @@ stages: PARENT: "vaapi" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64" 8.1.0-nvidia2404: extends: .docker @@ -78,6 +83,7 @@ stages: PARENT: "nvidia" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64" 8.0.1-ubuntu2404: extends: .docker @@ -90,6 +96,7 @@ stages: PARENT: "ubuntu" ISPARENT: "True" ISLATEST: "True" + PLATFORMS: "linux/amd64,linux/arm64" 8.0.1-ubuntu2404-edge: extends: .docker @@ -102,6 +109,7 @@ stages: PARENT: "ubuntu-edge" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64,linux/arm64" 8.0.1-alpine320: extends: .docker @@ -114,6 +122,7 @@ stages: PARENT: "alpine" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64,linux/arm64" 8.0.1-scratch320: extends: .docker @@ -126,6 +135,7 @@ stages: PARENT: "scratch" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64,linux/arm64" 8.0.1-vaapi2404: extends: .docker @@ -138,6 +148,7 @@ stages: PARENT: "vaapi" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64" 8.0.1-nvidia2404: extends: .docker @@ -150,3 +161,4 @@ stages: PARENT: "nvidia" ISPARENT: "True" ISLATEST: "False" + PLATFORMS: "linux/amd64" diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 000000000..2f0590212 --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,13 @@ +FROM jekyll/minimal + +RUN gem install jekyll-remote-theme webrick + +COPY docs/ /srv/jekyll/ +COPY README.md /tmp/README.md + +RUN printf -- '---\n---\n\n' > /srv/jekyll/index.md \ + && cat /tmp/README.md >> /srv/jekyll/index.md + +EXPOSE 4000 + +CMD ["jekyll", "serve", "--host", "0.0.0.0"] diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 000000000..e2cabc125 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,10 @@ +title: FFmpeg Docker Images +description: Minimalist Docker images with FFmpeg compiled from source +remote_theme: pages-themes/minimal@v0.2.0 +plugins: + - jekyll-remote-theme +defaults: + - scope: + path: "" + values: + layout: default diff --git a/docs/assets/css/style.scss b/docs/assets/css/style.scss new file mode 100644 index 000000000..aba2d9e7a --- /dev/null +++ b/docs/assets/css/style.scss @@ -0,0 +1,13 @@ +--- +--- + +@import "jekyll-theme-minimal"; + +.wrapper { + max-width: 1200px; + width: 90%; +} + +section { + width: calc(100% - 300px); +} diff --git a/download_tarballs.sh b/download_tarballs.sh index 8a12e6baf..2fcf49aa0 100755 --- a/download_tarballs.sh +++ b/download_tarballs.sh @@ -99,15 +99,17 @@ download_tarballs() { if [ ! -f "$build_dir/$tarball_name" ]; then echo "$build_dir/$tarball_name does not exist, downloading now..." cd "$build_dir" - # curl -fsSL -o "$library.tar.gz" " - # curl command line reference - # -o write output to file - # -f Fail fast with no output on HTTP errors - # -s Silent mode - # -S, --show-error Show error even when -s is used - # -L, --location Follow redirects - # --retry Retry request if transient problems occur - curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + local http_code + http_code=$(curl -sL --retry 2 -o "$tarball_name" -w "%{http_code}" "$download_url") + if [ "$http_code" = "418" ]; then + echo "Got HTTP 418 (anti-bot) for ${download_url}, waiting 60s before retry..." + rm -f "$tarball_name" + sleep 60 + curl -fsSL --retry 2 -o "$tarball_name" "$download_url" + elif [ "$http_code" -ge 400 ] 2>/dev/null; then + echo "curl: HTTP $http_code for ${download_url}" + rm -f "$tarball_name" + fi else # if not quietly, then echo that we are skipping the download [ "$quiet" = false ] && diff --git a/generate-source-of-truth-ffmpeg-versions.py b/generate-source-of-truth-ffmpeg-versions.py index 7fcfeb902..4a4e6eda7 100755 --- a/generate-source-of-truth-ffmpeg-versions.py +++ b/generate-source-of-truth-ffmpeg-versions.py @@ -33,48 +33,43 @@ """ # Library versions Source of truth -FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +AOM = {"version": "3.10.0", "release_date": "2024-08-01"} +FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} FFMPEG_80 = {"version": "8.0", "release_date": "2025-08-22"} -FFMPEG_71 = {"version": "7.1", "release_date": "2024-09-30"} -FFMPEG_70 = {"version": "7.0", "release_date": "2024-04-05"} -FFMPEG_61 = {"version": "6.1", "release_date": "2023-11-11"} -# FFMPEG_51 = {"version": "5.1", "release_date": "2022-06-22"} +FFMPEG_81 = {"version": "8.1", "release_date": "2025-11-28"} +FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} +FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} +KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} +LAME = {"version": "3.100", "release_date": "2017-10-13"} +LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} +LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} +LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} +LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} +LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} +LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} +LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} +LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} +NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} OGG = {"version": "1.3.5", "release_date": "2021-06-04"} OPENCOREAMR = {"version": "0.1.6", "release_date": "2022-08-01"} -VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} -THEORA = {"version": "1.1.1", "release_date": "2010"} -LAME = {"version": "3.100", "release_date": "2017-10-13"} +OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} OPUS = {"version": "1.5.2", "release_date": "2024-04-12"} +PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} +SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} +THEORA = {"version": "1.2.0", "release_date": "2025-03-29"} +VORBIS = {"version": "1.3.7", "release_date": "2020-07-04"} VPX = {"version": "1.14.1", "release_date": "2024-05-30"} WEBP = {"version": "1.4.0", "release_date": "2024-04-13"} -XVID = {"version": "1.3.7", "release_date": "2019"} -FDKAAC = {"version": "2.0.3", "release_date": "2023-12-21"} -FREETYPE = {"version": "2.13.3", "release_date": "2024-08-12"} -LIBVIDSTAB = {"version": "1.1.1", "release_date": "2022-05-30"} -LIBFRIDIBI = {"version": "1.0.16", "release_date": "2024-10-1"} -FONTCONFIG = {"version": "2.15.0", "release_date": "2023-12-22"} -LIBASS = {"version": "0.17.3", "release_date": "2024-07-02"} -KVAAZAAR = {"version": "2.3.1", "release_date": "2024-04-10"} -AOM = {"version": "3.10.0", "release_date": "2024-08-01"} -NV_CODEC = {"version": "12.2.72.0", "release_date": "2024-03-31"} -SVTAV1 = {"version": "2.2.1", "release_date": "2024-08-01"} -XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} -XPROTO = {"version": "7.0.31", "release_date": "2016-09-23"} -XAU = {"version": "1.0.11", "release_date": "2022-12-08"} -PTHREAD_STUBS = {"version": "0.5", "release_date": "2023-07-18"} -LIBXML2 = {"version": "2.13.4", "release_date": "2024-09-01"} -LIBBLURAY = {"version": "1.3.4", "release_date": "2022-11-26"} +WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} X264 = {"version": "20191217-2245-stable", "release_date": "2019-12-17"} X265 = {"version": "4.0", "release_date": "2024-09-13"} -LIBZMQ = {"version": "4.3.5", "release_date": "2023-10-9"} -LIBSRT = {"version": "1.5.3", "release_date": "2023-09-07"} -LIBPNG = {"version": "1.6.44", "release_date": "2024-09-12"} +XAU = {"version": "1.0.11", "release_date": "2022-12-08"} +XORG_MACROS = {"version": "1.20.1", "release_date": "2024-04-16"} +XORGPROTO = {"version": "2024.1", "release_date": "2024-04-12"} +XVID = {"version": "1.3.7", "release_date": "2019"} ZIMG = {"version": "3.0.5", "release_date": "2023-6-30"} -LIBARIBB24 = {"version": "1.0.3", "release_date": "2014-08-18"} -OPENJPEG = {"version": "2.5.2", "release_date": "2024-02-28"} -THEORA = {"version": "1.1.1", "release_date": "2010-01-25"} -LIBVMAF = {"version": "3.0.0", "release_date": "2023-12-07"} -WHISPER = {"version": "1.7.6", "release_date": "2025-06-25"} # Library details, Source of truth # TODO: store this in a yaml configuration file ( would probably be better ) @@ -353,14 +348,14 @@ ( "fontconfig", { - "link": "https://www.freedesktop.org/wiki/Software/fontconfig/", + "link": "https://gitlab.freedesktop.org/fontconfig/fontconfig", "version": FONTCONFIG["version"], - "version_link": "https://www.freedesktop.org/software/fontconfig/release/", + "version_link": "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/tags", "release_date": FONTCONFIG["release_date"], "license_name": "", "license_link": "", "build_info": { - "download_link": f"https://www.freedesktop.org/software/fontconfig/release/fontconfig-{FONTCONFIG['version']}.tar.gz", + "download_link": f"https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/{FONTCONFIG['version']}/fontconfig-{FONTCONFIG['version']}.tar.gz", "build_dir": "/tmp/fontconfig", "tarball_name": f"fontconfig-{FONTCONFIG['version']}.tar.gz", }, @@ -464,18 +459,18 @@ }, ), ( - "xproto", + "xorgproto", { "link": "https://www.x.org/releases/individual/proto/", - "version": XPROTO["version"], + "version": XORGPROTO["version"], "version_link": "https://www.x.org/releases/individual/proto/", - "release_date": XPROTO["release_date"], + "release_date": XORGPROTO["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/proto/xproto-{XPROTO['version']}.tar.gz", - "build_dir": "/tmp/xproto", - "tarball_name": f"xproto-{XPROTO['version']}.tar.gz", + "download_link": f"https://www.x.org/releases/individual/proto/xorgproto-{XORGPROTO['version']}.tar.xz", + "build_dir": "/tmp/xorgproto", + "tarball_name": f"xorgproto-{XORGPROTO['version']}.tar.xz", }, }, ), @@ -499,14 +494,14 @@ ( "libpthread-stubs", { - "link": "https://www.x.org/releases/individual/lib/", + "link": "https://xcb.freedesktop.org/dist/", "version": PTHREAD_STUBS["version"], - "version_link": "https://www.x.org/releases/individual/lib/", + "version_link": "https://xcb.freedesktop.org/dist/", "release_date": PTHREAD_STUBS["release_date"], "license_name": "The MIT License", "license_link": "https://opensource.org/licenses/MIT", "build_info": { - "download_link": f"https://www.x.org/releases/individual/lib/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", + "download_link": f"https://xcb.freedesktop.org/dist/libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", "build_dir": "/tmp/libpthread-stubs", "tarball_name": f"libpthread-stubs-{PTHREAD_STUBS['version']}.tar.xz", # "using_source_build": False, @@ -695,70 +690,6 @@ }, }, ), - ( - "ffmpeg-7.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_71["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_71["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_71['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_71['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-7.0", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_70["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_70["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_70['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_70['version']}.tar.bz2", - }, - }, - ), - ( - "ffmpeg-6.1", - { - "link": "http://ffmpeg.org/", - "version": FFMPEG_61["version"], - "version_link": "http://ffmpeg.org/releases/", - "release_date": FFMPEG_61["release_date"], - "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - "license_link": "https://ffmpeg.org/legal.html", - "build_info": { - "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_61['version']}.tar.bz2", - "build_dir": "/tmp/ffmpeg", - "tarball_name": f"ffmpeg-{FFMPEG_61['version']}.tar.bz2", - }, - }, - ), - # ( - # "ffmpeg-5.1", - # { - # "link": "http://ffmpeg.org/", - # "version": FFMPEG_51["version"], - # "version_link": "http://ffmpeg.org/releases/", - # "release_date": FFMPEG_51["release_date"], - # "license_name": "GNU Lesser General Public License (LGPL) version 2.1", - # "license_link": "https://ffmpeg.org/legal.html", - # "build_info": { - # "download_link": f"https://ffmpeg.org/releases/ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # "build_dir": "/tmp/ffmpeg", - # "tarball_name": f"ffmpeg-{FFMPEG_51['version']}.tar.bz2", - # }, - # }, - # ), ] ) # come back to this problem, I think yaml configuration might be better. @@ -780,7 +711,7 @@ def generate_library_table(filename): "The following libraries are used by FFMPEG. The version number and release date are provided along with the license information.\n" ) f.write( - "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'foo'.\n" + "These version numbers are for the lib source builds, which are 'ubuntu2404-edge' and 'scratch320'.\n" ) f.write( "These libs are included in the package images as well, but the version numbers might vary slightly.\n\n" diff --git a/install_ffmpeg.sh b/install_ffmpeg.sh index 342d17cbc..7b4fb8b43 100755 --- a/install_ffmpeg.sh +++ b/install_ffmpeg.sh @@ -39,13 +39,24 @@ install_ffmpeg() { echo "ERROR: ffmpeg not found in ${PREFIX}/bin" exit 1 fi - # Check if ffmpeg library is linked to x86_64-linux-gnu and copy it to /usr/local/lib - 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/ + + ARCH=$(uname -m) + if [ "$ARCH" = "x86_64" ]; then + GNU_ARCH="x86_64-linux-gnu" + CUDA_ARCH="x86_64-linux" + elif [ "$ARCH" = "aarch64" ]; then + GNU_ARCH="aarch64-linux-gnu" + CUDA_ARCH="sbsa-linux" + else + GNU_ARCH="${ARCH}-linux-gnu" + CUDA_ARCH="${ARCH}-linux" + fi + + if ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | grep -q . ; then + ldd ${PREFIX}/bin/ffmpeg | grep ${GNU_ARCH} | cut -d ' ' -f 3 | xargs -i cp -p {} /usr/local/lib/ fi - # some nvidia libs are in the cuda targets directory - if [[ -d /usr/local/cuda/targets/x86_64-linux/lib/ ]]; then - cp -p /usr/local/cuda/targets/x86_64-linux/lib/libnpp* /usr/local/lib + if [[ -d /usr/local/cuda/targets/${CUDA_ARCH}/lib/ ]]; then + cp -p /usr/local/cuda/targets/${CUDA_ARCH}/lib/libnpp* /usr/local/lib fi # Check if ffmpeg library is linked to opt/ffmpeg and copy it to /usr/local/lib @@ -78,9 +89,8 @@ install_ffmpeg() { # Create pkgconfig directory and copy and modify pkgconfig files 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 ${PREFIX}/lib/x86_64-linux-gnu/pkgconfig/libvmaf*; do + for pc in ${PREFIX}/lib/pkgconfig/libav*.pc ${PREFIX}/lib/pkgconfig/libpostproc.pc ${PREFIX}/lib/pkgconfig/kvazaar.pc ${PREFIX}/lib/pkgconfig/libsw*.pc ${PREFIX}/lib/${GNU_ARCH}/pkgconfig/libvmaf*; do if [[ -f "$pc" ]]; then - # sed "s:${PREFIX}:/usr/local:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}" sed "s:${PREFIX}:/usr/local:g; s:/lib64:/lib:g" <"$pc" >/usr/local/lib/pkgconfig/"${pc##*/}"; \ else echo "Warning: File '$pc' not found." diff --git a/templates/Dockerfile-env-alpine b/templates/Dockerfile-env-alpine index 4fa9f989c..a1e936712 100644 --- a/templates/Dockerfile-env-alpine +++ b/templates/Dockerfile-env-alpine @@ -1,6 +1,6 @@ ENV FFMPEG_VERSION=%%FFMPEG_VERSION%% -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/templates/Dockerfile-env-alpine-scratch b/templates/Dockerfile-env-alpine-scratch index 4fa9f989c..a1e936712 100644 --- a/templates/Dockerfile-env-alpine-scratch +++ b/templates/Dockerfile-env-alpine-scratch @@ -1,6 +1,6 @@ ENV FFMPEG_VERSION=%%FFMPEG_VERSION%% -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/templates/Dockerfile-env-nvidia b/templates/Dockerfile-env-nvidia index 0edcf234f..4de8e0975 100644 --- a/templates/Dockerfile-env-nvidia +++ b/templates/Dockerfile-env-nvidia @@ -29,7 +29,7 @@ ENV NVIDIA_HEADERS_VERSION=11.1.5.3 ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -89,7 +89,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/templates/Dockerfile-env-ubuntu b/templates/Dockerfile-env-ubuntu index 2cb62ab24..9e18867a8 100644 --- a/templates/Dockerfile-env-ubuntu +++ b/templates/Dockerfile-env-ubuntu @@ -27,7 +27,7 @@ ENV FFMPEG_VERSION=%%FFMPEG_VERSION%% ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -87,7 +87,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/templates/Dockerfile-env-ubuntu-edge b/templates/Dockerfile-env-ubuntu-edge index f5bd1d7b6..c3328ffc9 100644 --- a/templates/Dockerfile-env-ubuntu-edge +++ b/templates/Dockerfile-env-ubuntu-edge @@ -15,7 +15,7 @@ ARG XML2_PKGS="libxml2-dev libxml2" # libpng ARG PNG_PKGS="libpng-dev libpng16-16t64" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/templates/Dockerfile-env-vaapi b/templates/Dockerfile-env-vaapi index 2cb62ab24..9e18867a8 100644 --- a/templates/Dockerfile-env-vaapi +++ b/templates/Dockerfile-env-vaapi @@ -27,7 +27,7 @@ ENV FFMPEG_VERSION=%%FFMPEG_VERSION%% ## 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) +## xorgproto - (x.org) ## libXau - ## libpthread - libpthread-stubs ## libxml2 - for libbluray @@ -87,7 +87,7 @@ 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" -ENV MAKEFLAGS="-j2" +ENV MAKEFLAGS="-j4" ENV PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ffmpeg/lib64/pkgconfig:/opt/ffmpeg/lib/x86_64-linux-gnu/pkgconfig:/opt/ffmpeg/lib/aarch64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig" ENV PREFIX="/opt/ffmpeg" diff --git a/templates/Dockerfile-run-alpine-scratch b/templates/Dockerfile-run-alpine-scratch index 3e8c8f046..a50f723cc 100644 --- a/templates/Dockerfile-run-alpine-scratch +++ b/templates/Dockerfile-run-alpine-scratch @@ -2,7 +2,7 @@ # ex: '--library-list lib1,lib2,lib3' # for more control over the build process, and how the docker layers are cached -# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg +# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xorgproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg # dont do this πŸ‘† where all of the libs are built at one time. # by splitting them up into batches we allow docker to cache the layers ( which is a lifesaver when debugging ) # I left this line in here, as it shows the proper order of the libraries that need to be built. ( what worked ) @@ -57,8 +57,7 @@ RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh # additional batch of libraries ( split into docker layers, to allow for caching ) -# note: took out 'xproto' because of the configure.guess error -RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libxau +RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xorgproto,libxau RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh diff --git a/templates/Dockerfile-run-ubuntu-edge b/templates/Dockerfile-run-ubuntu-edge index 2ad886af8..a933cc29b 100644 --- a/templates/Dockerfile-run-ubuntu-edge +++ b/templates/Dockerfile-run-ubuntu-edge @@ -2,7 +2,7 @@ # ex: '--library-list lib1,lib2,lib3' # for more control over the build process, and how the docker layers are cached -# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg +# RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list libopencore-amr,libx264,libx265,libogg,libopus,libvorbis,libvpx,libwebp,libmp3lame,libxvid,libfdk-aac,openjpeg,freetype,libvidstab,fribidi,fontconfig,libass,kvazaar,aom,libsvtav1,xorg-macros,xorgproto,libxau,libpthread-stubs,libxml2,libbluray,libzmq,libpng,libaribb24,zimg,libtheora,libsrt,libvmaf,ffmpeg # dont do this πŸ‘† where all of the libs are built at one time. # by splitting them up into batches we allow docker to cache the layers ( which is a lifesaver when debugging ) # I left this line in here, as it shows the proper order of the libraries that need to be built. ( what worked ) @@ -51,7 +51,7 @@ RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh # additional batch of libraries ( split into docker layers, to allow for caching ) -RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xproto +RUN /tmp/workdir/generate-source-of-truth-ffmpeg-versions.py --library-list xorgproto RUN /tmp/workdir/download_tarballs.sh RUN /tmp/workdir/build_source.sh diff --git a/templates/azure.template b/templates/azure.template deleted file mode 100644 index 24da41f3e..000000000 --- a/templates/azure.template +++ /dev/null @@ -1,12 +0,0 @@ - - -jobs: -- job: Build_Docker_Images - pool: - vmImage: ubuntu-latest - strategy: - maxParallel: 10 - matrix: -%%VERSIONS%% - steps: - - template: ../azure-steps.yml diff --git a/update.py b/update.py index 3fc9c849f..372b02ddb 100755 --- a/update.py +++ b/update.py @@ -57,14 +57,23 @@ def get_eol_versions(): latest_version = keep_version[-1] if keep_version else None print(f"Latest version for 'latest' tag: {latest_version}") +DEFAULT_PLATFORMS = "linux/amd64,linux/arm64" +X86_ONLY_PLATFORMS = "linux/amd64" + VARIANTS = [ - {"name": "ubuntu2404", "parent": "ubuntu"}, - {"name": "ubuntu2404-edge", "parent": "ubuntu-edge"}, - {"name": "alpine320", "parent": "alpine"}, - {"name": "scratch320", "parent": "scratch"}, + {"name": "ubuntu2404", "parent": "ubuntu", "platforms": DEFAULT_PLATFORMS}, + { + "name": "ubuntu2404-edge", + "parent": "ubuntu-edge", + "platforms": DEFAULT_PLATFORMS, + }, + {"name": "alpine320", "parent": "alpine", "platforms": DEFAULT_PLATFORMS}, + {"name": "scratch320", "parent": "scratch", "platforms": DEFAULT_PLATFORMS}, # Video Acceleration API (VAAPI) https://trac.ffmpeg.org/wiki/HWAccelIntro#VAAPI - {"name": "vaapi2404", "parent": "vaapi"}, - {"name": "nvidia2404", "parent": "nvidia"}, + # i965-va-driver is x86_64 only + {"name": "vaapi2404", "parent": "vaapi", "platforms": X86_ONLY_PLATFORMS}, + # NVIDIA CUDA builds are x86_64 only + {"name": "nvidia2404", "parent": "nvidia", "platforms": X86_ONLY_PLATFORMS}, ] current_variant_names = [v["name"] for v in VARIANTS] @@ -74,7 +83,8 @@ def get_eol_versions(): all_parents = sorted(set([sub["parent"] for sub in VARIANTS])) gitlabci = ["stages:\n - lint\n"] -azure = [] +gh_build = [] +gh_manifest = [] for parent in all_parents: gitlabci.append(f" - {parent}\n") @@ -183,18 +193,27 @@ def read_ffmpeg_template(variant_name, env_or_run="env"): PARENT: "{variant['parent']}" ISPARENT: "{is_parent}" ISLATEST: "{is_latest}" + PLATFORMS: "{variant['platforms']}" """) - azure.append(f""" - {variant["name"]}_{version}: - MAJOR_VERSION: {major_version} - VERSION: {short_version} - LONG_VERSION: {version} - VARIANT: {variant["name"]} - PARENT: {variant["parent"]} - ISPARENT: {is_parent} - ISLATEST: {is_latest} -""") + gh_base = { + "major_version": major_version, + "version": short_version, + "long_version": version, + "variant": variant["name"], + "parent": variant["parent"], + "is_parent": str(is_parent), + "is_latest": str(is_latest), + "platforms": variant["platforms"], + } + platforms = variant["platforms"].split(",") + for platform in platforms: + arch = platform.replace("linux/", "") + runner = "ubuntu-latest" if arch == "amd64" else "ubuntu-24.04-arm" + gh_build.append( + {**gh_base, "platform": platform, "arch": arch, "runner": runner} + ) + gh_manifest.append(gh_base) # with open( # TEMPLATE_STR.format(variant["name"].replace("-edge", "")), "r" # ) as tmpfile: @@ -292,23 +311,14 @@ def read_ffmpeg_template(variant_name, env_or_run="env"): FFMPEG_CONFIG_FLAGS.append("--extra-libs=-lm") # add math library FFMPEG_CONFIG_FLAGS.append("--ld=g++") # use g++ as linker - # DELETE NEXT 5 LINES when everything works - # --extra-cflags="-I/usr/local/include -I/usr/lib/include" \ - # --extra-cxxflags="-I/usr/local/include -I/usr/lib/include" \ - # --extra-ldflags="-L/usr/local/lib" \ - # --extra-ldflags="-L/usr/local/lib64 -L/usr/lib -L/usr/lib64" \ - # FFMPEG_CONFIG_FLAGS.append("--extra-ldflags=-L/usr/local/lib \ - # -L/usr/local/lib64 -L/usr/lib -L/usr/lib64") - - # Some shenagians to get libvmaf to build with static linking + # libvmaf static linking (both arch paths so builds work on amd64 and arm64) FFMPEG_CONFIG_FLAGS.append( "--extra-ldflags=-L/opt/ffmpeg/lib/x86_64-linux-gnu" ) + FFMPEG_CONFIG_FLAGS.append( + "--extra-ldflags=-L/opt/ffmpeg/lib/aarch64-linux-gnu" + ) - # --ld=g++ or --ld=clang++ when configuring ffmpeg - # FFMPEG_CONFIG_FLAGS.append("--pkg-config-flags='--static'") - # FFMPEG_CONFIG_FLAGS.append("--enable-static") - # 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") @@ -317,10 +327,11 @@ def read_ffmpeg_template(variant_name, env_or_run="env"): "--enable-libfdk_aac" ) # this was likely misstyped before - # if "ubuntu" in variant["parent"] and float(version[0:3]) >= 5.1: if float(version[0:3]) >= 5.1: CFLAGS.append("-I/usr/include/x86_64-linux-gnu") + CFLAGS.append("-I/usr/include/aarch64-linux-gnu") LDFLAGS.append("-L/usr/lib/x86_64-linux-gnu") + LDFLAGS.append("-L/usr/lib/aarch64-linux-gnu") LDFLAGS.append("-L/usr/lib") # for alpine ( but probably fine for all) if float(version[0:1]) >= 8: @@ -372,10 +383,10 @@ def read_ffmpeg_template(variant_name, env_or_run="env"): with open("docker-images/gitlab-ci.yml", "w") as gitlabcifile: gitlabcifile.write("".join(gitlabci)) -with open("templates/azure.template", "r") as tmpfile: - template = tmpfile.read() -azure = template.replace("%%VERSIONS%%", "\n".join(azure)) - - -with open("docker-images/azure-jobs.yml", "w") as azurefile: - azurefile.write(azure) +gh_matrices = { + "build": gh_build, + "manifest": gh_manifest, +} +with open("docker-images/github-actions-matrix.json", "w") as ghfile: + json.dump(gh_matrices, ghfile, indent=2) + ghfile.write("\n") From d07d0ae29d2dbf6fec33dcf9a581bf48d1e3d348 Mon Sep 17 00:00:00 2001 From: Julien Rottenberg Date: Sun, 26 Apr 2026 23:35:12 -0700 Subject: [PATCH 2/2] contributing and releaes sections --- .dockerignore | 1 + .github/workflows/build.yml | 8 ++++ .github/workflows/jekyll-gh-pages.yml | 4 +- CONTRIBUTING.md | 2 +- docs/Dockerfile | 5 ++- docs/_layouts/default.html | 61 +++++++++++++++++++++++++++ docs/releases.md | 40 ++++++++++++++++++ 7 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 docs/_layouts/default.html create mode 100644 docs/releases.md diff --git a/.dockerignore b/.dockerignore index d35fb755e..2bdcff7f4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,4 +5,5 @@ __pycache__ .DS_Store *.md !README.md +!CONTRIBUTING.md .pre-commit-config.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c055eb1b..77b639a52 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,15 @@ name: Build Docker Images on: push: + paths: + - 'docker-images/**' + - 'templates/**' + - '.github/workflows/build.yml' pull_request: + paths: + - 'docker-images/**' + - 'templates/**' + - '.github/workflows/build.yml' workflow_dispatch: concurrency: diff --git a/.github/workflows/jekyll-gh-pages.yml b/.github/workflows/jekyll-gh-pages.yml index 05fcc7bc8..74c619047 100644 --- a/.github/workflows/jekyll-gh-pages.yml +++ b/.github/workflows/jekyll-gh-pages.yml @@ -20,11 +20,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Sync README to docs + - name: Sync README and CONTRIBUTING to docs run: | mkdir -p docs printf -- '---\n---\n\n' > docs/index.md cat README.md >> docs/index.md + printf -- '---\ntitle: Contributing\n---\n\n' > docs/contributing.md + cat CONTRIBUTING.md >> docs/contributing.md - name: Setup Pages uses: actions/configure-pages@v5 - name: Build with Jekyll diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe8bd84a9..ebb5fc442 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Welcome to ffmpeg docker image contributing guide -Thank you for investing your time in contributing to our project! Any contribution you make will be reflected on [jrottenberg/ffmpeg](https://github.com/jrottenberg/ffmpeg) :tada:. +Thank you for investing your time in contributing to our project! Any contribution you make will be reflected on [jrottenberg/ffmpeg](https://github.com/jrottenberg/ffmpeg) πŸŽ‰. Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable. diff --git a/docs/Dockerfile b/docs/Dockerfile index 2f0590212..9570e1c0c 100644 --- a/docs/Dockerfile +++ b/docs/Dockerfile @@ -4,9 +4,12 @@ RUN gem install jekyll-remote-theme webrick COPY docs/ /srv/jekyll/ COPY README.md /tmp/README.md +COPY CONTRIBUTING.md /tmp/CONTRIBUTING.md RUN printf -- '---\n---\n\n' > /srv/jekyll/index.md \ - && cat /tmp/README.md >> /srv/jekyll/index.md + && cat /tmp/README.md >> /srv/jekyll/index.md \ + && printf -- '---\ntitle: Contributing\n---\n\n' > /srv/jekyll/contributing.md \ + && cat /tmp/CONTRIBUTING.md >> /srv/jekyll/contributing.md EXPOSE 4000 diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html new file mode 100644 index 000000000..47925d3fe --- /dev/null +++ b/docs/_layouts/default.html @@ -0,0 +1,61 @@ + + + + + + + +{% seo %} + + + {% include head-custom.html %} + + +
+
+

{{ site.title | default: site.github.repository_name }}

+ + {% if site.logo %} + Logo + {% endif %} + +

{{ site.description | default: site.github.project_tagline }}

+ + + + {% if site.github.is_project_page %} +

View the Project on GitHub {{ site.github.repository_nwo }}

+ {% endif %} + + {% if site.github.is_user_page %} +

View My GitHub Profile

+ {% endif %} + + {% if site.show_downloads %} + + {% endif %} +
+
+ + {{ content }} + +
+ +
+ + + diff --git a/docs/releases.md b/docs/releases.md new file mode 100644 index 000000000..385cdec1f --- /dev/null +++ b/docs/releases.md @@ -0,0 +1,40 @@ +--- +title: Releases +--- + +# Releases + +All tagged releases of the FFmpeg Docker images, with links to the upstream FFmpeg release notes. + +| Version | Codename | FFmpeg Release Notes | +|---------|----------|----------------------| +| 8.1 | Hoare | [release notes](https://ffmpeg.org/download.html#release_8.1) | +| 8.0 | Huffman | [release notes](https://ffmpeg.org/download.html#release_8.0) | +| 7.1 | PΓ©ter | [release notes](https://ffmpeg.org/download.html#release_7.1) | +| 7.0 | Dijkstra | [release notes](https://ffmpeg.org/download.html#release_7.0) | +| 6.1 | Heaviside | [release notes](https://ffmpeg.org/download.html#release_6.1) | +| 6.0 | Von Neumann | [release notes](https://ffmpeg.org/download.html#release_6.0) | +| 5.1 | Riemann | [release notes](https://ffmpeg.org/download.html#release_5.1) | +| 5.0 | Lorentz | [release notes](https://ffmpeg.org/download.html#release_5.0) | +| 4.4 | Rao | [release notes](https://ffmpeg.org/download.html#release_4.4) | +| 4.3 | 4:3 | [release notes](https://ffmpeg.org/download.html#release_4.3) | +| 4.2 | Ada | [release notes](https://ffmpeg.org/download.html#release_4.2) | +| 4.1.6 | | [release notes](https://ffmpeg.org/download.html#release_4.1) | +| 4.1.3 | | [release notes](https://ffmpeg.org/download.html#release_4.1) | +| 4.1.1 | | [release notes](https://ffmpeg.org/download.html#release_4.1) | +| 4.1 | al-Khwarizmi | [release notes](https://ffmpeg.org/download.html#release_4.1) | +| 4.0.4 | | [release notes](https://ffmpeg.org/download.html#release_4.0) | +| 4.0 | Wu | [release notes](https://ffmpeg.org/download.html#release_4.0) | +| 3.4.8 | | [release notes](https://ffmpeg.org/download.html#release_3.4) | +| 3.4.6 | | [release notes](https://ffmpeg.org/download.html#release_3.4) | +| 3.4 | Cantor | [release notes](https://ffmpeg.org/download.html#release_3.4) | +| 3.3.9 | | [release notes](https://ffmpeg.org/download.html#release_3.3) | +| 3.3 | | | +| 3.2.15 | | [release notes](https://ffmpeg.org/download.html#release_3.2) | +| 3.2.2 | | [release notes](https://ffmpeg.org/download.html#release_3.2) | +| 3.2 | Hypatia | [release notes](https://ffmpeg.org/download.html#release_3.2) | +| 3.1.11 | | [release notes](https://ffmpeg.org/download.html#release_3.1) | +| 3.1.2 | | [release notes](https://ffmpeg.org/download.html#release_3.1) | +| 3.0.12 | | [release notes](https://ffmpeg.org/download.html#release_3.0) | +| 2.8.15 | | [release notes](https://ffmpeg.org/download.html#release_2.8) | +| 2.4.6 | | [release notes](https://ffmpeg.org/download.html#release_2.4) |