-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
av desync on server restart #6823
Comments
Sounds like a stream issue. We cannot verify with the information provided. Adding program date time to your live stream would be one way to ensure sync. If the media timestamps are contiguous this should not happen. If your playlist has DISCONTINUITY tags and this happens you are likely missing a properly set DISCONTINUITY-SEQUENCE. |
Hello, thank you for your response. When the HLS server is turned off, the audio playlist sometimes retains one segment more than the video playlist. Then the segments are aligned with timestamps and program datetime upon restart time, the player, however, ignores this and results in a desynchronization. This issue wasn't present before commit 2b1e1aa. Also, when the server restarts, there's a noticeable skip of several segments which leads to timestamp jumps in fmp4. It seems we've deviated from the standard here as we didn't update the discontinuity sequence. Upon revisiting the behavior with an increment in discontinuity sequence, it's observed that the player spins for some time and then gets stuck. See chrome logs chrome_logs.txt, hls.js was built from 7db2f52 Also please have a look at playlists audio_playlists.txt, video_playlists.txt. Identical X-DISCONTINUITY-SEQUENCE values before and after the server restart should not be an issue, since an additional X-DISCONTINUITY tag is inserted at the beginning. |
It doesn't look like that happened in the sample playlist txt.
When matched up to the previous playlists, those discontinuities and segments are aligned as they each start where their last respective playlist ended. The accumulated duration of both audio and video playlists should be maintained by inserting segments with GAP tags prior to the discontinuity to make up for the additional audio that was packaged previously (if there is indeed an additional segment in one which I don't see - both initial versions are ~14 seconds long). |
Let me know if #6857 resolves or improves the issue for you. |
Thanks for #6857, after checking everything looks great. It fixes desync due to extra audio segment. It also fixes player freezing when discontinuity counter increments. |
What version of Hls.js are you using?
latest c723ce3
What browser (including version) are you using?
Chrome 130.0.6723.92
What OS (including version) are you using?
Windows 11
Test stream
No response
Configuration
Additional player setup steps
No response
Checklist
Steps to reproduce
alternatively you can run the player (npm run dev) and paste the link http://localhost:8000/demo_master.m3u8
Expected behaviour
Audio and Video tracks are in sync during all playtime.
What actually happened?
Audio and Video tracks lose synchronization in a middle (audio is shifted forward to 2s)
If you restart the web page after playback has finished, synchronization will be restored.
Before the next commit the player works fine 2b1e1aa
Chrome logs: logs.txt
Console output
it's attached in the "What actually happened?" section
Chrome media internals output
No response
The text was updated successfully, but these errors were encountered: