Skip to content

[bug] Safari rejects chunked progressive remux responses without byte-range support #648

Closed

Description

@tomislav

What happened

After deploying the merged fix from #617, Safari capability negotiation succeeds and Silo selects a Dolby Vision server_remux_progressive plan. The stream still fails immediately in Safari, followed by:

This file's dynamic range can't be converted for this device, and it can't be played as-is.

The generated media itself is valid. A controlled test using the exact same remuxed MP4 bytes isolates the failure to the HTTP transport.

Environment

Source characteristics

Represented generically here as video.mkv:

  • HEVC Main 10
  • Dolby Vision Profile 8.1, Level 6
  • Base-layer compatibility ID 1
  • BT.2020/PQ
  • E-AC-3 5.1
  • Approximately 2160p24
  • MKV requiring container normalization

Server behavior

Planning now succeeds:

outcome=plan
decision_reason=container_normalization
delivery=server_remux_progressive
play_method=remux
dynamic_range=dolby_vision
dv_profile=8

Safari requests the stream, receives HTTP 200, then reports decoder_error within approximately 200 ms.

The equivalent FFmpeg remux was captured and verified to contain:

  • dvh1
  • hvcC
  • dvvC / DOVI configuration record
  • DV Profile 8, Level 6
  • BL compatibility ID 1
  • RPU present, no enhancement layer
  • HEVC Main 10 with BT.2020/PQ
  • E-AC-3 audio

Both the full remux and a video-only remux play when opened as files, ruling out the DV bitstream and audio track.

Controlled HTTP transport test

The same MP4 bytes were served to the same Safari instance in two ways:

HTTP delivery Result
Known Content-Length, Accept-Ranges: bytes, and correct 206 Partial Content responses Plays
Unbounded 200 OK, Transfer-Encoding: chunked, no byte-range support Fails

The second case matches the current progressive-remux implementation in ServeRemuxWithOptions, which streams FFmpeg stdout as an unknown-length chunked response.

The same DV P8.1 source packaged as segmented fMP4 HLS also plays successfully in Safari.

This makes the failure reproducible independently of the deployment, proxy, original MKV container, codec probing, display detection, audio, and Dolby Vision sample-entry signaling.

Root cause

Safari's media stack requires range-capable HTTP delivery for MP4 media. Silo's live progressive remux cannot honor the browser's byte-range requests because it is produced as an unbounded FFmpeg pipe. Safari rejects the response even though the resulting complete MP4 is playable.

Apple documents byte-range support as required for Safari media servers:

https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html

WebKit also documents that Safari rejects media range requests answered with 200 OK rather than 206 Partial Content:

https://bugs.webkit.org/show_bug.cgi?id=211323

Expected behavior

Silo should not select an unbounded progressive-remux transport for a Safari route that requires byte-range-capable MP4 delivery.

A container-normalization remux should use a Safari-compatible delivery, most naturally the existing segmented server_remux_hls path.

Suggested fix

  1. Route Safari container-normalization remuxes through copy-codec HLS instead of server_remux_progressive.

  2. Preserve Profile 8 signaling in the HLS copy pipeline using:

    -tag:v dvh1 -strict unofficial
    
  3. Scope the verified DV/HDR capability to Safari's native-HLS delivery so the HLS plan passes delivery-specific capability validation.

  4. Add a planner regression test asserting that Safari does not receive the unbounded progressive-remux route for this source.

  5. Add an end-to-end transport test covering the HLS init segment and media segments.

A seekable completed-remux cache capable of returning Content-Length and proper range responses would also work, but merely adding headers to a still-growing FFmpeg pipe would not.

Separate recovery issue

The decoder-error replan defect discovered during this investigation is now tracked independently in #652. It explains the misleading hdr_transcode_unsupported terminal after the transport failure but is not part of this issue's HTTP/HLS delivery scope.

Related

AI involvement in this report

AI-assisted; the reproduction and Safari A/B transport tests were human verified.

AI tool + model

OpenAI Codex / GPT-5

Confirmations

  • Reproduced on a real deployment
  • Reproduced with an isolated local HTTP transport test
  • Verified the same media plays with byte ranges
  • Verified segmented fMP4 HLS plays
  • Deployment-specific names and paths have been removed

Activity

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

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions