Skip to content

[bug] jellycompat ignores MaxStreamingBitrate and resolution caps in PlaybackInfo, causing clients to direct play at native file bitrate #873

Closed

Description

@rangoDJ

What happened

When connecting to Silo Server with a Jellyfin-compatible client (such as the native Jellyfin Android app or Findroid) and selecting a lower playback quality preset (e.g. 720p 4 Mbps or 1080p 10 Mbps) for a high-bitrate/4K media item, playback continues at the media file's native resolution and bitrate instead of downscaling/transcoding.

Steps to reproduce

  1. Connect the Jellyfin Android app to a Silo Server instance.
  2. Select and play a video item that has high bitrate (e.g., 4K or 1080p Remux at 20+ Mbps).
  3. In the playback player settings, select a lower quality profile (e.g., 720p - 4 Mbps).
  4. Observe that the stream continues to direct play the source file at native resolution and bitrate without downscaling or transcoding.

Expected behavior

Selecting a lower quality profile should instruct the server to transcode/downscale to the requested bitrate/resolution caps (e.g. MaxStreamingBitrate), rather than advertising SupportsDirectPlay: true and serving the full-bitrate static direct stream URL.

Silo version / commit

main (be9a2747 / latest)

Deployment

Local dev build

Clients affected

  • Jellyfin-compat client (Infuse, Findroid, ...)

Relevant logs

no logs available

Technical notes

  1. SupportsDirectPlay evaluation ignores bitrate & resolution caps:

    • In internal/jellycompat/handlers_playback.go (buildPlaybackSource), SupportsDirectPlay is computed purely via container and codec matching (profile.SupportsDirectPlayForAudioStream).
    • In internal/jellycompat/deviceprofile.go and internal/jellycompat/deviceprofile_conditions.go, p.MaxStreamingBitrate and playbackInfoRequest.MaxStreamingBitrate are not compared against the source file's version.Bitrate or dimensions.
    • Consequently, mediaSourceDTO returns SupportsDirectPlay: true and a DirectStreamUrl pointing to /Videos/{id}/stream?static=true..., prompting the client to choose Direct Play.
  2. Transcode options lack resolution/bitrate parameter ingestion:

    • In internal/jellycompat/streams.go (ensureTranscodeSessionWithToneMapMode), playback.TranscodeOpts is created without setting TargetResolution or TargetBitrateKbps from client query parameters (videoBitRate, maxWidth, maxHeight).
    • If the video codec matches the device profile, compatHLSCopiesVideo is set to true, forcing opts.TargetCodecVideo = "copy" (video stream remux) regardless of client bandwidth limits.

AI harness

none

AI tool(s)

none

AI model(s)

n/a

AI involvement

Human-written, AI-reviewed

Independent or adversarial review

n/a

Confirmations

  • 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

Activity

  1. added
    bug
    triaged
    and removed
    triaged
    on Sep 20, 2026
  2. added theissue type on Sep 20, 2026
  3. removed
    bug
    on Sep 20, 2026
  4. blurbery commented on Oct 19, 2026

    @blurbery
    Contributor

    Most of this is fixed on main now. Checked against 365e3d4:

    One part is still open: a device profile's Width/Height limit, for example Width LessThanEqual 1280, never makes the transcode smaller. The output height comes only from the bitrate ladder, so with no bitrate cap or a high one, a required width condition rules the transcode out and the client gets no compatible stream. The "known width exceeds constraint" case in playback_output_conditions_test.go locks that in. videoBitRate, maxWidth and maxHeight on the HLS URL are ignored on purpose, since the limits are frozen at PlaybackInfo.

    It might be worth narrowing the title to the width/height case.

  5. rangoDJ commented on Oct 26, 2026

    @rangoDJ
    ContributorAuthor

    Rechecked against current main: the remaining width/height case is fixed by #2987 (07b4df0).

    A device profile's Width/Height limits now feed the encode target. compatFitResolution lowers the transcode height until the scaled frame fits both, so a required Width LessThanEqual 1280 no longer rules out the transcode when there is no bitrate cap or a high one. TestRoku1080pProfileEncodesWithinItsLimits covers it (a 4K source with a 1920-wide limit encodes at 1080p, a 3840x1608 scope source at 804p). The "known width exceeds constraint" case in playback_output_conditions_test.go now expects the transcode to be allowed.

    Together with the bitrate-cap work listed above, that covers everything in this issue, so closing it as completed.

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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions