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

Audio gets delayed after some time #7

Open
davidslaby opened this issue Oct 18, 2022 · 3 comments
Open

Audio gets delayed after some time #7

davidslaby opened this issue Oct 18, 2022 · 3 comments

Comments

@davidslaby
Copy link

During testing phase, we've found out one essential issue. In case stream is playing for a long time, approx. 1 and half hour, you can observe audio is getting delayed 3-4 seconds. There is 1 sec. delay by default. We are using pass through buffering strategy.

@monyone Do you have any hint, from where it comes from? What should we focus on within the investigation?

Thanks in advance :)

@monyone
Copy link
Owner

monyone commented Oct 19, 2022

@davidslaby
Can you show entire arrived Time and PTS/DTS for Video/Audio PES?
If it is wrong or delayed, PassThrought is just send to player, so delayed.

if using ffmpeg, Video/Audio PES is not aligned default. (Video first comes, Audio is delayed)
so specify -max_delay 0 sync Video/Audio PES insertion algorithm.
(I recommend add more flags -fflags +nobuffer -flags +low_delay for low delay streaming)

In other case, If video is dropframe, PassThrough may be unreliable.
Audio is always non drop and video is dropped. I not recommended.

@davidslaby
Copy link
Author

Hi @monyone, we are using ffmpeg and all the settings seems to be okay. Based on next round of investigation, It looks sometimes audio frames stuck in decoder queue and audio gets delayed, basically it's not synced to video.

Is there any mechanism to prevent this? Should we change buffering strategy?

Thanks in advance! :)

@davidslaby
Copy link
Author

I've added logs here for testing purpose and built it locally.
Screenshot 2022-11-01 v 18 03 37

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

No branches or pull requests

2 participants