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

Wait until we've seen all streams to start decoding. #3616

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

toots
Copy link
Member

@toots toots commented Jan 8, 2024

We are seeing situation, for instance when decoding a live rtmp stream, where there is a significant section of audio data that comes before the first video frame, leading to initial de-synchronizations.

This PR adds an interleaving decoding buffer which keeps at most +/- 5s of data from decoded streams until all streams have been seen and then pushes all buffered data that is +- 30ms away from the position of the last seen streams. These values can be changed via configuration options.

This mechanism should make sure that our initial decoding is always synced on all streams. There is a slight potential for dropping an initial A frame when using encoded data packets but +/-5 seconds should ensure that this only happens in extreme cases.

@toots toots force-pushed the wait-for-all-streams branch from 5a4b555 to 11bf46f Compare January 8, 2024 16:45
@toots toots marked this pull request as ready for review January 8, 2024 16:56
@toots toots added this pull request to the merge queue Jan 8, 2024
@toots toots removed this pull request from the merge queue due to a manual request Jan 8, 2024
@toots toots merged commit 2aec387 into main Jan 8, 2024
24 of 26 checks passed
@toots toots deleted the wait-for-all-streams branch January 8, 2024 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant