Skip to content

build(docker): bundle jellyfin-ffmpeg 8.1.3 - #1587

Merged
Quick104 merged 1 commit into
mainfrom
t3code/check-server-ffmpeg-version
Sep 27, 2026
Merged

Quick104 merged 1 commit into
mainfrom
t3code/check-server-ffmpeg-version

Conversation

@Quick104

@Quick104 Quick104 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

The server and dev images install jellyfin-ffmpeg7 from Jellyfin's apt repository without a version pin. Jellyfin moved to the 8.1 branch with Jellyfin 12.0 and has not released a 7.1 build since 7.1.4-3 in June, so Silo images stay on FFmpeg 7.1.4 and miss the 8.1 fixes. Which FFmpeg an image gets also depends on the day it was built. This PR switches both images to jellyfin-ffmpeg8, pinned to 8.1.3-1.

What changes for a deployment:

  • The bundled Intel media stack moves from iHD 25.4.6 to 26.2.4, with newer libvpl, libva and Mesa (26.0.8). The 8.1 releases fix QSV paths Silo's filter graphs use: hwmap combined with swscale, HDR side data from the QSV AV1 decoder, and sub2video stalling at the end of a stream (bitmap subtitle burn-in).
  • HLG sources tone-mapped to SDR come out slightly darker in shadows and midtones, because jellyfin-ffmpeg 8 uses the BT.2446 Method B EOTF for HLG. HDR10 and Dolby Vision tone mapping are unchanged: HDR10 and profile 8 frames came out identical in testing, and profile 7 differed only at encoder-noise level.
  • ffprobe 8.1 no longer reports refs in stream info, so video tracks scanned after the upgrade have no reference_frames (the native API field and the jellycompat RefFrames stream field are omitted). FFmpeg 7 reported the decoder default of 1 for every file, not a real count. Jellyfin 12 on FFmpeg 8.1 behaves the same way, and no Jellyfin first-party client sends RefFrames profile conditions, so the condition handling is unchanged.

Approach

  • Dockerfile and Dockerfile.dev install jellyfin-ffmpeg8=${JELLYFIN_FFMPEG_VERSION}-trixie, pinned through an ARG like the Intel runtime versions beside it. The package replaces jellyfin-ffmpeg7 and installs to the same /usr/lib/jellyfin-ffmpeg path, so the playback.ffmpeg_path default does not change. Later FFmpeg updates become a one-line reviewed change.
  • jellyfin-ffmpeg 8 reports DTS:X carried on a DTS-HD HRA stream as DTS-HD HRA + DTS:X (or DTS-HD HRA + DTS:X IMAX). jellycompat's copied-audio HLS CODECS mapping only knew the MA variants, so these tracks would have been advertised as core DTS (dtsc). They now map to dtsh, the same as plain DTS-HD HRA. Jellyfin 12 still returns dtsc for them.

Validation

  • Go gate: build, gofmt, vet, make lint-changed, make test-go and make verify-local-paths pass. No web files changed; the frontend built as part of the image build.
  • The Go packages that run real FFmpeg (playback, jellycompat, tonemap, scanner, intromarkers, chapterthumbs, mediaprobe, transcodenode) pass against both jellyfin-ffmpeg 7.1.4 and 8.1.3 in Debian trixie containers.
  • Built the production image from this branch and from main and ran each against the same database on a test server with an Intel GPU using QSV. Scanning; HDR10, Dolby Vision profile 7 and 8, and HLG transcodes to SDR with QSV tone mapping; PGS burn-in on SDR and tone-mapped sources; DTS-HD HRA HLS copy; and chapter thumbnail generation all behave the same on both builds. Transcoded segments are H.264 BT.709 with no HDR or Dolby Vision side data.
  • On library files, both FFmpeg builds produce the same ffprobe stream fields (except refs) and Dolby Vision configuration records, the same dvh1 fMP4 remux with the dvvC record intact, the same dovi_rpu strip result, and the same HLS output and framecrc, silencedetect and chromaprint output that Silo parses.
  • The pinned arm64 package resolves on trixie in an apt simulation. The arm64 image itself was not built.
  • Not exercised: NVENC, VideoToolbox, VAAPI without QSV, and intro detection end to end.

Risks

  • Hardware backends other than Intel QSV were not run on real hardware. They use filters that still exist in 8.1, and startup probes gate each backend, so a missing capability falls back instead of failing playback.
  • Update the API server and remote transcode nodes together. A mixed 7/8 cluster renders HLG sources differently depending on which executor runs the transcode.
  • With the pin, images no longer pick up new jellyfin-ffmpeg8 point releases on their own, and the image build fails if Jellyfin stops serving 8.1.3-1 for an architecture. Either case is fixed by changing JELLYFIN_FFMPEG_VERSION.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (Claude Agent SDK, in T3 Code)
  • Tool(s): Claude Code, GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated; the maintainer asked for the upgrade and for verification on a sandbox with the production GPU setup before the PR
  • Adversarial review: an independent Claude Code review agent (claude-opus-5-5) read the full diff and searched the playback, tone-map, scanner, jellycompat, API v2, chapter-thumbnail and overlay code for FFmpeg output parsing and profile-name matching that 8.x could break: the -filters flags column, extra framecrc columns, every refs consumer, other DTS profile matches, capability hashing, and mixed-version node clusters. It found no defects. It pointed out that the pin fails the image build if Jellyfin stops serving the pinned version; that trade-off is kept and listed under Risks.

🤖 Generated with Claude Code

Note

Bump Docker images to jellyfin-ffmpeg 8.1.3

  • Runtime and dev images now install the version-pinned jellyfin-ffmpeg8 8.1.3-1-trixie package instead of jellyfin-ffmpeg7, with a build argument for the version. See Dockerfile and Dockerfile.dev.
  • Fixes compatDTSCodecString in streams.go: DTS-HD HRA streams with DTS:X or DTS:X IMAX profiles now map to the DTS-HD sample-entry code instead of the DTS core code. Adds test coverage in streams_test.go.
  • Updates comments in video.go, remux.go, and dev-remote-setup.sh to reflect FFmpeg 8.1.
  • Risk: FFmpeg 8.1.3 changes behavior at runtime — check Refs field semantics documented in video.go and Dolby Vision remux handling in remux.go.

Macroscope summarized 4a57e65.

Switch the server and dev images from the unpinned jellyfin-ffmpeg7
(FFmpeg 7.1.4) to jellyfin-ffmpeg8 pinned at 8.1.3-1. Jellyfin moved to
the 8.1 branch with Jellyfin 12.0 and no longer releases 7.1 builds.

jellyfin-ffmpeg 8 reports DTS:X on a DTS-HD HRA stream as its own
profile names. Map them to dtsh in jellycompat HLS master playlists,
like plain DTS-HD HRA, instead of falling back to core DTS.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kody-ai

kody-ai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-27T16:23:09.518810Z 4a57e65 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c849c6d9-25d8-4352-905e-5a63b51a994a

📥 Commits

Reviewing files that changed from the base of the PR and between 3838c3a and 4a57e65.

📒 Files selected for processing (7)
  • Dockerfile
  • Dockerfile.dev
  • internal/jellycompat/streams.go
  • internal/jellycompat/streams_test.go
  • internal/mediaprobe/video.go
  • internal/playback/remux.go
  • scripts/dev-remote-setup.sh

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The runtime images now use a version-pinned jellyfin-ffmpeg8 package. The DTS-HD HRA codec mapping includes DTS:X profile variants, and FFmpeg compatibility comments and setup text have been updated.

Changes

FFmpeg compatibility

Layer / File(s) Summary
FFmpeg package selection and compatibility notes
Dockerfile, Dockerfile.dev, internal/mediaprobe/video.go, internal/playback/remux.go, scripts/dev-remote-setup.sh
Both Dockerfiles install jellyfin-ffmpeg8 at version 8.1.3-1 by default. Comments describe FFmpeg version differences, and the setup description identifies ffmpeg as the installed and linked executable.
DTS-HD HRA profile mapping
internal/jellycompat/streams.go, internal/jellycompat/streams_test.go
DTS-HD HRA profiles with DTS:X and DTS:X IMAX suffixes now map to dtsh. Tests cover both variants.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: neurekadev, tomislav

Merge Risk: ⚪ Minimal · up to 4a57e

The pinned FFmpeg package is available for both supported image architectures. The reviewed changes establish no material merge-blocking risk.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 4a57e

The version pin reduces build drift, but the upgrade affects media processing and can change playback decisions for some client profiles. Runtime and rollback behavior have not been fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The dependency change reaches media-processing behavior in images built from both Dockerfiles. The evidence does not establish which deployed services, tenants, or media sources exercise the new package.

Trust Boundaries and Controls

  • observed — The package install uses the existing Jellyfin apt repository with a configured signing key and now requests a specific version. The inspected change does not modify a production authentication or authorization boundary.

Resilience and Maintainability Implications

  • inferred — Pinning reduces version selection drift between builds, while already-persisted scan metadata can outlive an image rollback. Whether that transition affects a deployment depends on its scan and client-profile usage.

Hardening Proposals

  • proposed — Before broad rollout, validate scans and playback negotiation with representative media and externally supplied device profiles, and define how affected tracks would be rescanned after rollback. This is a validation proposal, not an identified security bypass.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 5 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: bundling jellyfin-ffmpeg 8.1.3 in Docker images.
Description check ✅ Passed The description directly explains the FFmpeg upgrade, version pinning, compatibility changes, validation, and known risks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 5 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kody-ai

kody-ai Bot commented Sep 27, 2026

Copy link
Copy Markdown

kody code-review Business Logic medium

Business Rules Validation

Task: 5603363058 — Local blob store DeletePrefix ignores cancellation while removing files
Task Link: #1580
Status: Issues Found
Confidence: high

Findings

MUST_FIX: PR scope does not match the task scope (scope mismatch)

Requirement: "blobstore.Filesystem.DeletePrefix, the local-disk artwork store, stops honouring its context once it starts removing files." (task description, "What happened"; AC #1–#4)
Missing in code: No evidence in this PR diff of any change to internal/blobstore/filesystem.go or to DeletePrefix. The changed files are Dockerfile, Dockerfile.dev, internal/jellycompat/streams.go, internal/jellycompat/streams_test.go, internal/mediaprobe/video.go, internal/playback/remux.go, and scripts/dev-remote-setup.sh — all concerning the jellyfin-ffmpeg7 → jellyfin-ffmpeg8 upgrade, DTS profile mapping and refs stream metadata.
Suggested action: Implement the DeletePrefix cancellation fix in this PR, or link the PR to the correct task if this work belongs to a separate FFmpeg-upgrade task.

MUST_FIX: No evidence of observing the context for the whole removal operation

Requirement: "DeletePrefix observes cancellation for the whole operation. When the context ends, it stops, returns the context's error with the number of files removed so far, and leaves the rest for a later call." (task description, "Expected behavior")
Missing in code: No evidence in this PR diff of replacing the root.RemoveAll(prefix) path with a context-aware removal loop. The reported defect — "DeletePrefix visits every entry twice: once in fs.WalkDir to count files, with a context check per entry, and again in root.RemoveAll, which has no context check." (AC #4) — is untouched by the diff.
Suggested action: Take ctx into account during the removal phase, so a deadline or cancellation arriving mid-removal is detected instead of running to completion.

MUST_FIX: No evidence of returning the partial removal count with ctx.Err()

Requirement: ""On a context error, return the count so far with ctx.Err()." (task description, Technical notes, AC #5)
Missing in code: No evidence in this PR diff of a removal path that removes regular files during the walk after checking the context, counts what was actually removed, prunes emptied directories, and returns (countSoFar, ctx.Err()) on cancellation.
Suggested action: Remove regular files during the walk after each context check, count what was actually removed, prune emptied directories as prune already does, and on a context error return the count so far together with ctx.Err().

SUGGESTION: No evidence that the listed DeletePrefix callers were considered

Requirement: "Callers of DeletePrefix include: the image cache cleanup job (internal/adminjob/image_cache_cleanup.go); collection artwork cleanup (internal/api/handlers/library_collections.go); profile avatar replacement (internal/api/handlers/profile_avatars.go); stale local image deletion (internal/metadata/image_cache_processor.go); the scanner's orphaned artwork cleanup (internal/scanner/scanner.go)." (AC #6–#11)
Missing in code: This PR diff does not show changes in any of those caller files or in the shared DeletePrefix contract, so the behaviour they depend on is not addressed here.
Suggested action: When the fix is implemented, verify each caller tolerates the new (removedCount, ctx.Err()) return — especially callers that currently cannot get a context error back after removal has started.

INFO: The task is a bug report without formal acceptance criteria

Requirement: Task quality was classified as PARTIAL.
Observation: The requirements used above are derived from the "What happened", "Expected behavior" and "Technical notes" sections of the issue; no explicit acceptance-criteria list is present. AC #12–#16 ("AI harness: Claude Code", "AI tool(s): Claude Code", "AI model(s): claude-opus-5-5", "AI involvement: ...", "Independent or adversarial review: n/a") are disclosure metadata, not testable requirements, and were not evaluated as business rules.
Suggested action: Optionally add explicit acceptance criteria to the task to make future validations more precise.


Analysis performed by Kodus AI Business Rules Validator


💡 This validation runs automatically only on the first review of a pull request. To run it again, comment @kody -v business-logic.

Comment thread Dockerfile
Comment on lines +65 to +73
ARG JELLYFIN_FFMPEG_VERSION=8.1.3-1
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl gnupg && \
curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key \
| gpg --dearmor -o /usr/share/keyrings/jellyfin.gpg && \
echo "deb [signed-by=/usr/share/keyrings/jellyfin.gpg arch=${TARGETARCH}] https://repo.jellyfin.org/debian trixie main" \
> /etc/apt/sources.list.d/jellyfin.list && \
apt-get update && \
apt-get install -y --no-install-recommends jellyfin-ffmpeg7 git libvips42 fonts-noto-core fonts-noto-cjk && \
apt-get install -y --no-install-recommends "jellyfin-ffmpeg8=${JELLYFIN_FFMPEG_VERSION}-trixie" git libvips42 fonts-noto-core fonts-noto-cjk && \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kody code-review Bug high

Upgrading the runtime to jellyfin-ffmpeg 8.1 makes ffprobe report refs: 0, which mediaprobe copies into ReferenceFrames as an absent value. Because intConditionValue sets hasNum: value > 0 (deviceprofile_conditions.go:374), the required RefFrames condition key is dropped, causing conditionMatches to return !IsRequired (deviceprofile_conditions.go:243-245, with IsRequired defaulting to true on line 54); this lets AVC files with more than 4 reference frames skip the RefFrames <= 4 codec-profile condition and be served as direct play instead of transcoding. Decode frames during probing (add -show_frames/-count_frames to the ffprobe invocation) so refs is populated, or treat a zero Refs as unknown-and-constraining rather than absent, then verify with the scanner's ffprobe command.

Prompt for LLM

File Dockerfile:

Line 65 to 73:

Upgrading the runtime to jellyfin-ffmpeg 8.1 makes ffprobe report `refs: 0`, which mediaprobe copies into `ReferenceFrames` as an absent value. Because `intConditionValue` sets `hasNum: value > 0` (deviceprofile_conditions.go:374), the required `RefFrames` condition key is dropped, causing `conditionMatches` to return `!IsRequired` (deviceprofile_conditions.go:243-245, with IsRequired defaulting to true on line 54); this lets AVC files with more than 4 reference frames skip the `RefFrames <= 4` codec-profile condition and be served as direct play instead of transcoding. Decode frames during probing (add `-show_frames`/`-count_frames` to the ffprobe invocation) so `refs` is populated, or treat a zero Refs as unknown-and-constraining rather than absent, then verify with the scanner's ffprobe command.

Talk to Kody by mentioning @kody

Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.

​

​

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked against the code, and the direction is reversed. When a client omits IsRequired, ProfileCondition treats it as required, as Jellyfin does (internal/jellycompat/deviceprofile_conditions.go:50-54), and conditionMatches returns !IsRequired for an unknown value (:242-244). A required RefFrames <= 4 condition therefore fails for files scanned after this upgrade, and negotiation falls back to a transcode. It never becomes direct play. Only a condition the client marks IsRequired: false passes on an unknown value, which matches Jellyfin's ConditionProcessor.

This is also not new exposure. With FFmpeg 7, -show_streams reported the decoder default refs: 1 for every file, so RefFrames <= 4 already passed for files with more reference frames. Jellyfin 12 on FFmpeg 8.1 leaves RefFrames null in the same way, and no Jellyfin first-party client sends RefFrames conditions.

Reading one frame (-read_intervals %+#1 -show_frames) does return the real count on both 7.1.4 and 8.1.3: 5 on an x264 sample where -show_streams reported 1. That adds a frame decode to every scan probe and changes negotiation for any client that sends the condition, so it belongs in its own change rather than in this upgrade.

Reply by Claude Code (claude-opus-5-5).

@Quick104

Copy link
Copy Markdown
Contributor Author

This validation matched the wrong issue. The PR is not linked to #1580 (its description has Related issue: N/A and no Closes line), and it does not touch blobstore. The DeletePrefix cancellation fix is separate work, so these findings don't apply to this PR.

Reply by Claude Code (claude-opus-5-5).

@Quick104
Quick104 merged commit 82b5b39 into main Sep 27, 2026
15 checks passed
@Quick104
Quick104 deleted the t3code/check-server-ffmpeg-version branch September 27, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant