jhiesey / videostream

Play html5 video when from a file-like object
MIT License
243 stars 74 forks source link

Intermittent, unrecoverable freezes in Firefox when seeking #59

Open jackhadrill opened 3 years ago

jackhadrill commented 3 years ago

I am getting intermittent, unrecoverable freezes whilst seeking an H.264 encoded MP4 in Firefox 84 on MacOS Big Sur. The video hangs as if it is waiting for data, even if the video has finished downloading completely. I am using WebTorrent to download the popular CC-licensed "Sintel" video. The same behaviour can be seen on WebTorrent's own website.

I have not tested any other OS or version of Firefox; however, I can confidently state that this same issue is not present in Chrome.

This behaviour occurs even when the video has finished downloading completely, leading me to believe it's an issue with how the video is buffered into the HTML5 video element. Safari has had issues with seeking for quite some time. I wonder if this is related?

Is there any way we can make sure the data is buffered prior to the seek event being fully triggered?

I've attached a video which illustrates the problem I am facing.

https://user-images.githubusercontent.com/1496537/103916413-4daf8680-5104-11eb-97ca-3196858b4adc.mov

jackhadrill commented 3 years ago

I think I'm along the right lines with my theory. Increasing the media.cache_readahead_limit setting in Firefox from 60 to max(int32) seems to offer a temporary fix.

Hope this helps anyone looking at this issue move closer to a proper fix...

snowinszu commented 3 years ago

I think I'm along the right lines with my theory. Increasing the media.cache_readahead_limit setting in Firefox from 60 to max(int32) seems to offer a temporary fix.

Hope this helps anyone looking at this issue move closer to a proper fix...

Hi , I face the same issue, did you work it out?