Skip to content

feat(hls): Options.SignedCompositionOffsets, signed composition offsets with no shift and no video edit list - #38

Merged
gravity-zero merged 2 commits into
masterfrom
feat/signed-composition-offsets
Nov 21, 2026
Merged

gravity-zero merged 2 commits into
masterfrom
feat/signed-composition-offsets

Conversation

@gravity-zero

Copy link
Copy Markdown
Owner

A player that ignores the video edit list presents a B-frame video later than its audio by the composition shift (84 ms on a two-frame pyramid): the default form writes non-negative composition offsets pushed up by the reordering depth, and an edit list that takes the shift back.

Added

  • Options.SignedCompositionOffsets (--signed-offsets on to-hls, hls-segment, serve and serve-growing): composition offsets are written signed (trun version 1) around a first frame that presents when it decodes, with no composition shift and no video edit list for it - the CMAF cmf2 form. Off by default; without it the output is byte-identical to master.

Trade-off

A reader that pulls its decode clock back for a negative offset shows the picture late by the reordering depth under this option, where the default form is exact for it. One setting per presentation: init and segments both change with it.

Checks

  • Full pass and on-demand plan write the same bytes with the option, and the init carries no edit list for the video.
  • Apple timestamps reads both fixtures again under --signed-offsets: every frame AVFoundation decodes presents where the source has it.

@gravity-zero
gravity-zero merged commit c61dedd into master Nov 21, 2026
13 checks passed
@gravity-zero
gravity-zero deleted the feat/signed-composition-offsets branch November 21, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant