-
Notifications
You must be signed in to change notification settings - Fork 516
Forcing the use of SeekParameters.CLOSEST_SYNC in a HLS stream #2209
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
Comments
|
Hi @DovydasKl,
Could you please explain a bit why there is difficulty in adding the |
|
@tianyif we use a proprietary solution for the server that transcodes and creates the HLS streams. That solution does make independent segments (each segment does have a keyframe in it) but so far we have found no option to make it add the EXT-X-INDEPENDENT-SEGMENTS tag by itself. We could resort to some hackery - like intercepting the playlist and editing it before passing it on to the client, but it would be much simpler to assume the segments are independent when they come from that streaming server. |
Previously we only enable `SeekParameter.*_SYNC` for HLS when `EXT-X-INDEPENDENT-SEGMENTS` is set in the playlist. However, this condition can actually be loosened. To seek in HLS, we need to download the segment in which the resolved seek position locates under any circumstance. If `SeekParameter.PREVIOUS_SYNC` or `SeekParameter.CLOSEST_SYNC` is passed, and that segment happens to start with sync samples, then the seek can be done quicker with that adjusted seek position. And if that segment doesn't start with sync samples, then the behaviour will be the same as we set the adjusted seek position to the exact original position. But we still cannot safely enable `SeekParameter.NEXT_SYNC` as it will potentially cause the seeking to miss more content than seeking to the exact position. Issue: #2209 PiperOrigin-RevId: 737580861
Previously we only enable `SeekParameter.*_SYNC` for HLS when `EXT-X-INDEPENDENT-SEGMENTS` is set in the playlist. However, this condition can actually be loosened. To seek in HLS, we need to download the segment in which the resolved seek position locates under any circumstance. If `SeekParameter.PREVIOUS_SYNC` or `SeekParameter.CLOSEST_SYNC` is passed, and that segment happens to start with sync samples, then the seek can be done quicker with that adjusted seek position. And if that segment doesn't start with sync samples, then the behaviour will be the same as we set the adjusted seek position to the exact original position. But we still cannot safely enable `SeekParameter.NEXT_SYNC` as it will potentially cause the seeking to miss more content than seeking to the exact position. Issue: #2209 PiperOrigin-RevId: 737580861 (cherry picked from commit 42b71c2)
|
We submitted a commit to loosen the condition for seeking to sync positions in HLS, and the |
@DovydasKl If your proprietary solution is |


Hello,
We're trying to enable
SeekParameters.CLOSEST_SYNCin our player instance for our HLS streams, but it doesn't seem to work. We checked the code out and it seems for HLS theHlsChunkSourceonly calculates adjusted seek positions if the playlist has anEXT-X-INDEPENDENT-SEGMENTStag. Our streams do not have this tag and we have no way of adding it server-side.Is there any way to force exoplayer to use the timestamp adjusting logic? Our segments are independent and we have tested an imperfect workaround of calculating the position ourselves before seeking and it speeds up seeking significantly, but letting exoplayer do this would be much more preferable.
The main reason we are trying to do
CLOSEST_SYNCseeks, because seek times to exact positions are significantly slower for some reason. If there's any other way to speed up seeking withoutSeekParametersI'd appreciate input too.We are on version 1.5.1.
The text was updated successfully, but these errors were encountered: