Skip to content

fix: support signed composition offsets - #141

Merged
varsill merged 3 commits into
membraneframework:masterfrom
maslowalex:fix/h265-b-frame-timestamps
Sep 24, 2026
Merged

varsill merged 3 commits into
membraneframework:masterfrom
maslowalex:fix/h265-b-frame-timestamps

Conversation

@maslowalex

Copy link
Copy Markdown
Contributor

Currently, if the B-frames are present in the stream the muxer just crashing. That's because the B-frames could come "late" in point of view of the muxer (ctts version 0 is using uint and can't express negative values). Added support for ctts version 1.

- write ctts version 1 when ISOM offsets are negative
- write trun version 1 for negative CMAF offsets
- cover signed H265 muxing, parsing, and transmuxing
truns =
for _segment <- 1..2 do
assert_sink_buffer(pipeline, :sink, buffer)
assert_composition_offset_version(buffer.payload)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, do I get it right that we expect first segment to use version 1 box and the second segment to use version 0?
If so, I would prefer to explicitly assert on the desired box version that have assert_composition_offset_version determine the version itself, using the same logic that is used in the lib

maslowalex and others added 2 commits September 11, 2026 12:04
Elixir 1.19+ warns when a size(...) in a match references an outer
variable without ^, and CI runs with --warnings-as-errors.
@varsill
varsill force-pushed the fix/h265-b-frame-timestamps branch from 8c9e4a1 to f03f856 Compare September 24, 2026 13:05
@varsill
varsill merged commit 51f222e into membraneframework:master Sep 24, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in Smackore Sep 24, 2026
@varsill

varsill commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Thank you very much for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants