-
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
Infinite loop loading first fragment with a hole #5609
Comments
Hi @mattzucker, Since your first segment has some media (it just does not begin with an IDR frame) it doesn't really call for a GAP tag (apologies for my earlier curt comment). Using the GAP prevents it from loading and handles seeking, but you miss out on the playable portion of the segment. I was unable to reproduce loop loading with the stream prior to the GAP being added - maybe because I had the worker disabled. If you have another sample or updated steps let me know. Thanks! |
Thank you for following up. I was just about to comment explaining why GAP wouldn't work, but I wanted to test to make sure I understood the behavior. It would skip the entire segment which is not desired, and I also do not know which segments have a problem so I wouldn't know where to add that tag anyway. I am able to reproduce the bug consistently using the stream I linked in the ticket. I also tried with |
Reproducing.Infinite.Load.mp4 |
Hi @mattzucker, Let me know if #5613 resolves this issue. |
In the example stream, I reproduced the bug by breaking the first segment, but it is possible that a segment anywhere in the playlist could be missing the first IDR frame. I will work on updating my example to include this case. I also noticed different behavior when trying to skip over the hole on your branch as compared to version 1.4.7. In 1.4.7, when a fragment with this problem is buffered and the playback gets stuck, I am able to nudge the currentTime forward ( In my case the video may be paused, and I would rather not start playing the video just to get it to jump over the hole. I should note that I really appreciate all your work on this and the fast responses! It is a great product and I realize that I am dealing with edge cases. |
In that case, an earlier fragment will be loaded and appended as long as it is independent. The hole is only there when the previous segment with the required IDR was not appended. You can search the project history for 'backtracking' for more details on this issue and its history. If your first segment had no IDR frames (not independent) and your second segment did not start with an IDR, then we might have an issue when seeking back to the start of segment two where backtracking ultimately fails because segment one is essentially a blank. |
Hi @robwalch, I was able to reproduce the behavior with a segment in the middle of the playlist. It gets into the same backtracking infinite loop, but this time Reproducing.Infinite.Load.2.mp4 |
Can you take another look at the second video I posted? The infinite loop of loading a segment is happening at |
* patch/v1.4.x: Reset loading start on worker setup error Fixes #5617 Never back-track on first fragment to avoid loop loading Fixes #5609 Only load earlier subtitle fragment if discontinuity matches Remove requirement for subtitles to be synced with media PTS when WebVTT MPEGTS map is not present Wait for level switch after fragment or key error with level switch action Fixes #5598 Reset loader aborted state on internal retry #5588 Fix issue where large subtitle target-durations result in incorrect subtitle segment selection Fixes #5595 Keep level switch error actions within player constraints Do not adjust the end time of metadata cues that overlap with cues of another type (id3, emsg, daterange) Fixes #5531 Resume fragment loading after level switch follows level error Fixes #5498
Hi @robwalch. Not sure if you saw my last comment but I don't think this bug is completely fixed. |
Hi @mattzucker, Please file a new issue for this comment #5609 (comment) with repro steps and logs specific to this test case. |
What version of Hls.js are you using?
1.4.7
What browser (including version) are you using?
Chrome 114.0.5735.135 (Official Build) (64-bit)
What OS (including version) are you using?
Windows 10
Test stream
https://raw.githubusercontent.com/mattzucker/hls-test-data/main/clean-bunny/bunny.m3u8
Configuration
Additional player setup steps
I have to work with possibly corrupted video files. In this case, the first few bytes of a segment may be corrupt or missing, which results in a "hole". The sample stream that I provided has this happen on the very first file in the playlist, and you can see when the player loads that it starts the video buffer at 3.70833 instead of 0.
Checklist
Steps to reproduce
this.backtrack(frag)
and evicting it, then repeating.Expected behaviour
I expect the first fragment to load and skip past the buffer hole, just like it does the first time.
What actually happened?
The fragment is never buffered and enters an infinite loop of downloading and evicting.
Console output
Chrome media internals output
No response
The text was updated successfully, but these errors were encountered: