iOS 26 HLS MPEG-TS playback can exhibit 2–3 s A/V offset after seeking: isolate timestamp vs seek vs OS regression

GitHub source

Inferred. This page is generated from GitHub Issue #37; GitHub remains the canonical authoring and discussion source.

Source#

  • Apple Developer Forums, September 2025: https://developer.apple.com/forums/thread/802032
  • Report: MPEG-TS files are fragmented into an application-generated HLS playlist. After seeking and resuming, audio and video are reportedly out of sync by ~2–3 seconds on iOS/iPadOS/macOS 26; not observed in the reporter's prior environment. Pausing before seeking did not help. No Apple response or verified root cause is posted.

Problem#

A 2–3 second post-seek A/V offset can be caused by (a) an HLS media-timeline or timestamp defect exposed at a random-access boundary, (b) an application seek lifecycle problem, or (c) an OS-specific AVFoundation regression. The public report does not distinguish them.

Environment#

  • Native AVPlayer; app-generated HLS from MPEG-TS source files.
  • iOS 26, iPadOS 26, macOS 26 (reporter observations).
  • Exact media, OS build, PTS/PCR samples, playlist, selected rendition, and seek traces: not provided.
  • No evidence that FairPlay is involved; investigate DRM only if the reproduction is protected.

Evidence level#

  • Apple Confirmed — contract: Apple's HLS Authoring Specification §7.1–7.4 requires continuity across segments, sequential transport-stream continuity counters/timestamps, and video segments beginning with an IDR. §8.13–8.15 requires marking encoding discontinuities and aligning discontinuity boundaries across renditions.
  • Standards — contract: RFC 8216 §3 requires timestamp/continuity-counter continuation unless a discontinuity is explicitly signaled; §4.3.2.3 requires EXT-X-DISCONTINUITY for timestamp-sequence changes.
  • Apple Confirmed — API: AVPlayer.seek(to:toleranceBefore:toleranceAfter:completionHandler:) may land within the requested tolerance, and an interrupted seek reports finished=false. A completed seek does not by itself prove A/V output synchronization.
  • Reported: 2–3 s desynchronization following seek on OS 26.
  • Inferred: Possible transport timestamp, segmentation, keyframe, or seek scheduling fault. None is established as the cause.

Cause / explanation: first divergence to investigate#

Source MPEG-TS timestamps (PCR/PTS/DTS)
   → segmentation/remux boundaries and keyframes
   → EXTINF / discontinuity signaling
   → AVPlayer selected rendition and seek request
   → actual seek completion and landed time
   → first available decoded audio/video samples
   → audio clock / video presentation
   → observed 2–3 second offset

Do not treat seek accuracy and A/V synchronization as the same measurement. A seek may land near a keyframe yet remain correctly synchronized. Conversely, correct currentTime() and finished=true do not prove the audio/video outputs are aligned.

Competing hypotheses#

Hypothesis Decisive evidence Expected falsification
H1: TS PTS/PCR discontinuity or incorrect segment cut ffprobe packet PTS/DTS, transport continuity counters, Apple mediastreamvalidator, playlist around failing seek Same bytes validate, have continuous timestamps, and reproduce only on OS 26
H2: Non-IDR / open GOP at segment boundary Inspect first video access unit, IDR/keyframe flags, reference dependencies Clean independently decodable segments still fail
H3: Application issues overlapping seeks/resumes Log monotonic seek IDs, completion finished, requested vs landed time, rate transitions One serialized seek with completion-before-play still fails
H4: Audio and video renditions misaligned Capture selected audio/video playlists and discontinuity sequence numbers; inspect corresponding PTS Single muxed A/V TS exhibits identical failure
H5: OS 26 regression Byte-identical media and identical app binary across OS 18 and 26; synchronized output capture and sysdiagnose Behavior follows media authoring changes rather than OS
H6: FairPlay key-state delay Only if encrypted: key callback/CKC timeline, first usable protected samples Same defect reproduces on clear HLS

Client-side engineering guideline#

  1. Capture the exact failing seek: item identity, requested time, tolerances, finished, currentTime at completion, rate, timeControlStatus, reasonForWaitingToPlay, loadedTimeRanges, selected audio language, and AVPlayerItem.errorLog().
  2. Serialize seek requests and resume only after a successful completion; test zero tolerance versus default tolerance as an experiment, not a guaranteed fix. Zero tolerance can increase decode latency.
  3. Pin the media bytes and compare identical media on OS 18 vs 26. Avoid changing packager, playlist, and player configuration simultaneously.
  4. Audit media around the target with ffprobe and Apple's mediastreamvalidator/hlsreport. Inspect PTS/DTS and PCR as appropriate; distinguish presentation timestamps from decode timestamps.
  5. Measure actual synchronization with an authorized A/V clap/flash or timecode reference recorded from device output. A packet-level PTS offset is only a triage proxy, not a direct measurement of presented A/V skew.
  6. If a regression remains with verified compliant media, file Feedback with sysdiagnose and the smallest reproducible playlist/media package.

Suggested instrumentation#

let seekID = UUID().uuidString
let target = CMTime(seconds: 120, preferredTimescale: 600)
let started = ProcessInfo.processInfo.systemUptime
player.seek(to: target, toleranceBefore: .zero, toleranceAfter: .zero) { finished in
    let elapsed = ProcessInfo.processInfo.systemUptime - started
    let landed = player.currentTime().seconds
    print("seek_id=\(seekID) finished=\(finished) elapsed=\(elapsed) landed=\(landed)")
    // Test: resume only after the successful completion, on the correct actor/queue.
}

The example is diagnostic pseudocode for a controlled experiment; adapt actor isolation and player ownership to the application's Swift concurrency model.

Packet-level probe#

ffprobe -v error -show_packets -show_streams \
  -show_entries packet=stream_index,pts_time,dts_time,flags:stream=index,codec_type \
  -of json segment.ts > segment.json

Correlate stream indices to audio/video and inspect samples around the seek boundary. Account for B-frame reordering, codec priming, natural track offsets, PTS wraparound, and discontinuities. The first packet after a target is not necessarily the first decoded or rendered frame.

Controlled synthetic experiment — 2026-10-29#

A small Python model compared the first audio/video packet PTS at or after a synthetic target. 6 fixtures / 12 assertions passed:

  • Baseline +40 ms proxy gap.
  • Video late +2.4 s.
  • Audio late −2.2 s.
  • Both tracks shifted +1 s together: +40 ms relative gap.
  • Missing audio: explicitly indeterminate.
  • Pre-seek packets ignored: +40 ms.

The experiment tests classification logic only. It does not reproduce AVPlayer, validate actual TS media, or establish the root cause. Reproducible script and results are available in the associated investigation package.

Root-cause status#

UNRESOLVED. The report is credible as a symptom but does not prove an iOS 26 defect or a TS packaging violation. The next decisive experiment is a byte-identical TS/HLS A/B on OS 18 and OS 26 with captured segment timestamps, seek completions, and actual A/V output alignment.

References#

Scope: Client instrumentation and reproducibility are directly actionable. Repackaging/segment authoring changes are proposals for the media pipeline owner, not client-side fixes.