zlplayer
zlplayer copied to clipboard
Audio gets delayed after some time
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 :)
@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.
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! :)
I've added logs here for testing purpose and built it locally.