Repository navigation
Always send PictureID 0 in VP8Payloader - #376
Merged
Merged
Conversation
With EnablePictureID, the frame whose PictureID is 0 was sent without the X and I bits, so it carried no PictureID at all. The ID wraps every 32768 frames (9 min 6 s at 60 fps), so a long stream had one frame without a PictureID among frames that had one. Chrome then lost the frame references and dropped every frame until the next keyframe: a freeze every 546 s, with no lost packets, NACKs or PLIs. Frame 0 now carries a 7-bit PictureID like every other ID under 128.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #376 +/- ##
==========================================
+ Coverage 87.45% 87.48% +0.02%
==========================================
Files 28 28
Lines 3173 3172 -1
==========================================
Hits 2775 2775
+ Misses 398 397 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
With
EnablePictureID,VP8Payloadersends the frame whose PictureID is 0 without the X and I bits, so that frame carries no PictureID (case p.pictureID == 0:keeps the bare 1-byte descriptor). The ID wraps to 0 every 32768 frames, so any stream longer than that has one frame without a PictureID among thousands that have one.Chrome then loses the frame references and drops every frame until the next keyframe. At 60 fps this is a freeze every 546 s (9 min 6 s), with no lost packets, no NACKs and no PLIs. Its length depends on how far the next keyframe is: with a keyframe every 180 frames, 32768 = 182 × 180 + 8, so each freeze was 8 frames (~133 ms) shorter than the one before.
We found it in a game-streaming app built on Pion (
TrackLocalStaticSample+ VP8). The browser'sinbound-rtpstats showedframesReceiveddropping to 17-24 per second for under a second at exactly every 546 s, while the sender kept 60 fps. The predicted times matched to the second (three in a row), and the freezes were gone after sending a PictureID on every frame (two hours, 443,928 frames, 13 wraps, no freezes).This change sends frame 0 with a 7-bit PictureID, like every other ID under 128. The new
WithPictureID_wraptest fails without it (frame 0 comes out as{0x10, 0x91, 0x91}).