Dolby Vision stutters and loses A/V sync at non-1.0× playback speed on macOS

Product: Infuse 8.5.8 (build 8.5.5786), macOS
Hardware/OS: MacBook Pro (Apple M1 Max), macOS 27.0.1 (build 26A434), built-in Liquid Retina XDR display
Source: Jellyfin direct play over LAN, and also local files (see below)
Reproducibility: 100%, on every Dolby Vision title I’ve tried

Summary

When a Dolby Vision file plays faster than 1.0× (I use 1.5×–1.9×), the picture hitches and falls out of sync with the audio, then snaps back, roughly every 5 seconds for the whole file. At exactly 1.0× the same file is perfect. Non‑DV files (HDR10, SDR) are perfect at the same speeds. The same DV title plays fine at 1.65–1.75× on iPhone (checked in the device log, below), so this is macOS‑specific.

Pausing is also unreliable on these files: a pause often doesn’t take, or playback resumes on its own a fraction of a second later, until I press pause two or three times.

Root cause

I captured Infuse’s unified log (log show --predicate 'process == "Infuse"') during a 39‑minute session at 1.55×, then reproduced the behaviour outside Infuse with a small AVFoundation test program.

  1. For Dolby Vision, Infuse hands AVFoundation a queue of short, video‑only fragments (6.3–10.0 s each, median 7.3 s), one AVPlayerItem after another. Audio isn’t in the fragments; Infuse renders it separately (512 video render pipelines, 0 audio render pipelines in the session).

  2. At each fragment boundary, CoreMedia decides whether to transition seamlessly (“gapless”) or tear the pipeline down and rebuild it, and it refuses gapless whenever the rate isn’t exactly 1.0. In that session the log shows, 1,434 times:

    <<<< FigFilePlayer >>>> playerfig_doingGapless: NO, because rate (1.5) is not 1.0
    
  3. So every boundary (487 in the session) invalidates the decode session and prepares the next fragment from scratch (513 dvh1 VTDecompressionSessions created). The restart took 46 ms on average and up to 721 ms. The video stalls while Infuse’s separate audio keeps going, then gets pulled back into sync: the hitch‑then‑resync.

Reproduction outside Infuse

The same video‑only DV fragments in a plain AVQueuePlayer:

Rate Boundary behaviour
1.0× doingGapless: YES, shouldBeginGaplessTransition: YES, seamless
1.55× doingGapless: NO, because rate (1.5) is not 1.0, video pipeline restarted at every boundary

Only the rate differs. Same fragments, same machine.

Not a server or streaming issue

The same happens with no server involved. A 60‑second DV Profile 8.1 MKV clip on the Mac’s own disk, opened with open -a Infuse <file>, played at 1.5× for 30 seconds:

  • Video‑only queued items of 8.30–9.63 s, served through Infuse’s custom URL handler
  • playerfig_doingGapless: NO, because rate (1.5) is not 1.0 10 times
  • 3 boundaries, each restarting the video pipeline (avg 43 ms); 5 dvh1 decoder sessions in 30 seconds

Opening the clip from a plain HTTP URL (no media server) via infuse://x-callback-url/play gives the same fragment queue.

Infuse on iOS already avoids this

The same title on an iPhone 18 Pro Max (same Jellyfin server) at 1.65× and 1.75× for about 5 minutes, from the device log (log collect --device):

  • Frames go to AVSampleBufferVideoRenderer, not an AVQueuePlayer. Zero FigFilePlayer, itemfig_advanceToNextItem or playerfig_doingGapless lines.
  • One dvh1 decoder session (plus its hvc1 sub‑session) for the whole playback, never invalidated.
  • Last frame stats: 252 enqueued, 252 displayed, 0 dropped, 0 more than 16 ms late.
  • Pauses held. Every pause→play change followed a touch or a scrub.

The iOS approach works on macOS too

I fed the same video‑only DV fragments Infuse builds on the Mac, back to back, into one AVSampleBufferDisplayLayer (sampleBufferRenderer) driven by an AVSampleBufferRenderSynchronizer at rate 1.55, on macOS 27.0.1. Samples were read compressed (AVAssetReaderTrackOutput, outputSettings: nil) and re‑timed onto one continuous timeline.

Run Decoder sessions created / invalidated Effective rate Pause (setRate(0))
Fragments re‑timed only 8 / 7 (one per fragment) 1.550 held
Re‑timed and rebuilt on one CMFormatDescription 1 / 0 1.550 held

No FigFilePlayer, no item boundaries, no rate gate, no renderer errors. The one detail that matters: each fragment carries its own format description object, and the renderer rebuilds the decoder when that changes. Building every CMSampleBuffer on one format description for the whole title gives one decoder for the whole playback.

Suggested fixes, in order

  1. Use the iOS rendering path on macOS. Feed DV frames to AVSampleBufferDisplayLayer / AVSampleBufferVideoRenderer with an AVSampleBufferRenderSynchronizer, as Infuse for iOS does, instead of a queue of AVPlayerItem fragments. Speed then becomes setRate on the synchronizer, so every speed works.
  2. Or present DV as one continuous item. In my tests, a single AVPlayerItem of the same DV content (one MP4, and separately an HLS stream) at 1.55× had zero boundaries and no stutter.

The pause issue

During these files, Infuse changes the player rate with change reason: Unknown around fragment boundaries. In a separate test, -[AVPlayer setRate:time:atHostTime:] is the call that logs as Unknown, while play(), pause() and rate = log as ClientInitiated. In my session this undid a user pause 14 times out of 16, on average 209 ms after the pause. Removing the boundaries (either fix above) should remove most of these resyncs, but the resync should also never apply a nonzero rate while the user has paused.

How to reproduce

  1. Any 4K Dolby Vision Profile 8.1 file on an Apple‑silicon Mac, from a server or a local file.
  2. Play at 1.5× (anything other than 1.0×).
  3. About every 5 seconds the picture hitches and drifts out of sync with the audio, then resyncs. At 1.0× it’s clean.
  4. With Settings → Playback → Dolby Vision off, the same file at speed is clean. (A copy of the clip with the DV layer removed plays through Infuse’s own engine, with no AVFoundation fragment queue at all.)

Files I can share

Happy to send any of these (the forum won’t take attachments):

  • Log excerpts: one fragment boundary at 1.55×, session totals, and a pause being undone
  • harness.swift: plain AVQueuePlayer reproduction (fragments at 1.0× vs 1.55×, single‑item and HLS controls, pause‑at‑boundary test)
  • reason.swift: shows which AVPlayer calls log as ClientInitiated and which as Unknown
  • sbtest.swift: the sample‑buffer renderer test above
  • Full unified‑log captures from the Mac and the iPhone