From 869ae1aa83bb1fdc4f6bb3bd9430a6b236c6bbab Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Sun, 31 May 2026 14:18:56 -0400 Subject: [PATCH] fix(playout): use static ffmpeg, not apt, to avoid CasparCG SIGABRT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit apt-get install ffmpeg pulls in ~80 transitive shared libs (libav*, libx264, libdrm, libva...) that perturb CasparCG 2.4.0's headless runtime linking and make it abort with SIGABRT (exit 134) on almost every launch. Replace it with john van sickle's self-contained static ffmpeg/ffprobe binaries in /usr/local/bin — the standalone CLI the HLS re-muxer needs, with zero new shared libraries, keeping CasparCG's environment identical to the known-good image. Co-Authored-By: Claude Opus 4.8 --- services/playout/Dockerfile | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/services/playout/Dockerfile b/services/playout/Dockerfile index f93bcba..d82953f 100644 --- a/services/playout/Dockerfile +++ b/services/playout/Dockerfile @@ -26,12 +26,17 @@ ARG NDI_SDK_URL= ENV DEBIAN_FRONTEND=noninteractive # CasparCG 2.4 runtime deps + Xvfb for headless GL + CEF (HTML producer) deps + -# Node 20 (NodeSource) + a STANDALONE ffmpeg CLI. The standalone ffmpeg is what -# the Node shim spawns to re-mux the CasparCG mpegts preview stream into clean, -# video-only HLS (CasparCG's own FFMPEG consumer silently drops -an and muxes a -# broken audio track, which black-screens the browser preview). +# Node 20 (NodeSource). +# +# NOTE: we deliberately do NOT `apt-get install ffmpeg`. That package drags in +# ~80 transitive shared libraries (libav*, libx264, libdrm, libva, ...) that +# perturb CasparCG 2.4.0's runtime linking and make its headless startup abort +# with SIGABRT (exit 134) on nearly every launch. A self-contained STATIC +# ffmpeg binary (installed below) gives us the standalone CLI the preview +# re-muxer needs with ZERO new shared libs, keeping CasparCG's environment +# identical to the known-good image. RUN apt-get update && apt-get install -y --no-install-recommends \ - ca-certificates curl unzip tar xz-utils gnupg ffmpeg \ + ca-certificates curl unzip tar xz-utils gnupg \ xvfb libgl1-mesa-dri libglu1-mesa fonts-dejavu-core \ libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \ libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \ @@ -44,6 +49,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && apt-get update && apt-get install -y --no-install-recommends nodejs \ && rm -rf /var/lib/apt/lists/* +# ── Standalone STATIC ffmpeg CLI (for the HLS preview re-muxer) ─────────────── +# john van sickle's static build is fully self-contained (no shared-lib deps), +# so it can't perturb CasparCG's runtime linking. Override FFMPEG_URL to mirror +# this into your own artifact store if upstream availability is a concern. +ARG FFMPEG_URL=https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz +RUN set -eux; \ + curl -fsSL "$FFMPEG_URL" -o /tmp/ffmpeg.tar.xz; \ + mkdir -p /tmp/ffmpeg; \ + tar xJf /tmp/ffmpeg.tar.xz -C /tmp/ffmpeg --strip-components=1; \ + cp /tmp/ffmpeg/ffmpeg /tmp/ffmpeg/ffprobe /usr/local/bin/; \ + chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe; \ + rm -rf /tmp/ffmpeg /tmp/ffmpeg.tar.xz; \ + /usr/local/bin/ffmpeg -version | head -1 + # ── CasparCG Server (ubuntu22 zip bundle) ──────────────────────────────────── # The zip extracts to /opt/casparcg_server with the binary at bin/casparcg and # its bundled .so files under lib/ (added to LD_LIBRARY_PATH by entrypoint.sh).