-
-
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
fixed frame loss when time_jitter is off #2186
Conversation
Codecov Report
@@ Coverage Diff @@
## 3.0release #2186 +/- ##
===========================================
Coverage 52.91% 52.91%
===========================================
Files 82 82
Lines 26693 26693
===========================================
Hits 14125 14125
Misses 12568 12568 | Impacted Files | Coverage Δ | |' '| Impacted Files | Coverage Δ | | Continue to review full report at Codecov.
|
3c0fc9b
to
ccd8c86
Compare
1ca9308
to
8d44b98
Compare
@NodeBoy2 Thanks a lot 👍 |
After streaming for a certain period of time, there will be this log when playing: [2021-10-28 07:22:09.511][Trace][91550][0eq5u805] shrinking, size=2, removed=2, max=30000ms
[2021-10-28 07:22:09.511][Trace][91550][0eq5u805] dispatch cached gop success. count=458, duration=-1 Capturing packets, it was found that there is a SequenceHeader. After reviewing the code, if the data that is shrunk contains a SequenceHeader, it will be retrieved again. void SrsMessageQueue::shrink()
{
.............
// update av_start_time
av_start_time = av_end_time;
//push_back secquence header and update timestamp
if (video_sh) {
video_sh->timestamp = srsu2ms(av_end_time);
msgs.push_back(video_sh);
}
if (audio_sh) {
audio_sh->timestamp = srsu2ms(av_end_time);
msgs.push_back(audio_sh);
}
if (!_ignore_shrink) {
srs_trace("shrinking, size=%d, removed=%d, max=%dms", (int)msgs.size(), msgs_size - (int)msgs.size(), srsu2msi(max_queue_size));
} The SequenceHeader will be preserved, but the keyframes will indeed be discarded. So in the image above, the first one is the SequenceHeader, and the second one is a P-frame. The simplest solution is to just check if it is 0, because if other packets are also 0 but not a sequence header, it will still cause issues. Of course, the best approach is to disable shrink during playback.
|
Fixed by ed1c499 |
Description'
Please ensure that the markdown structure is maintained.
3.0release branch
Please ensure that the markdown structure is maintained.
Please ensure that the markdown structure is maintained.
Replay
Please ensure that the markdown structure is maintained.
How to replay bug?
Please ensure that the markdown structure is maintained.
How to replay bug?
time_jitter
to off.ffplay
to play the stream. There is a noticeable audio-video desynchronization in the first 2 seconds, with the video playing slower.Please ensure that the markdown structure is maintained.
Problem
Please ensure that the markdown structure is maintained.
Fix
When calculating the accumulated duration of data in SrsMessageQueue, investigate the sequence header.
TRANS_BY_GPT3