Skip to content

Commit 1df7e94

Browse files
authored
Merge pull request #181 from markus-perl/ffmpeg-v6
Ffmpeg v6
2 parents 0328348 + 9ef607e commit 1df7e94

File tree

6 files changed

+44
-111
lines changed

6 files changed

+44
-111
lines changed

.github/workflows/build.yml

-24
Original file line numberDiff line numberDiff line change
@@ -103,30 +103,6 @@ jobs:
103103
run: |
104104
docker run --rm ffmpeg:cuda-ubuntu -buildconf
105105
106-
build-cuda-rocky-docker:
107-
name: build in Rockylinux docker with cuda
108-
runs-on: ubuntu-latest
109-
steps:
110-
- name: Checkout code
111-
uses: actions/checkout@v2
112-
113-
- name: pull base image
114-
id: cuda_centos_pull
115-
run: |
116-
docker pull nvidia/cuda:11.6.0-devel-centos8
117-
docker pull rockylinux:8
118-
- name: run if cuda_centos_pull failed
119-
if: failure() && steps.cuda_centos_pull.outcome == 'failure'
120-
run: |
121-
docker pull nvidia/cuda:11.6.0-devel-centos8
122-
docker pull rockylinux:8
123-
- name: build ffmpeg
124-
run: |
125-
docker build -t ffmpeg:cuda-rocky -f cuda-rocky.dockerfile .
126-
- name: test run ffmepg
127-
run: |
128-
docker run --rm ffmpeg:cuda-rocky -buildconf
129-
130106
build-full-static:
131107
name: full static build in docker
132108
runs-on: ubuntu-22.04

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ workspace
33
.idea
44
linux
55
.artifacts
6+
build

README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,9 @@ $ docker build --tag=ffmpeg:default --output type=local,dest=build -f Dockerfile
150150
##### CUDA
151151
These builds are always built with the --enable-gpl-and-non-free switch, as CUDA is non-free. See https://ffmpeg.org/legal.html
152152
```bash
153-
export DOCKER_BUILDKIT=1
154-
155-
## Set the DIST (`ubuntu` or `rocky`) and VER (ubuntu: `16.04` , `18.04`, `20.04` or rocky: `8`) environment variables to select the preferred Docker base image.
156-
$ export DIST=centos
157-
$ export VER=8
158153

159154
## Start the build
160-
$ docker build --tag=ffmpeg:cuda-$DIST -f cuda-$DIST.dockerfile --build-arg VER=$VER .
155+
$ docker build --tag=ffmpeg:cuda-$DIST -f cuda-ubunu.dockerfile --build-arg .
161156
```
162157

163158
Build an `export.dockerfile` that copies only what you need from the image you just built as follows. When running,

build-ffmpeg

+29-28
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# LICENSE: https://github.com/markus-perl/ffmpeg-build-script/blob/master/LICENSE
55

66
PROGNAME=$(basename "$0")
7-
FFMPEG_VERSION=5.1
8-
SCRIPT_VERSION=1.43
7+
FFMPEG_VERSION=6.0
8+
SCRIPT_VERSION=1.44
99
CWD=$(pwd)
1010
PACKAGES="$CWD/packages"
1111
WORKSPACE="$CWD/workspace"
@@ -387,8 +387,8 @@ if build "libtool" "2.4.7"; then
387387
fi
388388

389389
if $NONFREE_AND_GPL; then
390-
if build "openssl" "1.1.1s"; then
391-
download "https://www.openssl.org/source/openssl-1.1.1s.tar.gz"
390+
if build "openssl" "1.1.1t"; then
391+
download "https://www.openssl.org/source/openssl-1.1.1t.tar.gz"
392392
if $MACOS_M1; then
393393
sed -n 's/\(##### GNU Hurd\)/"darwin64-arm64-cc" => { \n inherit_from => [ "darwin-common", asm("aarch64_asm") ],\n CFLAGS => add("-Wall"),\n cflags => add("-arch arm64 "),\n lib_cppflags => add("-DL_ENDIAN"),\n bn_ops => "SIXTY_FOUR_BIT_LONG", \n perlasm_scheme => "macosx", \n}, \n\1/g' Configurations/10-main.conf
394394
execute ./Configure --prefix="${WORKSPACE}" no-shared no-asm darwin64-arm64-cc
@@ -397,7 +397,7 @@ if $NONFREE_AND_GPL; then
397397
fi
398398
execute make -j $MJOBS
399399
execute make install_sw
400-
build_done "openssl" "1.1.1s"
400+
build_done "openssl" "1.1.1t"
401401
fi
402402
CONFIGURE_OPTIONS+=("--enable-openssl")
403403
else
@@ -418,12 +418,12 @@ else
418418
fi
419419

420420
if [[ ! $ARCH == 'arm64' ]]; then
421-
if build "gnutls" "3.7.8"; then
422-
download "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.8.tar.xz"
421+
if build "gnutls" "3.7.9"; then
422+
download "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.7/gnutls-3.7.9.tar.xz"
423423
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static --disable-doc --disable-tools --disable-cxx --disable-tests --disable-gtk-doc-html --disable-libdane --disable-nls --enable-local-libopts --disable-guile --with-included-libtasn1 --with-included-unistring --without-p11-kit CPPFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
424424
execute make -j $MJOBS
425425
execute make install
426-
build_done "gnutls" "3.7.8"
426+
build_done "gnutls" "3.7.9"
427427
fi
428428
# CONFIGURE_OPTIONS+=("--enable-gmp" "--enable-gnutls")
429429
fi
@@ -454,8 +454,8 @@ if command_exists "python3"; then
454454
done
455455
fi
456456
if command_exists "meson"; then
457-
if build "dav1d" "1.0.0"; then
458-
download "https://code.videolan.org/videolan/dav1d/-/archive/1.0.0/dav1d-1.0.0.tar.gz"
457+
if build "dav1d" "1.1.0"; then
458+
download "https://code.videolan.org/videolan/dav1d/-/archive/1.0.0/dav1d-1.1.0.tar.gz"
459459
make_dir build
460460

461461
CFLAGSBACKUP=$CFLAGS
@@ -471,7 +471,7 @@ if command_exists "python3"; then
471471
export CFLAGS=$CFLAGSBACKUP
472472
fi
473473

474-
build_done "dav1d" "1.0.0"
474+
build_done "dav1d" "1.1.0"
475475
fi
476476
CONFIGURE_OPTIONS+=("--enable-libdav1d")
477477
fi
@@ -493,11 +493,11 @@ if ! $MACOS_M1; then
493493
fi
494494

495495
if command_exists "cargo"; then
496-
if build "rav1e" "0.6.2"; then
496+
if build "rav1e" "0.6.3"; then
497497
execute cargo install --version "0.9.14+cargo-0.66" cargo-c
498-
download "https://github.com/xiph/rav1e/archive/refs/tags/v0.6.2.tar.gz"
498+
download "https://github.com/xiph/rav1e/archive/refs/tags/v0.6.3.tar.gz"
499499
execute cargo cinstall --prefix="${WORKSPACE}" --library-type=staticlib --crt-static --release
500-
build_done "rav1e" "0.6.2"
500+
build_done "rav1e" "0.6.3"
501501
fi
502502
CONFIGURE_OPTIONS+=("--enable-librav1e")
503503
fi
@@ -567,8 +567,8 @@ EOF
567567
CONFIGURE_OPTIONS+=("--enable-libx265")
568568
fi
569569

570-
if build "libvpx" "1.12.0"; then
571-
download "https://github.com/webmproject/libvpx/archive/refs/tags/v1.12.0.tar.gz" "libvpx-1.12.0.tar.gz"
570+
if build "libvpx" "1.13.0"; then
571+
download "https://github.com/webmproject/libvpx/archive/refs/tags/v1.13.0.tar.gz" "libvpx-1.13.0.tar.gz"
572572

573573
if [[ "$OSTYPE" == "darwin"* ]]; then
574574
echo "Applying Darwin patch"
@@ -580,7 +580,7 @@ if build "libvpx" "1.12.0"; then
580580
execute make -j $MJOBS
581581
execute make install
582582

583-
build_done "libvpx" "1.12.0"
583+
build_done "libvpx" "1.13.0"
584584
fi
585585
CONFIGURE_OPTIONS+=("--enable-libvpx")
586586

@@ -837,13 +837,13 @@ fi
837837
## other library
838838
##
839839

840-
if build "libsdl" "2.26.1"; then
841-
download "https://www.libsdl.org/release/SDL2-2.26.1.tar.gz"
840+
if build "libsdl" "2.26.3"; then
841+
download "https://www.libsdl.org/release/SDL2-2.26.3.tar.gz"
842842
execute ./configure --prefix="${WORKSPACE}" --disable-shared --enable-static
843843
execute make -j $MJOBS
844844
execute make install
845845

