-
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
jump back while play live stream #6685
Comments
You should consider providing more than 6 seconds of available runway for hosting a stable live stream. Three ten second segments would be suitable, but if you are going to cut the target duration down to only two seconds, provide more segments. 12-30s of available buffer is a general range of minimum buffer or runway required for stable streaming across a large variety of devices and network conditions.
You can only pause on a live stream and catch up later as long as there is enough network throughput or buffer to sustain continuous streaming. If network conditions are poor for more than 6 seconds you will miss a segment and be forced to catchup.
How? I'm not convinced this is an issue with hls.js. You'll need to provide a valid Live HLS stream and steps to reproduce. If segments are shifting back to 0 you very likely have unmarked discontinuities or invalid #EXT-X-MEDIA-SEQUENCE updates. |
Thanks for your reply.
I set my stream's m3u8 to 4s * 5 not reproduce the "jump back" issue anymore, but the latency between publisher and viewer goes to about 20s.
I can not provide my stream for you, but other streams can reproduce the "jump back" issue.
I am just not sure if or how I can handle unmarked discontinuities in the viewer side |
I was able to reproduce the issue with v1.5.15 at https://hlsjs.video-dev.org/demo/ What do you expect to happen when the nextwork is throttled below the rate required by the media assets? The asset in question requires roughly 3.5mbps to deliver audio and video on time, so it will stall when throughput is constrained to 256kbps. I understand the issue is not stalling so much as the playlist sliding back to 0. Playlist updates, with the same variant or rendition playlist, must occur such that there is #EXT-X-MEDIA-SEQUENCE overlap or program date time. When there is not, for example when more than N fragments have past and there are only N fragments in the playlist, then there is nothing to sync on:
This means that the last playlist started with sn.85107551, it had 5 segments and the last requested was sn.85107555. However, the new playlist starts with sn.85107561 so there is no overlap between the last update and the current update. Adding program date time is one way to provide a reference that hls.js can use find a suitable offset for the sliding window. The other would be to keep more segments in the playlist so that hls.js can deal with a dropped connection for longer than the amount of time that it is unable to retrieve an update. This asset only has 5 seconds of 1 second segments, and only updates every 2 seconds at best. If two of those updates are missed, sync is lost. As for enhancements, we could look into limiting sliding to a minimum of past sliding values or even estimate a value based on target duration when media sequence has increased significantly as in this case. A forward seek and retiming may still be required as well as other adjustments to pickup at an advanced location. Playing this stream at 256kbps will still be impossible. |
@jprorikon, I pushed a fix that ensure the sliding window will continue to move forward even after sync is lost #6692. |
Head of line (HOL) blocking may be responsible for the playlist update delays while network throttling. It may be a good idea to tune the frag load policy to timeout segment requests closer to the target duration and no more than just a but under the playlist duration. |
What do you want to do with Hls.js?
My live stream has an m3u8 file that comes with 3 TS segments and a 2-second pre-segment.
When the pull-side experiences poor network conditions, the player jumps back to the start of the live stream with the following log:
Playback: 30.915 is located too far from the end of the live sliding playlist: 6, reset currentTime to: 0.000
I want to pause the player and wait until the network conditions improve.
I'm not sure if this is a bug or just a configuration mistake. Hlsjs version is 1.5.5
I checked the exist issue #5282 .
What have you tried so far?
The hls.liveSyncPosition is 0.000, which causes the player to jump to the start of the live stream.
I noticed that PTSKnown is false, and fragments[0].start is 0.
Shouldn't synchronizeToLiveEdge be called after Hls.Events.LEVEL_PTS_UPDATED?
The text was updated successfully, but these errors were encountered: