Open boczeratul opened 7 years ago
something like this https://github.com/Bilibili/flv.js/compare/master...boczeratul:av-sync
but the change breaks the video. there's probably something I'm missing and creates some inconsistency on time stamps. It's just to demonstrate the idea.
does it make sense? would like to hear your opinion on this 😄 thanks!
Audio frame sample duration should always be consistently equals to an value which is related to sampling rate.
refSampleDuration = 1024 / meta.audioSampleRate * meta.timescale;
If not, the browser will force adjust the presentation timestamp to make audio playback seamlessly, which may cause A/V unsync.
That is to say, the stream publisher should always follow the rule. The player can only do very little and limited workarounds with malformed streams.
I've noticed serious A/V sync problem on unstable live streams silent frames are added to the samples with long duration but not removed from those with short duration. as a result, A/V gets out of sync very quickly is it possible to refactor the silent frame logic so it's added when there's accumulated timestamp difference? instead of comparing single sample?
FYI stash buffer is turned on no error is reported in
chrome://media-internals
thanks in advance.