Skip to content
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 #2635

Closed

Conversation

NodeBoy2
Copy link

@NodeBoy2 NodeBoy2 commented Sep 26, 2021

Description'

Please ensure that the markdown structure is maintained.

  1. SRS Version: 4.0release branch
  2. The log for SRS is as follows:'

Please ensure that the markdown structure is maintained.

shrinking, size=2, removed=2, max=30000ms
dispatch cached gop success. count=49, duration=-1
create consumer, active=1, queue_size=0.00, jitter=30000000
  1. The configuration for SRS is as follows:

Please ensure that the markdown structure is maintained.

vhost __defaultVhost__ {
    time_jitter     off;
}

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?

  1. Configure time_jitter to off.
  2. Start streaming.
  3. After 30 seconds, use 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

  1. When there is a consumer, SRS will send: metadata -> audio sequence header -> video sequence header -> GOP cache -> ...
  2. When putting packets into the consumer distribution queue SrsMessageQueue, if the cached frame duration in SrsMessageQueue exceeds 30 seconds, the first frame (usually a video keyframe) will be discarded.
  3. Set time_jitter to off. The timestamp of the sequence header (the first packet in the queue) is usually 0, and the timestamp of the subsequent GOP cache may already be greater than 30 seconds, resulting in frame loss.

Please ensure that the markdown structure is maintained.

Fix

When calculating the accumulated duration of data in SrsMessageQueue, exclude the calculation of the sequence header.

Please ensure that the markdown structure is maintained.


TRANS_BY_GPT3

@NodeBoy2
Copy link
Author

NodeBoy2 commented Sep 26, 2021

PR corresponding to 3.0 release: #2186

TRANS_BY_GPT3

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2021

Codecov Report

Merging #2635 (63549f2) into 4.0release (81fa762) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           4.0release    #2635   +/-   ##
===========================================
  Coverage       59.53%   59.53%           
===========================================
  Files             122      122           
  Lines           51715    51715           
===========================================
  Hits            30788    30788           
  Misses          20927    20927           

| Impacted Files | Coverage Δ | |'

Translated to English while maintaining the markdown structure:

'| Impacted Files | Coverage Δ | |
|---|---|---|
| trunk/src/app/srs_app_source.cpp | 0.66% <0.00%> (ø) | |

'

Translated to English while maintaining the markdown structure:

'| trunk/src/app/srs_app_source.cpp | 0.66% <0.00%> (ø) | |


Continue to review full report at Codecov.

Legend - Click here to learn more
| Δ = absolute <relative> (impact), ø = not affected, ? = missing data'

Translated to English while maintaining the markdown structure:

'| Δ = absolute <relative> (impact), ø = not affected, ? = missing data

Powered by Codecov. Last update 81fa762...63549f2. Read the comment docs.

TRANS_BY_GPT3

@winlinvip winlinvip self-assigned this Oct 19, 2021
@winlinvip
Copy link
Member

Fixed by ed1c499

@winlinvip winlinvip closed this Oct 27, 2021
@winlinvip
Copy link
Member

Dup to #2186

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants