You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow to define LiveConfiguration values relative to the end of the playlist/manifest #652
I have been looking into an api or group of functions in exoplayer to set a min buffer duration in a live stream.
it seems in order to build a lets say 30 sec buffer on a live stream you need to also set an offset value.
essentially its a live stream with a sliding window manifest where segments are appended to the end and taken away from the beginning.
i have tried to set a setLiveTargetOffsetMs but it doesnt seem to do what i want.
it seems to include the offset from the wall clock time and the segment PDT times in the manifest and include that drift.
so for streams which have a long latency from wall clock to the last segement program date time - i can only seem to buffer 1 segement which causes buffer empty stalls/buffering.
id like to mimic the behavior of this HLS server tag - https://datatracker.ietf.org/doc/html/rfc8216#section-4.3.5.2 of ext-x-start.
given an offset value of lets say 32 seconds and a sliding window manifest of 2 minutes and 4 seconds segments, id like playback to start and a buffer to build from the the 8th to last segment starting from the live edge in the manifest .
on an HLS stream or DASH stream ideally this can be done.
@marcbaechinger our use case is more to adapt to networks that cannot maintain adequate buffering with 3 segments back from live. The dynamic live edge support added to 2.13 should cover this use case.
i see the solution there with .setLiveTargetOffsetMs(10 * 60_000) example, but it seems to include the drift from wall clock to current segment time.
looking at the picture, is there a way to start playback with offset value from the end of the live window(the blue live window box), but does not include real time calculations of unix/realtime/wall clock time.
i know there is a seek to that seems doable mentioned in the documentation but it seems that will incur some performance/startup stream latency cost. is there a way without it?
our use case is more to adapt to networks that cannot maintain adequate buffering with 3 segments back from live. The dynamic live edge support added to 2.13 should cover this use case
One thing that may not be clear is that the dynamic live edge support also looks at the available buffer level and automatically stays further away from the live edge if there is no sufficient buffer level to get closer. Ideally, this should already help the cases you describe without any additional intervention.
on an HLS stream or DASH stream
What you are describing is essentially a difference in how the signalling works in DASH and HLS. The DASH values are defined relative to now (as defined by the UTCTiming element) and the HLS playlist config values are defined relative to the end of the playlist. If you control the creation of the manifest/playlist yourself, the best way to handle this is to set the values accordingly. This means you have to define different values for DASH/HLS to achieve the same result.
The ExoPlayer overrides for LiveConfiguraton.targetOffsetMs (and minOffsetMs etc) are defined in the same way as the DASH spec defines them.
is there a way to start playback with offset value from the end of the live window(the blue live window box), but does not include real time calculations of unix/realtime/wall clock time
This isn't possible in a generic way at the moment. As I said above, the MediaItem.LiveConfiguration values are defined in the same way as DASH defines them. But this means you can't specify overrides in the way HLS would define them. I'll mark it an an enhancement to provide this option (possibly as a parameter in LiveConfiguration).
changed the title [-]Setting a playback offset to build a buffer on a live stream[/-][+]Allow to define LiveConfiguration values relative to the end of the playlist/manifest[/+]on Sep 15, 2023
Activity
tonihei commentedon Sep 15, 2023
One thing that may not be clear is that the dynamic live edge support also looks at the available buffer level and automatically stays further away from the live edge if there is no sufficient buffer level to get closer. Ideally, this should already help the cases you describe without any additional intervention.
What you are describing is essentially a difference in how the signalling works in DASH and HLS. The DASH values are defined relative to
now(as defined by theUTCTimingelement) and the HLS playlist config values are defined relative to the end of the playlist. If you control the creation of the manifest/playlist yourself, the best way to handle this is to set the values accordingly. This means you have to define different values for DASH/HLS to achieve the same result.The ExoPlayer overrides for
LiveConfiguraton.targetOffsetMs(andminOffsetMsetc) are defined in the same way as the DASH spec defines them.The equivalent API in ExoPlayer to set this value is to specify a start position when setting the
MediaItem, which works for both DASH and HLS:This isn't possible in a generic way at the moment. As I said above, the
MediaItem.LiveConfigurationvalues are defined in the same way as DASH defines them. But this means you can't specify overrides in the way HLS would define them. I'll mark it an an enhancement to provide this option (possibly as a parameter inLiveConfiguration).[-]Setting a playback offset to build a buffer on a live stream[/-][+]Allow to define LiveConfiguration values relative to the end of the playlist/manifest[/+]Merge pull request androidx#652 from Guovin/dev