hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

Use SourceBuffer timestampOffset rather than modify mp4 decode timestamps

Open robwalch opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

HLS.js modifies MP4 (and remuxed TS) timestamps so that their PTS matches the desired playback timeline. This approach can be costly and result in issues (see history behind #5710).

Describe the solution you'd like

Instead, use MSE's SourceBuffer.timestampOffset to offset media.

Additional context

Special care should be taken to frame accuracy and video start gaps. Offsets related to audio priming delays or the MSE's handling of composition time are acceptable when unavoidable.

robwalch avatar Aug 02 '23 00:08 robwalch