846-
build_done "libsdl" "2.26.1"
846+
build_done "libsdl" "2.26.3"
847847
fi
848848

849849
if $NONFREE_AND_GPL; then
@@ -870,11 +870,11 @@ fi
870870

871871
if [[ "$OSTYPE" == "linux-gnu" ]]; then
872872
if command_exists "nvcc"; then
873-
if build "nv-codec" "11.1.5.0"; then
874-
download "https://github.com/FFmpeg/nv-codec-headers/releases/download/n11.1.5.0/nv-codec-headers-11.1.5.0.tar.gz"
873+
if build "nv-codec" "11.1.5.2"; then
874+
download "https://github.com/FFmpeg/nv-codec-headers/releases/download/n11.1.5.2/nv-codec-headers-11.1.5.2.tar.gz"
875875
execute make PREFIX="${WORKSPACE}"
876-
execute make install PREFIX="${WORKSPACE}"
877-
build_done "nv-codec" "11.1.5.0"
876+
execute make PREFIX="${WORKSPACE}/usr" install
877+
build_done "nv-codec" "11.1.5.2"
878878
fi
879879
CFLAGS+=" -I/usr/local/cuda/include"
880880
LDFLAGS+=" -L/usr/local/cuda/lib64"
@@ -899,12 +899,12 @@ if [[ "$OSTYPE" == "linux-gnu" ]]; then
899899
fi
900900
fi
901901

902-
if build "amf" "1.4.28"; then
903-
download 'https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/refs/tags/v1.4.28.tar.gz' 'AMF-1.4.28.tar.gz' 'AMF-1.4.28'
902+
if build "amf" "1.4.29"; then
903+
download 'https://github.com/GPUOpen-LibrariesAndSDKs/AMF/archive/refs/tags/v1.4.29.tar.gz' 'AMF-1.4.29.tar.gz' 'AMF-1.4.29'
904904
execute rm -rf "${WORKSPACE}/include/AMF"
905905
execute mkdir -p "${WORKSPACE}/include/AMF"
906-
execute cp -r "${PACKAGES}"/AMF-1.4.28/AMF-1.4.28/amf/public/include/* "${WORKSPACE}/include/AMF/"
907-
build_done "amf" "1.4.28"
906+
execute cp -r "${PACKAGES}"/AMF-1.4.29/AMF-1.4.29/amf/public/include/* "${WORKSPACE}/include/AMF/"
907+
build_done "amf" "1.4.29"
908908
fi
909909
CONFIGURE_OPTIONS+=("--enable-amf")
910910
fi
@@ -929,6 +929,7 @@ download "https://github.com/FFmpeg/FFmpeg/archive/refs/heads/release/$FFMPEG_VE
929929
--enable-static \
930930
--enable-small \
931931
--enable-version3 \
932+
--disable-ffnvcodec \
932933
--extra-cflags="${CFLAGS}" \
933934
--extra-ldexeflags="${LDEXEFLAGS}" \
934935
--extra-ldflags="${LDFLAGS}" \

cuda-rocky.dockerfile

-49
This file was deleted.

cuda-ubuntu.dockerfile

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
ARG VER=22.04
22

3-
FROM nvidia/cuda:11.8.0-devel-ubuntu${VER} AS build
3+
FROM ubuntu:${VER} AS build
4+
5+
ARG CUDAVER=11.8.0-1
46

57
ENV DEBIAN_FRONTEND noninteractive
68
ENV NVIDIA_VISIBLE_DEVICES all
79
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,video
810

911
RUN apt-get update \
10-
&& apt-get -y --no-install-recommends install build-essential curl ca-certificates libva-dev python3 python-is-python3 ninja-build meson \
11-
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* \
12-
&& update-ca-certificates
12+
&& apt-get -y --no-install-recommends install wget ca-certificates \
13+
&& update-ca-certificates \
14+
&& wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
15+
&& dpkg -i cuda-keyring_1.0-1_all.deb \
16+
&& apt-get update
17+
18+
RUN apt-get -y --no-install-recommends install build-essential curl libva-dev python3 python-is-python3 ninja-build meson \
19+
cuda="${CUDAVER}" \
20+
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
21+
1322

1423
WORKDIR /app
1524
COPY ./build-ffmpeg /app/build-ffmpeg

0 commit comments

Comments
 (0)