Skip to content

H264/MP4 Mux/Demux Fixes#218

Open
kyle-fitzp wants to merge 5 commits into
opensensorhub:masterfrom
Botts-Innovative-Research:mp4-mux-fixes
Open

H264/MP4 Mux/Demux Fixes#218
kyle-fitzp wants to merge 5 commits into
opensensorhub:masterfrom
Botts-Innovative-Research:mp4-mux-fixes

Conversation

@kyle-fitzp

Copy link
Copy Markdown
Contributor
  1. Comment-out a line of debug code that prevents the SOS MP4 Serializer from working.
  2. Simplify the FFmpeg H264 & H265/HEVC logic for the Inject Extradata config setting.

FFmpeg driver now no longer manually converts and inserts extradata on each key frame. Instead, it relies on FFmpeg's bitstream filters.

  1. Code in StreamContext is more readable, as it's no longer mixing in bitwise logic with stream management.
  2. This fixes MP4 files that already had AVCC extradata inserted on each keyframe. The previous implementation would not replace AVCC extradata that was already in the stream, instead simply converting AVCC extradata to Annex B and naively prepending each keyframe with the converted extradata. This could lead to cases where some streams would have both AVCC and Annex B extradata on each keyframe, making the stream unparseable. The new implementation with the FFmpeg bitstream filter will correctly convert all extradata, even that which is already inserted before each keyframe.

@kyle-fitzp kyle-fitzp linked an issue Jun 18, 2026 that may be closed by this pull request
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.

Fix FFmpeg Driver H264/H265

1 participant