Skip to content

Commit 6c81c86

Browse files
committed
Upgrade to ffmpeg 8.0.1, CUDA 13.1
1 parent 36c076e commit 6c81c86

13 files changed

+322
-216
lines changed

.github/workflows/build_base_alpine-rpi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15-
- ffmpeg_version: "7.1.1"
15+
- ffmpeg_version: "8.0.1"
1616
os: alpine
17-
os_version: "3.21"
17+
os_version: "3.23"
1818
platforms: linux/arm64, linux/arm/v7
1919
steps:
2020
- name: Get current date

.github/workflows/build_base_alpine.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15-
- ffmpeg_version: "7.1.1"
15+
- ffmpeg_version: "8.0.1"
1616
os: alpine
17-
os_version: "3.21"
17+
os_version: "3.23"
1818
platforms: linux/amd64,linux/arm64,linux/arm/v7
1919
steps:
2020
- name: Get current date

.github/workflows/build_base_alpine_static.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15-
- ffmpeg_version: "7.1.1"
15+
- ffmpeg_version: "8.0.1"
1616
os: alpine
17-
os_version: "3.21"
17+
os_version: "3.23"
1818
platforms: linux/amd64,linux/arm64,linux/arm/v7
1919

2020
steps:

.github/workflows/build_base_ubuntu-cuda.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15-
- cuda: 12
15+
- cuda: 13
1616
os: ubuntu
1717
os_version: "24.04"
1818
platforms: linux/amd64
19-
cuda_version: "12.8.1"
20-
ffnvcodec_version: "12.2.72.0"
21-
ffmpeg_version: "7.1.1"
19+
cuda_version: "13.1.1"
20+
ffnvcodec_version: "13.0.19.0"
21+
ffmpeg_version: "8.0.1"
2222
steps:
2323
- name: Get current date
2424
run: |

.github/workflows/build_base_ubuntu-vaapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
include:
15-
- ffmpeg_version: "7.1.1"
15+
- ffmpeg_version: "8.0.1"
1616
os: ubuntu
1717
os_version: "24.04"
1818
platforms: linux/amd64

Build.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ set -au
44

55
function build_default_native() {
66
export OS_NAME=alpine
7-
export OS_VERSION=3.21
8-
export FFMPEG_VERSION=7.1.1
7+
export OS_VERSION=3.23
8+
export FFMPEG_VERSION=8.0.1
99

1010
docker build \
1111
--progress=plain \
@@ -17,8 +17,8 @@ function build_default_native() {
1717

1818
function build_default() {
1919
export OS_NAME=alpine
20-
export OS_VERSION=3.21
21-
export FFMPEG_VERSION=7.1.1
20+
export OS_VERSION=3.23
21+
export FFMPEG_VERSION=8.0.1
2222

2323
docker buildx build \
2424
--load \
@@ -32,8 +32,8 @@ function build_default() {
3232

3333
function build_rpi() {
3434
export OS_NAME=alpine
35-
export OS_VERSION=3.21
36-
export FFMPEG_VERSION=7.1.1
35+
export OS_VERSION=3.23
36+
export FFMPEG_VERSION=8.0.1
3737

3838
docker build \
3939
--progress=plain \
@@ -43,11 +43,11 @@ function build_rpi() {
4343
-t datarhei/base:ffmpeg${FFMPEG_VERSION}-rpi-${OS_NAME}${OS_VERSION} .
4444
}
4545

46-
function build_cuda12() {
46+
function build_cuda() {
4747
export OS_NAME=ubuntu
4848
export OS_VERSION=24.04
49-
export FFMPEG_VERSION=7.1.1
50-
export FFNVCODEC_VERSION=12.2.72.0
49+
export FFMPEG_VERSION=8.0.1
50+
export FFNVCODEC_VERSION=13.0.19.0
5151

5252
docker build \
5353
--progress=plain \
@@ -62,7 +62,7 @@ function build_cuda12() {
6262
function build_vaapi() {
6363
export OS_NAME=ubuntu
6464
export OS_VERSION=24.04
65-
export FFMPEG_VERSION=7.1.1
65+
export FFMPEG_VERSION=8.0.1
6666

6767
docker buildx build \
6868
--load \
@@ -77,7 +77,7 @@ function build_vaapi() {
7777

7878
main() {
7979
if [[ $# == 0 ]]; then
80-
echo "Options available: default, default_native, rpi, cuda12, vaapi"
80+
echo "Options available: default, default_native, rpi, cuda, vaapi"
8181
exit 0
8282
else
8383
if [[ $1 == "default" ]]; then
@@ -86,8 +86,8 @@ main() {
8686
build_default_native
8787
elif [[ $1 == "rpi" ]]; then
8888
build_rpi
89-
elif [[ $1 == "cuda12" ]]; then
90-
build_cuda12
89+
elif [[ $1 == "cuda" ]]; then
90+
build_cuda
9191
elif [[ $1 == "vaapi" ]]; then
9292
build_vaapi
9393
fi

Dockerfile.alpine

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ RUN cd /dist/ffmpeg-${FFMPEG_VERSION} && \
7070
--enable-nonfree \
7171
--enable-gpl \
7272
--enable-version3 \
73-
--enable-postproc \
7473
--enable-static \
7574
--enable-openssl \
7675
--enable-libxml2 \

Dockerfile.alpine.rpi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ RUN cd /dist/ffmpeg-${FFMPEG_VERSION} && \
7676
--enable-nonfree \
7777
--enable-gpl \
7878
--enable-version3 \
79-
--enable-postproc \
8079
--enable-static \
8180
--enable-openssl \
8281
--enable-libxml2 \

Dockerfile.static

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ ENV SRC=/usr \
1212

1313
# Install build dependencies
1414
RUN apk add --no-cache \
15-
autoconf automake bash binutils bzip2 ca-certificates \
16-
cmake coreutils curl diffutils g++ gcc libgcc libtool \
17-
libssl3 linux-headers make musl-dev nasm openssl-dev \
18-
patch tar zlib-dev harfbuzz-dev freetype-dev libxml2-dev \
19-
libsrt-dev x264-dev x265-dev libvpx-dev lame-dev opus-dev \
20-
libvorbis-dev fdk-aac-dev dav1d-dev rav1e-dev aom-dev \
21-
libxcb-dev alsa-lib-dev v4l-utils-dev
15+
autoconf automake bash binutils bzip2 ca-certificates \
16+
cmake coreutils curl diffutils g++ gcc libgcc libtool \
17+
libssl3 linux-headers make musl-dev nasm openssl-dev \
18+
patch tar zlib-dev harfbuzz-dev freetype-dev libxml2-dev \
19+
libsrt-dev x264-dev x265-dev libvpx-dev lame-dev opus-dev \
20+
libvorbis-dev fdk-aac-dev dav1d-dev rav1e-dev aom-dev \
21+
libxcb-dev alsa-lib-dev v4l-utils-dev
2222

2323
WORKDIR /tmp
2424

@@ -34,36 +34,35 @@ RUN cd ffmpeg-${FFMPEG_VERSION} && \
3434
patch -p1 < /contrib/ffmpeg-jsonstats.patch && \
3535
patch -p1 < /contrib/ffmpeg-hls.patch && \
3636
./configure \
37-
--extra-version="datarhei-${BUILD_COMMIT}-${BUILD_DATE}" \
38-
--prefix="${SRC}" \
39-
--extra-libs="-lpthread -lxml2 -lm -lsupc++ -lstdc++ -lssl -lcrypto -lz -lc -ldl" \
40-
--enable-nonfree \
41-
--enable-gpl \
42-
--enable-version3 \
43-
--enable-postproc \
44-
--enable-static \
45-
--disable-shared \
46-
--disable-ffplay \
47-
--disable-debug \
48-
--disable-doc \
49-
--enable-openssl \
50-
--enable-libxml2 \
51-
--enable-libv4l2 \
52-
--enable-v4l2_m2m \
53-
--enable-libfreetype \
54-
--enable-alsa \
55-
--enable-libsrt \
56-
--enable-libx264 \
57-
--enable-libx265 \
58-
--enable-libvpx \
59-
--enable-libmp3lame \
60-
--enable-libopus \
61-
--enable-libvorbis \
62-
--enable-libfdk-aac \
63-
--enable-libdav1d \
64-
--enable-librav1e \
65-
--enable-libaom \
66-
--enable-libxcb && \
37+
--extra-version="datarhei-${BUILD_COMMIT}-${BUILD_DATE}" \
38+
--prefix="${SRC}" \
39+
--extra-libs="-lpthread -lxml2 -lm -lsupc++ -lstdc++ -lssl -lcrypto -lz -lc -ldl" \
40+
--enable-nonfree \
41+
--enable-gpl \
42+
--enable-version3 \
43+
--enable-static \
44+
--disable-shared \
45+
--disable-ffplay \
46+
--disable-debug \
47+
--disable-doc \
48+
--enable-openssl \
49+
--enable-libxml2 \
50+
--enable-libv4l2 \
51+
--enable-v4l2_m2m \
52+
--enable-libfreetype \
53+
--enable-alsa \
54+
--enable-libsrt \
55+
--enable-libx264 \
56+
--enable-libx265 \
57+
--enable-libvpx \
58+
--enable-libmp3lame \
59+
--enable-libopus \
60+
--enable-libvorbis \
61+
--enable-libfdk-aac \
62+
--enable-libdav1d \
63+
--enable-librav1e \
64+
--enable-libaom \
65+
--enable-libxcb && \
6766
make && make install
6867

6968
# Output stage (nur statische Binarys)

Dockerfile.ubuntu.cuda13

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
ARG BUILD_IMAGE=nvidia/cuda:13.1.1-devel-ubuntu24.04
2+
ARG DEPLOY_IMAGE=nvidia/cuda:13.1.1-runtime-ubuntu24.04
3+
4+
FROM $BUILD_IMAGE AS builder
5+
6+
ARG FFNVCODEC_VERSION=13.0.19.0
7+
ARG BUILD_DATE=1970-01-01T00:00:00Z
8+
ARG BUILD_COMMIT=unknown
9+
ARG FFMPEG_VERSION=none
10+
11+
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
12+
ENV SRC=/usr/local
13+
ENV DEBIAN_FRONTEND=noninteractive
14+
15+
RUN apt-get update -y && \
16+
apt-get install -y \
17+
pkg-config \
18+
curl \
19+
libcurl4-openssl-dev \
20+
git \
21+
nasm \
22+
openssl \
23+
libssl-dev \
24+
cmake \
25+
yasm \
26+
build-essential \
27+
libtool \
28+
autoconf \
29+
libv4l-dev \
30+
libasound2-dev \
31+
libx264-dev \
32+
libx265-dev \
33+
librav1e-dev \
34+
libaom-dev \
35+
libdav1d-dev \
36+
libvpx-dev \
37+
libmp3lame-dev \
38+
libopus-dev \
39+
libvorbis-dev \
40+
libogg-dev \
41+
libfreetype-dev \
42+
libsrt-openssl-dev \
43+
libxml2-dev \
44+
libfdk-aac-dev \
45+
libharfbuzz-dev \
46+
libxml2-dev \
47+
libxcb1-dev \
48+
libxcb-xfixes0-dev \
49+
libxcb-shm0-dev \
50+
libxcb-shape0-dev \
51+
zlib1g-dev
52+
53+
# install and patch ffmpeg
54+
RUN mkdir -p /dist && cd /dist && \
55+
curl -OLk http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
56+
curl -OLk https://github.com/FFmpeg/nv-codec-headers/releases/download/n${FFNVCODEC_VERSION}/nv-codec-headers-${FFNVCODEC_VERSION}.tar.gz && \
57+
tar -xvz -f ffmpeg-${FFMPEG_VERSION}.tar.gz && \
58+
tar -xvz -f nv-codec-headers-${FFNVCODEC_VERSION}.tar.gz && \
59+
rm ffmpeg-${FFMPEG_VERSION}.tar.gz nv-codec-headers-${FFNVCODEC_VERSION}.tar.gz && \
60+
cd nv-codec-headers-${FFNVCODEC_VERSION} && \
61+
make install
62+
63+
COPY ./contrib /contrib
64+
65+
RUN cd /dist/ffmpeg-${FFMPEG_VERSION} && \
66+
patch -p1 < /contrib/ffmpeg-jsonstats.patch && \
67+
patch -p1 < /contrib/ffmpeg-hls.patch && \
68+
./configure \
69+
--extra-version="datarhei-${BUILD_COMMIT}-${BUILD_DATE}" \
70+
--extra-libs="-lpthread -lxml2 -lm -lz -lsupc++ -lstdc++ -lssl -lcrypto -lc -ldl -lcurl" \
71+
--prefix="${SRC}" \
72+
--extra-cflags=-I/usr/local/cuda/include \
73+
--extra-ldflags=-L/usr/local/cuda/lib64 \
74+
--enable-nonfree \
75+
--enable-gpl \
76+
--enable-version3 \
77+
--enable-static \
78+
--enable-openssl \
79+
--enable-libxml2 \
80+
--enable-cuda \
81+
--enable-cuda-llvm \
82+
--enable-cuda-nvcc \
83+
--enable-nvdec \
84+
--enable-nvenc \
85+
--enable-cuvid \
86+
--enable-libnpp \
87+
--enable-libv4l2 \
88+
--enable-libfreetype \
89+
--enable-alsa \
90+
--enable-libsrt \
91+
--enable-libx264 \
92+
--enable-libx265 \
93+
--enable-libvpx \
94+
--enable-libmp3lame \
95+
--enable-libfdk-aac \
96+
--enable-libopus \
97+
--enable-libvorbis \
98+
--enable-libdav1d \
99+
--enable-librav1e \
100+
--enable-libaom \
101+
--enable-libxcb \
102+
--disable-ffplay \
103+
--disable-ffprobe \
104+
--disable-debug \
105+
--disable-doc && \
106+
make -j$(nproc) && \
107+
make install && \
108+
hash -r
109+
110+
RUN mkdir -p /ffmpeglibs && \
111+
ldd /usr/local/bin/ffmpeg | grep -o -e '/lib/[a-z0-9_]*-linux-gnu/[^ ]*' | xargs -I % cp -v % /ffmpeglibs
112+
113+
FROM $DEPLOY_IMAGE
114+
115+
COPY --from=builder /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
116+
COPY --from=builder /ffmpeglibs /ffmpeglibs
117+
118+
ENV DEBIAN_FRONTEND=noninteractive
119+
120+
RUN echo "/ffmpeglibs" > /etc/ld.so.conf.d/ffmpeg.conf && \
121+
ldconfig && \
122+
apt-get update && \
123+
apt-get install -y ca-certificates openssl tzdata v4l-utils fbset libasound2-dev && \
124+
ffmpeg -buildconf
125+
126+
ENV NVIDIA_VISIBLE_DEVICES=all
127+
ENV NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
128+
129+
WORKDIR /tmp
130+
ENTRYPOINT ["/usr/local/bin/ffmpeg"]
131+
CMD ["-version"]

0 commit comments

Comments
 (0)