Fix inserted SEI NAL order in AVC outputs#13645
Open
dsaedtler wants to merge 3 commits into
Open
Conversation
b9a2c81 to
bdfb4b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes the position where SEI NALs are inserted into AVC bitstreams.
Motivation and Context
H.264 specification section 7.4.1.2.3 "Order of NAL units and coded pictures and association to access units" clarifies that SEI NALs shall come before any VCL NALs:
Apparently the current method (just appending the SEIs) can cause issues with Android playback in some cases.
This is analogous to #12658 which addressed a similar issue for HEVC. AVC does not have a "suffix" SEI type, so we actually need to insert them at the correct position.
How Has This Been Tested?
Recorded some videos locally (Hybrid MP4 supports the
bpm=1option to manually enable BPM insertion for testing) and verified with a bitstream analyzer (StreamEye) that SEIs are now inserted at the correct position in the output bitstream.My coworker who was working on diagnosing the issue on her Android phone has also confirmed that with this PR applied the issue is fixed.
Types of changes
Checklist: