Skip to content

Implement seeking within HLS moving live window in ExoPlayer and its demo app #87

Closed

Description

@perchrh

The server may keep old chunks available to the streaming clients so that they can rewind the video, for example, to 10 minutes before the live position. Imagine you missed the start of a live tv-show or you were interrupted and missed a part, so you want to rewind it. There are two main, common cases here, the live playlist received by the clients can be of a short or a long duration.

  1. Often CDNs will give you a short playlist with 3-10 chunks, for a playlist duration of 2-3 minutes or less. In this case seeking inside the playlist is not very useful. Instead you would make a request to the CDN for a new playlist at a different position, for example live head - 20 minutes.
    The NASA TV public live stream is an example of this approach, http://www.nasa.gov/multimedia/nasatv/NTV-Public-IPS.m3u8

  2. The second case, that this issue covers, is where you get a long playlist, for example 120 chunks, or 1 hour, from the server. In this case seeking within the playlist is desirable. Because the server is continuously deleting old chunks (and writing new ones), you have a moving live window of a certain fixed size in seconds.
    The player/library must not request chunks outside of the window, as that will give an HTTP error (404). The seekbar must take the moving live window into consideration. While watching the stream, the seekbar should be in the same position, e.g. 10 minutes before live head. The playlist must be refetched when reaching the end of the playlist, or when the user seeks to the end of the playlist. The player UI could for example display "live" as the duration and "-10:00" for the current position when the user has rewinded the live video 10 minutes.

Please let me know if you would like a public sample stream for case (2).

Activity

  1. crossle commented on Oct 23, 2014

    @crossle

    👍

  2. miyaji27 commented on Dec 9, 2014

    @miyaji27

    👍

  3. ojw28 commented on Dec 9, 2014

    @ojw28
    Contributor

    Just as a heads up, we're likely to implement this for both DASH and SmoothStreaming before we do so for HLS, simply because DASH and SmoothStreaming are much better standards, and are more forward looking. I continue to advise looking at DASH, where a choice is possible.

  4. martinbonnin commented on Dec 22, 2014

    @martinbonnin

    +1 for seeking in live HLS content

  5. fougere-mike commented on Mar 31, 2015

    @fougere-mike

    Another +1 for seeking in live HLS content

  6. zikavele commented on Apr 21, 2015

    @zikavele

    Yet another +1 for seeking in live HLS content

  7. ldimitroff commented on May 13, 2015

    @ldimitroff

    Is there an ETA on when is this going to be tackled down? Is there anybody working on it now or has an ExoPlayer workaround to support DVR?

  8. andreimarinescu commented on May 13, 2015

    @andreimarinescu

    +1 as well

  9. zsmatyas commented on May 13, 2015

    @zsmatyas
    Contributor

    +1 :)

  10. ojw28 commented on May 13, 2015

    @ojw28
    Contributor

    No promises, but we're aiming to add DVR window support for DASH by the end of this month. As we do that, we'll be looking at how the same approach can be used for HLS too, specifically for case (2) in the original post. Hopefully this wont be too hard, since they're roughly analogous to one another. I don't think we have near-term plans to support case (1) in the original post.

  11. Arqu commented on Jun 2, 2015

    @Arqu

    +1 for case (2)

  12. Guro commented on Jun 5, 2015

    @Guro

    +1

  13. fougere-mike commented on Jul 21, 2015

    @fougere-mike

    For anyone still waiting on this: I've implemented case 2 in a fork, and it's been working for my case.

    Disclaimer: I have not tested adaptive bitrate streams. My streams do not use adaptive bitrates (variant switching). As a result, it may not work for many of you -- please use with caution. Hopefully the exoplayer devs will have an official implementation sometime soon.

    https://github.com/fougere-mike/ExoPlayer/commits/mikef/hlsLiveSeeking

  14. Greg767 commented on Jul 27, 2015

    @Greg767

    @fougere-mike Hi, I am new to this HLS field and I have a question. Would it be possible to have like a 24 hours window? Also if I understand right, there is no DVR functionnality yet in ExoPlayer, so if I have a m3u8 playlist I won't be able to play it or seek in it.

  15. 36 remaining items

  16. xbezdeka commented on Dec 12, 2016

    @xbezdeka

    Any estimate when this will hit the release version?

  17. niket87 commented on Dec 12, 2016

    @niket87
  18. ojw28 commented on Dec 14, 2016

    @ojw28
    Contributor

    We're aiming to do a release this week. Thanks.

  19. quanghuy1288 commented on May 8, 2017

    @quanghuy1288

    "We're aiming to do a release this week. Thanks."

    Is HLS DVR available now?

  20. AquilesCanta commented on May 8, 2017

    @AquilesCanta
    Contributor

    No, this issue only tracks live seeking, which is available. #2643 tracks offline support.

  21. quanghuy1288 commented on May 8, 2017

    @quanghuy1288

    "No, this issue only tracks live seeking, which is available. #2643 tracks offline support."
    I just need DVR function on HLS, not offline download. Do you know about DVR function on HLS?

  22. AquilesCanta commented on May 8, 2017

    @AquilesCanta
    Contributor

    If it is an event-like stream, where segments are only appended (and not removed), then we support seeking, pausing, etc. If segments are also eventually removed, then we only support seeking to these segments for as long as they are available in the playlist. I do not see other alternative to downloading the segments if this is the case.

  23. quanghuy1288 commented on May 8, 2017

    @quanghuy1288

    Do you have any demo for DVR on HLS?

  24. AquilesCanta commented on May 8, 2017

    @AquilesCanta
    Contributor

    No. But you can easily script your own using a VOD HLS stream, like Apple's sample stream. If you need guidance for this, I'd suggest trying stack overflow.

  25. ojw28 commented on May 8, 2017

    @ojw28
    Contributor

    It's very unclear what feature you're actually asking about. I suspect the answer is that yes, what you want is just supported already and you can seek around in the available media. If you want to see how well ExoPlayer supports your HLS DVR streams, why don't you just add one to the demo app and give it a try?

  26. quanghuy1288 commented on May 9, 2017

    @quanghuy1288

    Hi, i have tested release-v2 worked with DVR HLS :)

  27. hemanthdn commented on May 9, 2017

    @hemanthdn
  28. locked and limited conversation to collaborators on Jun 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions