videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
37.57k stars 7.4k forks source link

Video/audio gets out of sync and chrome browser tab gets unresponsive after certain minutes of play #5607

Closed marcusfrenkel closed 2 months ago

marcusfrenkel commented 5 years ago

Description

1st issue: When stream plays more than 15 minutes, video and audio start to get out-of-sync noticeably, the drift is increasing continuously.

2nd issue: After 60 minutes of play, the player and every object inside the tab is frozen and unresponsive. The only solution is to close the tab.

Our test is based on live stream within a local network. Since I'm unable to provide it outside, I listed below publicly available streams that make videojs produce the same issues.

Test cases based on videojs: https://codepen.io/anon/pen/vQpyyw?editors=1000 https://codepen.io/anon/pen/zMpoGp?editors=1000

Test cases based on hls.js in which case both issues specified above do not occur: https://codepen.io/anon/pen/jQYVKL?editors=1000 https://codepen.io/anon/pen/BGJLGX?editors=1000

Steps to reproduce

  1. Open https://codepen.io/anon/pen/vQpyyw?editors=1000
  2. Wait 15min to notice that the video/audio starts to drift.
  3. Wait 60min to notice that the entire browser tab becomes unresponsive.

Results

Expected

  1. No out-of-sync issue.
  2. No frozen browser tab.

Actual

  1. Out-of-sync after ~15min of play.
  2. Tab freezes after 60min of play.

Error output

No.

Additional Information

versions

videojs

7.3.0

browsers

Chrome - version 70.0.3538.110 (Official Build) (64-bit) Possibly others

OSes

Windows 10 Possibly others

plugins

No

marcusfrenkel commented 5 years ago

Both issues are also present on latest Firefox (63.0.3 64-bit).

Kind request to the devs to look into this. Thank you.

marcusfrenkel commented 5 years ago

Update:

The issue with the browser tab getting frozen and unresponsive happens only if the tab is not active/selected in the browser while the video is playing, meaning another tab is into view.

The other issue with audio/video out of sync happens even in a case when the tab is constantly active/selected while the video is playing.

mattfrankly commented 5 years ago

We're experiencing the same sync problem, but we lose sync after about 5min. Other players as well as playing the m3u8 directly in Safari/VLC don't have this issue.

Example on vanilla VJS7 : http://ftpcontent.worldnow.com/test/vjs7.html

Schedule for when this stream is live:

Mon thru Fri (Times in EST) 5:30am to 6:30am 6:30AM to 7:30am 7:30am to 8am 10am to 11am 12pm to 1pm 5pm to 6pm 6pm to 6:30pm 7pm to 7:30pm 11pm to 11:30pm

Any thoughts/progress here?

marcusfrenkel commented 5 years ago

Both issues are still present in videojs version 7.5.0.

benjdavenport commented 5 years ago

Bump on this, can confirm it's still an issue. Reloading the player context via refresh or seeking to a position (for VODs) realign audio and video.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mattfrankly commented 5 years ago

bump.. still a problem.

gkatsev commented 5 years ago

Oops, yes, I may consolidate the couple of AV sync issues we have into one, but in #6000 I mentioned that we were busy doing some major refactoring to our playback engine to improve it before we can go back and tackle AV sync but it's a big thing we want to focus on next after those changes, which are done but just need to be tested more thoroughly.

partap commented 4 years ago

Bump... I've also been seeing the AV sync issue.
In the meantime, I'm using videojs-hlsjs-plugin to get around the problem.

From what I remember, hlsjs contains code to fix this specific issue. I think it monitors the audio and video timestamps and if they differ by a certain threshold, the player either skips forward in the audio stream or emits several ms of silence to re-sync the audio

partap commented 4 years ago

Aha, I found it in the hlsjs docs... the config option is maxAudioFramesDrift: https://github.com/video-dev/hls.js/blob/master/docs/API.md#maxaudioframesdrift

chaosgrid commented 4 years ago

We also have the audio-video sync issue I'm afraid. We are getting the sync issues for a "normal" lecture video which is very large and long (3 hours). I did not test the behaviour for shorter videos.

Any ETA for a fix?

gkatsev commented 4 years ago

We have some sync related fixes available in https://github.com/videojs/http-streaming master branch. Can you try it out and see if you are still sync issues? We're in the final stages of testing what's in master, it's a long term refactor of VHS and improves a lot of things. More eyes on it would be great.

osemolanoec commented 3 years ago

Bump, we're having this issue with the latest releases of videojs up to 7.11.2.

adgwytc commented 1 year ago

Bumo, I am also seeing this issue. Can you pleaase provide an update or is this still a known bug with videojs?

aurelstocheci commented 2 months ago

Bump. Using Video.js 8.3.0 and the desync issue is still there.

mister-ben commented 2 months ago

Closing this old issue. A new detailed issue on the http-streaming repo with a reproducible case (test stream) would be better.