Repository navigation
fix(jellycompat): report the actual transcode target resolution/bitrate to admin sessions - #921
Conversation
…te to admin sessions SetTranscodeStreamDetails recorded the encode's video/audio codec, hw accel, and tone-map mode on the upstream session, but never its TargetResolution or TargetBitrateKbps. Only the native (non-compat) playback path threaded those through directly. The admin sessions view falls back to displaying the source's own resolution/bitrate whenever target_resolution is unset for a transcoding session, so every jellycompat-driven transcode — including a MaxStreamingBitrate-capped downscale from Silo-Server#912 — showed as if it were streaming the source unmodified, even though the real ffmpeg process was correctly capped. recordTranscodeStreamDetails now forwards opts.TargetResolution and opts.TargetBitrateKbps through the extended setter, so session sync and the admin activity views reflect what ffmpeg is actually doing. Fixes Silo-Server#920.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Extend session recording internal/playback/session.go, internal/jellycompat/handlers_playback.go, internal/jellycompat/audio_selection_test.go, internal/jellycompat/remote_transcode_reconstruct_test.go |
The session recording method and Jellycompat setter interfaces accept target resolution and bitrate. Session managers store both values. |
Forward Jellycompat targets internal/jellycompat/handlers_playback.go, internal/jellycompat/audio_selection_test.go |
Jellycompat playback forwards the targets and clears both values for copied video. Tests check recorded targets and retained codec and audio-transcode details. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related issues
- [bug] Admin activity shows encode targets for a Jellyfin remux after a server restart #3100: This change clears encode targets for copied video, which may relate to the issue’s report of unused encode targets returning after restart.
Suggested labels: bug, go, size/L, impact: playback
Suggested reviewers: quick104
Merge Risk: 
Minimal · up to 6af23
-
Encoded playback targets are recorded for admin sessions, while copied video omits unused encoder targets. No actionable merge-blocking risk is established.
Security architecture risk: 
Minimal · up to 6af23
-
The change corrects playback activity metadata without changing encoder authority, access checks, or playback routing. The inspected changes introduce no material security risk. Existing failure windows can leave stale activity metadata, but no security-control impact was established.
Retained concerns
No architecture-level concerns identified.Security review details
-
Security Blast Radius
- inferred — The introduced effect is bounded to target metadata on existing playback sessions and its existing synchronized admin representation. The complete production delta does not add a network route, session identity, execution destination, credential, or authorization decision.
Trust Boundaries and Controls
- observed — In the inspected segment-recovery entry path, the handler requires an authenticated compatibility session, matches the playback session's token, requires an upstream session ID, and validates the selected route before invoking recipe preparation that can reach transcode recording. These checks are unchanged by the PR.
Resilience and Maintainability Implications
- observed — Local telemetry publication precedes durable recipe persistence. If persistence fails, the code closes the exact transcode runtime and returns an error; the inspected segment caller returns the error without explicitly reverting telemetry. This ordering predates the PR, and the new fields inherit its possible stale-display window. Runtime cleanup remains ownership-scoped rather than closing a concurrent successor.
-
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: the jellycompat transcode path now reports the actual encoder target resolution and bitrate to admin sessions. It matches the changeset, which threads target resolution and bitrate through SetTranscodeStreamDetails and recordTranscodeStreamDetails and clears them for video-copy streams. The title is 89 characters, slightly long, but it is specific and descriptive.
Full details: Description check
-
Explanation
The description states the problem (admin activity view shows source resolution and bitrate for Jellyfin-compatible transcodes), the approach (record effective transcode targets through existing session telemetry, omit encoder targets for video-copy streams), validation, risks, and a linked issue. It relates directly to the changeset.
Full details: Linked Issues check
-
Explanation
Issue
#920requires Jellyfin-compatible transcode sessions to report the effective encode target resolution and bitrate to the admin sessions view. The whole-PR diff shows this behavior. Ininternal/jellycompat/handlers_playback.go,recordTranscodeStreamDetailsreadsopts.TargetResolutionandopts.TargetBitrateKbpsand passes them toSetTranscodeStreamDetails. Ininternal/playback/session.go,SetTranscodeStreamDetailsstores them ins.TargetResolutionands.TargetBitrateKbps. For video copy (opts.TargetCodecVideo == compatCopyCodec), the handler clears both values before recording, so the admin view falls back to source values for copied video. The incremental change since the previous reviewed head (2366605f) is comment-only in the changed source files, plus a test consolidation that was not read in this pass. The previous PASS conclusion for the implementation remains supported. The incremental diff tool output was unavailable (diff metadata exceeded the inspection buffer), so the test consolidation is not directly verified here. The PR author reports that the consolidated tests pass and theTestRecordTranscodeStreamDetailsTargetscases fail on main and pass on this head. The remote-node path was not exercised live, so the remote behavior relies on code and the reported start-path changes.
Full details: Out of Scope Changes check
-
Explanation
All changed areas connect to
#920. TheSetTranscodeStreamDetailssignature change adds two arguments for target resolution and bitrate. This is required for the telemetry path the issue requests. TherecordTranscodeStreamDetailschange forwards those values and clears them for copied video. The session manager change stores the values. The test fake and regression test updates support the changed interface and the new behavior. The comment edits inhandlers_playback.goandsession.godescribe the new telemetry. The PR description reports no encoding, routing, or API schema change, and the whole-PR diffs of the core files show no unrelated logic. The test consolidation in6af23438was not read directly, because the incremental diff could not be retrieved. This does not change the verdict, because the consolidated tests cover the same#920behavior according to the PR summary.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
All checks pass. Live verification: main alone has no code path that sets a non-empty Also worth noting from that same testing session: selecting different quality tiers in the Jellyfin Android app and comparing the resulting dashboard resolution against Jellyfin's own canonical bitrate→resolution table ( |
Keeps this branch's target resolution and bitrate arguments and main's EffectiveEncoderHWAccel() in the compat transcode details call. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code Review Could Not Complete
|
| Options | Enabled |
|---|---|
| Bug | ✅ |
| Performance | ✅ |
| Security | ✅ |
| Business Logic | ❌ |
|
The PR body is missing the required
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
|
@kody review |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Providing Context (Files & MCPs)Add these hints in your PR description (or a comment) to unlock deeper checks:
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Quick104
left a comment
There was a problem hiding this comment.
Reviewed 603b3b15fd625df555606ac8dbd0cdb8ed457b17. One verified telemetry regression is described inline; I am applying the bounded fix. Independent read-only review by GPT-6.1 Sol and Claude Opus 5.5 reached the same finding.
AI disclosure: Codex (gpt-6.1-sol); independent review through Claude advisor (claude-opus-5-5, high effort).
Co-authored-by: Codex <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
Reviewed The change still does what it says on current main. Every jellycompat start path records the options FFmpeg actually runs with. The local start records the running session's options after the auto-pipeline and tone-map fallbacks. The local rebuild from the compat store records the rebuilt session's options. The remote start records the request it dispatched, after the VideoToolbox bitrate and software-retry adjustments. A new start, including a fallback to another node or to local, overwrites the earlier targets, and a remote start that loses to a local one leaves the local start's values in place. The merges since the last review changed none of these paths. Addressed in Remaining for maintainers:
Verification: Validated features: no passed case is affected. #1206 C1 and #1207 C1 cover the admin session details this changes and are Not run. #1246 C1–C3 are unaffected. Parity and manual: the response fields already existed, and native sessions already fill them, so Apple, Android and web need no change. The user manual doesn't describe these values, so it needs no update. Review method: Claude Code ( Fit: 9/10 · Readiness: 9/10 — ready. CI passed on |
Co-authored-by: Codex <[email protected]>
Main's Silo-Server#2817 removed TestSetTranscodeStreamDetails and TestRecipeCardLegacyDecodeHasEmptyPlayMethod as low-value. This branch had extended the first for the target resolution and bitrate; take main's removal. The jellycompat tests here still check that sessions report both. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104
left a comment
There was a problem hiding this comment.
Reviewed 2366605f. No correctness defect in the change itself. Two small cleanups are inline, and I'm fixing both in a commit on this branch, so there's no need to change anything yourself. Two related problems that predate this PR are in the summary comment.
…nager Fold the fake-backed forwarding test into the copy-target table, which drives the real SessionManager, and drop the issue history from the recordTranscodeStreamDetails comment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The change affects the admin Activity view: transcodes should show their actual target resolution and bitrate, while copied video should retain source-based values. The private Evidence page should let reviewers verify before-and-after captures of the same session on desktop and mobile, including an encoded session and the copy-stream case. The PR describes desktop and mobile captures of the copy-stream correction and includes an evidence link; I could not inspect the private page. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
Problem
The admin activity view can show the source resolution and bitrate for a Jellyfin-compatible transcode even when the encoder produces a smaller stream. This change reports the encoder's target values. Streams that copy video keep showing the source's values.
Closes #920
Related issue: N/A
Validation tasks: none (no passed case is affected; #1206 C1 and #1207 C1 cover the admin session details this changes and are Not run)
Approach
Record the effective transcode targets through the existing session telemetry path for local, reconstructed and remote playback. When video is copied, leave the unused encoder targets out of telemetry. The negotiated recipe keeps them for fallback and reconstruction.
Validation
TestRecordTranscodeStreamDetailsTargetsdrives the real session manager with an encode, a copy with copied audio, and a copy with encoded audio. Every row fails on current main and passes on this head. The jellycompat, playback, admin handler and reconciler package tests pass after merging current main, exceptTestCopyRemuxSubtitleRenditionRealFFmpeg, which fails the same way on untouched main with the local FFmpeg. Changed-line lint reports zero issues.ecca6cf0, the same copied H.264/AAC stream changed from a reported 18.808 Mbps to its 2.610 Mbps source bitrate. Desktop and mobile web captures confirm the displayed correction; manifests and media segments still load. Later commits only merge main and change tests and a comment, so the sandbox was not rebuilt.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-921/
Risks
Encoding, routing and API schemas are unchanged. Apple and Android need no matching change. The user manual already describes comparing source and delivered media, so no manual update is needed.
After an API server restart, a session that copies video is rebuilt from its recipe card and shows the negotiated targets again. That happens on main too; #3100 tracks it.
Checklist
AI Disclosure
gpt-6.1-solat xhigh effort;claude-opus-5-5at high effort. The original author did not specify the Claude model.b7e777c1. A second review on2366605f(three read-only finders, a validation check, and one cross-provider round that saw only the diff) found no defect in the change. It led to a test consolidation and a comment fix in6af23438, and to [bug] Admin activity shows encode targets for a Jellyfin remux after a server restart #3100 for the restart case above.Note
Report actual transcode target resolution and bitrate to admin sessions
playback.SessionManager.SetTranscodeStreamDetailsnow accepts and persists target resolution and target bitrate alongside the existing codec, audio, hardware, and tone-map decisions in session.gojellycompat.PlaybackHandler.recordTranscodeStreamDetailsin handlers_playback.go derives both values from the transcode options and forwards them to the session managerSetTranscodeStreamDetailsgains two required arguments; all implementers and test fakes must be updatedMacroscope summarized 2366605.