Repository navigation
H265Packet: pack multi-slice HEVC access units as one unit (YouTube enhanced-RTMP) - #2223
Closed
yeheskel2016 wants to merge 1 commit into
Closed
yeheskel2016 wants to merge 1 commit into
yeheskel2016 wants to merge 1 commit into
Conversation
…nced-RTMP YouTube's HEVC ingest only consumes the first length-prefixed NAL per video tag. Encoders that emit one slice segment per tile (Qualcomm SD888) therefore produce a permanently 'preparing' stream with 2.8.0+ per-NAL packaging. Join slices with Annex-B start codes inside a single unit (2.7.2 behaviour, verified decodable by YouTube). Single-NAL frames are byte-identical.
Author
|
*This PR was generated using AI, Claude Fable 5.1 model Thanks for the amazing libary! |
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.
Fixes #2222
Problem
Since 2.8.0 (
NalReader.extractNals, #2086)H265Packetwrites one length-prefixed NAL per slice inside a single enhanced-RTMP video tag. On encoders that emit multiple slice segments per picture (e.g. Qualcomm SD888c2.qti.hevc.encoder: 3 slices/AU at 1080p), YouTube's enhanced-RTMP HEVC ingest only consumes the first NAL of the tag and the broadcast stays on "preparing" forever, while the publisher reports a healthy connection. 2.7.2 shipped the whole access unit as one unit and worked.Change
rtmp/.../flv/video/packet/H265Packet.ktonly: whennals.size > 1, pack the access unit as one length-prefixed unit with00 00 00 01between slices (the 2.7.2 layout). Single-NAL frames keep the existing per-NAL packaging, so #2086 is unaffected for them.Verification
Same app, 1080p60 HEVC Main, 2 s GOP, against YouTube and a local SRS 6 relay (FLV parsed per tag):
[(19,43267),(19,41780),(19,43012)]→ YouTube "preparing"[(19,128075, 2 inner start codes)]→ renders[(20,30940)]→ OKBoth ~60 fps, IDR every 2 s, decode clean in ffmpeg/VLC.
Happy to put this behind a flag if you'd prefer strict per-NAL packaging as the default.