Skip to content

[bug] Admin activity shows encode targets for a Jellyfin remux after a server restart #3100

Closed

Description

@Quick104

What happened

After the API server restarts during a Jellyfin-client HLS stream that copies video, the admin activity view reports the negotiated encode targets for that stream: a target resolution and a stream bitrate that ffmpeg never applies. Before the restart, the same session shows no target, and the view falls back to the source's resolution and bitrate.

Example: a Jellyfin client whose bitrate limit negotiates 720p / 3608 kbps gets an HLS remux. Video is copied at the source's resolution and bitrate. Once the server restarts and the next segment request rebuilds the session, the admin view shows 720p and 3608 kbps for that stream.

This was found in source review and confirmed with a focused test. It was not reproduced on a live deployment.

Steps to reproduce

Not reproduced live. The trigger, traced in source:

  1. A Jellyfin-compatible client starts HLS playback that copies video (remux), with a bitrate limit that makes negotiation fill TargetResolution and TargetBitrateKbps.
  2. The jellycompat start path persists the recipe card with those negotiated targets. The card keeps them because they identify the negotiated stream.
  3. The API server restarts mid-stream.
  4. The next segment request rebuilds the playback session from the card (LoadOrReconstructTranscodeWithError → reconstructSession in internal/playback/transcode_manager.go). That code copies card.TargetResolution and card.TargetBitrateKbps onto the session whatever card.TargetCodecVideo is. Nothing on the segment path records the copy decision again.
  5. The reconciler persists those values, and enrichPlaybackSessionRow shows target_bitrate_kbps as the stream bitrate because jellycompat sessions never set stream_bitrate_kbps.

A focused test on main (3f486c9) calls TranscodeManager.ReconstructSession with a recipe card built from TargetCodecVideo: "copy", TargetResolution: "720p", TargetBitrateKbps: 18808. It returns a session with TargetResolution "720p" and TargetBitrateKbps 18808.

Expected behavior

A session that copies video reports no encode target after a restart, the same as before it. The admin view should keep showing the source's resolution and bitrate for that stream.

Silo version / commit

main at 3f486c9

Deployment

Local dev build

Area

Jellyfin-compatible clients

Clients affected

  • Web UI
  • Android
  • iOS/tvOS/macOS
  • Jellyfin-compat client (Infuse, Findroid, ...)
  • Other/not client-specific

Client app and device

Any Jellyfin-compatible client that gets an HLS remux under a bitrate limit.

Media and playback details

HLS with video copied (remux), audio copied or encoded, under a client bitrate limit.

Diagnostics report reference

None.

Relevant logs

No logs available.

Technical notes

  • PR fix(jellycompat): report the actual transcode target resolution/bitrate to admin sessions #921 makes jellycompat record encode targets on the session, and clears them when video is copied (recordTranscodeStreamDetails). The rebuild after a restart still restores them from the card, so the copy rule holds only until the server restarts. The same rebuild already happens on main.
  • Possible fixes: apply the copy rule where reconstructSession derives the session fields, or record the stream details again after the jellycompat segment path rebuilds the session. reconstructSession is shared with native playback, and native sessions also set StreamBitrateKbps, which the card does not carry. Check the native admin view after a restart before changing the shared path.
  • A fix at the shared boundary would overlap the copy check that fix(jellycompat): report the actual transcode target resolution/bitrate to admin sessions #921 adds, so it should follow that PR.

AI harness

Claude Code

AI tool(s)

Claude Code subagents (read-only review), Codex CLI

AI model(s)

claude-opus-5-5, gpt-6.1-sol

AI involvement

AI-assisted

Independent or adversarial review

Found while reviewing #921. Two read-only review agents flagged the restart path independently. A focused test on main confirmed the restored targets. A cross-provider review of the PR diff found nothing new.

Confirmations

  • I searched open and recently closed issues and pull requests, and this is not already reported
  • I reproduced this myself on a real deployment
  • Any logs provided are raw apart from marked redactions and are not AI-summarized; if none were available, I said so above

Source: found in review of #921

Activity

  1. added
    bug
    on Oct 26, 2026
  2. added
    impact: polish
    priority: P2
    on Oct 26, 2026
  3. Rhainland commented on Nov 11, 2026

    @Rhainland
    Contributor

    Reproduced on origin/main at 48748d9 on a local build. A Jellyfin client played a 1080p H.264 MKV under a 4 Mbps limit, which gives an HLS remux. I fetched a few segments, restarted the server and requested the next segment. /api/v2/admin/sessions then showed target_resolution: "720p" for the copied stream. Before the restart it showed no target.

    Cause: the recipe card keeps the negotiated resolution and bitrate so the stream can be matched and rebuilt. When the session was rebuilt after a restart, those values were copied onto it even though the video is only copied.

    Fix in #3982: a session rebuilt from a video-copy card no longer reports encode targets, so the admin view shows the same thing before and after a restart. Checked on a local build of the fix with the same steps and data: after the restart the remux reports no target, and an HLS encode still reports its 540p / 1233 kbps target. A test at the rebuild step covers both the copy and the encode case.

    AI disclosure: reproduced and fixed by Claude Code (claude-opus-5-5) at the maintainer's direction.

  4. added a commit that references this issue on Nov 12, 2026
    15a3578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugimpact: polishpriority: P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions