-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
94 lines (89 loc) · 4.7 KB
/
Copy pathDockerfile
File metadata and controls
94 lines (89 loc) · 4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Transcodarr — automated media transcoder
# Supports NVIDIA NVENC, Intel QSV, and CPU-only encoding
ARG GPU_TYPE=nvidia
FROM lscr.io/linuxserver/ffmpeg@sha256:8b7f2d546f28761e4eb5d6ed611f8cab3bd842667f7cea379c196040eed8f254
LABEL org.opencontainers.image.title="Transcodarr"
LABEL org.opencontainers.image.description="Automated media transcoder with GPU-accelerated encoding"
LABEL org.opencontainers.image.authors="jb14813"
# Install runtime dependencies.
# jq is used by probe_hdr_metadata() in transcodarr-lib.sh to extract
# SMPTE 2086 mastering-display + MaxCLL/MaxFALL side-data from ffprobe
# JSON so we can forward them to the HDR-preserve encoder path.
RUN apt-get update -qq && \
apt-get install -y -qq --no-install-recommends \
curl perl valkey-server valkey-tools jq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Rebuild libplacebo with explicit vkGetInstanceProcAddr binding.
# linuxserver/ffmpeg ships libplacebo built without -Dvk-proc-addr=enabled
# (verified 2026-05-15 via nm -D; preserved through the 2026-05-16 base
# bump). vf_libplacebo then fails on every HDR source with:
# "No vkGetInstanceProcAddr function provided, and libplacebo built
# without linking against this function!"
# Match the base image's libplacebo version (v7.360.1, SOVERSION 360) so
# ffmpeg's dynamic-link ABI stays intact.
#
# libdovi (Dolby Vision metadata library) is built from Rust source first —
# Ubuntu/Debian don't ship a libdovi-dev apt package, so we install cargo
# + cargo-c, compile libdovi via the dovi_tool repo's dolby_vision crate
# (matches the linuxserver/docker-ffmpeg base image's recipe), then build
# libplacebo with -Dlibdovi=enabled so vf_libplacebo can passthrough DV
# metadata. Without libdovi our libplacebo would still link/load, but
# Dolby Vision sources (transfer=dvhe) would lose metadata handling.
#
# libshaderc1 is pulled in as a dep of libshaderc-dev. Our libplacebo
# rebuild links against /usr/lib/x86_64-linux-gnu/libshaderc.so.1 (the
# Debian-packaged shaderc), NOT the base image's libshaderc_shared.so.1.
# Mark it as manually installed so the apt-get autoremove below doesn't
# drag it out — without this, ffmpeg fails with "libshaderc.so.1: cannot
# open shared object file". libvulkan1 isn't needed at runtime since
# libplacebo resolves libvulkan.so.1 from the base image's /usr/local/lib.
RUN apt-get update -qq && \
apt-get install -y -qq --no-install-recommends \
git build-essential meson ninja-build pkg-config \
libvulkan-dev libshaderc-dev libssl-dev ca-certificates && \
apt-mark manual libshaderc1 && \
# Install latest stable Rust via rustup. Ubuntu 24.04 ships rustc 1.75
# but recent dolby_vision crates require >= 1.79. We use --profile
# minimal to skip documentation source and keep the layer small (~250MB
# toolchain), and cargo install cargo-c separately since it needs the
# newer rustc too.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --default-toolchain stable --profile minimal --no-modify-path && \
export PATH="/root/.cargo/bin:$PATH" && \
cargo install cargo-c --locked && \
# Build libdovi (Rust) first so libplacebo's meson can find it.
git clone --depth 1 --branch 2.1.3 \
https://github.com/quietvoid/dovi_tool.git /tmp/dovi_tool && \
cd /tmp/dovi_tool/dolby_vision && \
cargo cinstall --release --prefix=/usr/local --library-type=cdylib && \
ldconfig && \
git clone --depth 1 --branch v7.360.1 --recursive \
https://code.videolan.org/videolan/libplacebo.git /tmp/libplacebo && \
cd /tmp/libplacebo && \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib/x86_64-linux-gnu/pkgconfig \
meson setup build --buildtype=release \
-Dvulkan=enabled -Dvk-proc-addr=enabled \
-Dshaderc=enabled -Dlibdovi=enabled && \
ninja -C build && \
install -m644 build/src/libplacebo.so.360 \
/usr/local/lib/x86_64-linux-gnu/libplacebo.so.360 && \
ldconfig && \
# Uninstall rustup toolchain + clean apt build deps + scratch dirs.
/root/.cargo/bin/rustup self uninstall -y && \
apt-get purge -y git build-essential meson ninja-build pkg-config \
libvulkan-dev libshaderc-dev libssl-dev && \
apt-get autoremove -y && \
rm -rf /tmp/libplacebo /tmp/dovi_tool /root/.cargo /root/.rustup \
/var/lib/apt/lists/*
# Intel QSV: install media driver (only for intel builds)
ARG GPU_TYPE
RUN if [ "$GPU_TYPE" = "intel" ]; then \
apt-get update -qq && \
apt-get install -y -qq --no-install-recommends \
intel-media-va-driver-non-free libmfx1 libva-drm2 libva2 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*; \
fi
COPY scripts/ /scripts/
RUN chmod +x /scripts/*.sh /scripts/*.pl