-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate the correct payload_size which pure padding data, in the process of rtc2rtmp, make Chrome happy #2461
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2461 +/- ##
===========================================
- Coverage 42.67% 42.67% -0.01%
===========================================
Files 102 102
Lines 36028 36034 +6
===========================================
+ Hits 15376 15377 +1
- Misses 20652 20657 +5 | Impacted Files | Coverage Δ | |' Translated to English while maintaining the markdown structure: '| Impacted Files | Coverage Δ | | Continue to review full report at Codecov.
'>
|
…ocess of rtc2rtmp, make Chrome happy
325563b
to
3486c90
Compare
trunk/src/app/srs_app_rtc_source.cpp
Outdated
nb_payload += 4 + raw_payload->nn_payload; | ||
continue; | ||
} | ||
} | ||
|
||
if (5 == nb_payload) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it 5? The magic number needs to have a comment.
TRANS_BY_GPT3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aad19c1
I made some adjustments, and now this 5 can be more clear.
TRANS_BY_GPT3
make clear for magic number
review, completed
|
Calculate the correct payload_size which pure padding data, in the process of rtc2rtmp, make Chrome happy (#2461) * Calculate the correct payload_size which pure padding data, in the process of rtc2rtmp, make Chrome happy * make clear for magic number make clear for magic number * Update srs_app_rtc_source.cpp
Phenomenon: When using rtc2rtmp and enabling twcc (enabled by default), there is an error when streaming with getDisplayMedia and playing flv. However, when twcc is disabled, the playback is normal.
Reason:
1.1. If the actual encoding bandwidth is lower than the predicted bandwidth, padding will be sent actively.
1.2. Through packet analysis, it is found that some packets are pure padding, meaning the payload_size of the effective payload is 0.
Due to a bug in the code, the flv packets will be filled with many 0x00. As shown in the figure below.
1.3. Firefox or ffplay will display an error when encountering such empty packets, but they choose to ignore and continue playing. However, Chrome has strict validation and directly reports an error, which causes the flv file to be unplayable.
Solution:
TRANS_BY_GPT3