-
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
Stalling after a few seconds in Chrome with a Cloudflare Streams video #5797
Comments
Some additional information relating to my digging is available at #5477 (comment) |
Hi @bhayward93, |
Hi @robwalch - I've updated the issue card to include the full logs from page loads - I'd just tried to trim out the area of the error to save space. |
The logs show overlapping audio which is a bit of a concern. The buffer stall error means that currentTime stopped advancing, but the log message details show that the buffer is healthy with 105 seconds of forward buffer:
So despite this message, I would expect playback to continue unless there was a decoder error which i do not see or a buffer gap resulting in a demuxer starved issue - check the media panel in Chrome's dev tools. I am unable to reproduce on desktop mac. |
Interesting @robwalch - I just tested using a Desktop Mac (Sonoma Beta) via Browserstack (Chrome Version 116.0.5845.96 (Official Build) (x86_64 translated)) and it doesn't happen every time, but I'd say occurred on around 25% / 30% of plays, however, it does seem that it may quickly recover its self. Here is a streamable upload of this behavior in that environment with the test stream link provided in this issue card. https://streamable.com/prhii5 With the streams I'm using from Cloudflare streams, some recover but have a stall after the first segment of varying length, there are reports of other streams that do not eventually recover, though I do not have a sample to hand. The sample I used will recover after a couple of seconds when the "Stop on first stall" debug option is not checked. The stall is entirely undesirable so perhaps my expected correct behavior on the issue card is incomplete. Below is the output from Chromes Media tab after the issue occurrs back on my main Ubuntu machine: |
Hello, programmers. Let me help you with this issue. First of all let me introduce myself: I am a java developer who designed a web cctv system which utilises mpeg dash and mse to watch video from cctv cameras. For years it worked without any problems in all browsers. Some days ago I was surprised to see that video from some cameras randomly stops and video.currentTime does not change. Ok now long story short: 1. It is definitely a chrome bug!
5. If I use chrome with disabled hardware decoding THERE IS NO ISSUE! You can disable hardware acceleration with chrome://flags/ #disable-accelerated-video-decode
8. Trick video.currentTime=video.currentTime before appending a new buffer DOES work but you can get a decoder error on some streams! Why do I write it here? For some reason I can not post bugs at https://bugs.chromium.org -- it just says that It can not process my request and that is all. I want you to fill the bug at https://bugs.chromium.org . I know it may take years for google to accept a bug and fix it. Maybe you can change it and make google to fix it in reasonable terms. Here is POC to reproduce bug: <title>TODO supply a title</title> <script> if ("MediaSource" in window && MediaSource.isTypeSupported(mimeCodec)) mediaSource.addEventListener('error', function (e) { } function sourceOpen() { function loadSegment() { xhr.onreadystatechange = function () { var timestampOffset = 0; //sourceBuffer.timestampOffset = timestampOffset; sourceBuffer.appendBuffer(xhr.response); }; //sourceBuffer.appendBuffer(xhr.response); </script> TODO write content
I load self initialized dash segments (I saved them from the camera stream) from the server. See function loadSegment: You can change the url in this function corresponding to your logic. Delay 1000 ms is enough to make buffer starvation. In my test video just plays 2 seconds and then stops. If you will report a bug at https://bugs.chromium.org please make a reference to me! I can provide you dash segments which produce the issue on demand. But I prefer that you will use your own data. Thank you and good luck. |
Ok so I know how to work around this. But looks like you're not going to communicate. So you just live with it. |
Hi @bhayward93, have you managed to find a solution here? We're having issues again, even on the latest version of Hls.js (v1.4.12), and was having the issue on v1.4.8 too. The issue we're seeing is with Cloudflare Streams, where the video plays just fine within the Cloudflare Dashboard, but when the stream is used with Hls.js. It's not happening with every stream, but here is one such example using the Hls.js: You should see that in most cases, it freezes at either the 7 seconds mark, or 13 seconds. When doing so, the audio continues. These source videos uploaded to Cloudflare Stream are coming from the Instagram accounts of our users, and thus we are not in control of them. We'd love to Hls.js to be able to 'smooth over the gaps' and 'just play' when there are such issues. I'm trying to digest the debug output but feel like my knowledge of the internals are minimal. Would really appreciate your thoughts @robwalch. |
We encouter the exact same issue with CloudFlare Stream and VideoJS player. |
Hi @mrjamesriley, I'm on Chrome Version 118.0.5993.117 (Official Build) (arm64) macoS Sonoma 14.1 and am not experiencing any stalls on latest or next: Are you seeing this on Windows only or on Mac Intel architecture only, or only on Chrome 116, or only on virtual OS instances (ex: BrowserStack)? Or maybe the stall is related to switching behavior - are you seeing playback starting below 720p and then switching up or is it starting on 720p and then switching down? (I'm getting 720p from start to end.) A more complete picture of the timeline and logs would help me reproduce the issue. |
@test343 - Apologies, I missed the notification for this. On my end, the issue is resolved. It seems others are still experiencing the issue though. |
@mrjamesriley - I agree with yourself and @safouanmatmati in the source of the issue being on the Cloudflare Streams end. We presented out findings to them and they said they would fix it for us - after a short while things started working. I have no idea what they did on their end to resolve it unfortunately, but this does indicate they found an issue on their end. If it is not globally fixed I wonder if they had to retranscode our videos or perform some other expensive operations. I do also agree with @mrjamesriley that it'd be ideal if |
We patched 1.4.4 with #5500. Not much else that can be done without a report and sample that reproduces the issue. Closing this issue as I am unable to reproduce with latest version using any of the links above. If you are experiencing something similar in the latest release, please file a new Bug Report and feel free to reference this one (#5797) making sure to add new details specific to your test case including:
|
What version of Hls.js are you using?
v1.4.11-0.canary.9504
What browser (including version) are you using?
Chrome Version 116.0.5845.96 (Official Build) (64-bit)
What OS (including version) are you using?
Ubuntu 20.04 (reported across a wide range of devices)
Test stream
https://hlsjs-dev.video-dev.org/demo/?src=https%3A%2F%2Fcustomer-gh08u53vbkhozibb.cloudflarestream.com%2Fdb17d0e8887c7c97743aed2764562074%2Fmanifest%2Fvideo.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjp0cnVlLCJkdW1wZk1QNCI6ZmFsc2UsImxldmVsQ2FwcGluZyI6LTEsImxpbWl0TWV0cmljcyI6LTF9
Configuration
Additional player setup steps
No additional steps, just note that I advise testing in Chrome as this issue is not present in Firefox.
Checklist
Steps to reproduce
Expected behaviour
Video should continue playing.
What actually happened?
The video freezes after a few seconds.
Console output
Chrome media internals output
The text was updated successfully, but these errors were encountered: