Skip to content
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

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

Closed
perchrh opened this issue Oct 22, 2014 · 59 comments
Closed
Assignees

Comments

@perchrh
Copy link

perchrh commented Oct 22, 2014

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).

@crossle
Copy link

crossle commented Oct 23, 2014

👍

@miyaji27
Copy link

miyaji27 commented Dec 9, 2014

👍

@ojw28
Copy link
Contributor

ojw28 commented Dec 9, 2014

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.

@martinbonnin
Copy link

+1 for seeking in live HLS content

@ojw28 ojw28 mentioned this issue Jan 18, 2015
@fougere-mike
Copy link

Another +1 for seeking in live HLS content

@zikavele
Copy link

Yet another +1 for seeking in live HLS content

@ldimitroff
Copy link

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?

@andreimarinescu
Copy link

+1 as well

@zsmatyas
Copy link
Contributor

+1 :)

@ojw28
Copy link
Contributor

ojw28 commented May 13, 2015

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.

@Arqu
Copy link

Arqu commented Jun 2, 2015

+1 for case (2)

@Guro
Copy link

Guro commented Jun 5, 2015

+1

@fougere-mike
Copy link

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

@Greg767
Copy link

Greg767 commented Jul 27, 2015

@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.

@fougere-mike
Copy link

@Greg767 With a fully implemented HLS spec you should be able to have a 24 hour window, and seek within that window. Currently ExoPlayer does not support that feature.

However, the fork I linked does support seeking within the window (not sure if it'll work with 24 hour window, but I don't see why it wouldn't). Keep in mind I haven't tested with adaptive bitrates, so it may not be what you need.

@fougere-mike
Copy link

@ojw28 hey, any update on this?

@PiotrGryko
Copy link

Hi! https://github.com/PiotrGryko/ExoPlayer/tree/master/library

I have forked exoplayer library and made required changes to having livestream seekingbar working.

  1. progressBar.secondProgress indicates current livestream position. We can seek back/seek forward in range of buffered stream
  2. playerInternal.getDuration() returns duration of current video from the beginning of the user stream

I have forked the last version of library. And used it along with ExoMediaPlayer

The solution was not to replace current HlsMediaPlaylist as it was done with livestream. Instead of it I append old list with new segments and made it behaves similar to isAlive=false

@artnalban
Copy link

+1 for HLS live DVR

@PiotrGryko
Copy link

Thanks
On 15 Mar 2016 00:40, "Artur Nalbandian" notifications@github.com wrote:

+1 for HLS live DVR


You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#87 (comment)

@peddisri
Copy link
Contributor

5cce28a patch has support for Seeking within Live DVR window. It handles adaptive bitrate switching as well as re-fetching live playlist to move the Live DVR window. I request people in this thread to try it out and let us know if there are any HLS live DVR content which has issues with this patch.

@RajatSingh
Copy link

Another +1 for seeking in live HLS content

@weathersboyle
Copy link

+1! 😃

@jglanfield
Copy link

jglanfield commented Oct 24, 2016

I've forked the repo and have a very hack-ish implementation that allows rewinding a live event. No, I didn't spend time on updating API definitions, method headers, whatever, since I know an implementation is already being worked on. But I needed something that let me stream in reverse. No promises that it does exactly what you need it to do, but in case you want to have a look:

https://github.com/jglanfield/ExoPlayer/tree/jdg-hls-rewind

@MudasirBhutto
Copy link

@AquilesCanta
Hey buddy, any new on this? We're expecting it within a day or two..!

@bricker
Copy link

bricker commented Oct 25, 2016

@MudasirBhutto Please don't pester them. It'll be finished when it's finished.

@AquilesCanta
Copy link
Contributor

Guys, just to let you know: I am still working on this. Many thanks for your patience. I am not giving any estimations this time. Priorities shift and things come up, unfortunately, but this is still coming.

@jglanfield
Copy link

jglanfield commented Nov 4, 2016

Will the updated work on this include using EXT-X-PROGRAM-DATE-TIME ?

@AquilesCanta
Copy link
Contributor

Not yet, no. But on the map.

@hemanthdn
Copy link

Hi, I tested the player, I see the rewind function works,
but the forward functions goes to the start of the DVR live stream.
Secoondly, The seek bar their is a bug, their the timing is shown correct, but the seek bar is at start position only.
Any update on it?

ojw28 pushed a commit that referenced this issue Nov 10, 2016
In order to expose the live window, it is necessary (unlike before) to refresh
the live playlists being played periodically so as to know where the user can
seek to. For this, the HlsPlaylistTracker is added, which is basically a map
from HlsUrl's to playlist. One of the playlists involved in the playback will
be chosen to define the live window. The playlist tracker it periodically.
The rest of the playilst will be loaded lazily. N.B: This means that for VOD,
playlists are not refreshed at all. There are three important features missing
in this CL(that will be added in later CLs):

* Blacklisting HlsUrls that point to resources that return 4xx response codes.
    As per [Internal: b/18948961].
* Allow loaded chunks to feed timestamps back to the tracker, to fix any
    drifting in live playlists.
* Dinamically choose the HlsUrl that points to the playlist that defines the
    live window.

Other features:
--------------

The tracker can also be used for keeping track of discontinuities. In the case
of single variant playlists, this is particularly useful. Might also work if
there is a that the live playlists are aligned (but this is more like working
around the issue, than actually solving it). For this, see [Internal: b/32166568]
and [Internal: b/28985320].

Issue:#87

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=138054302
@ojw28
Copy link
Contributor

ojw28 commented Nov 10, 2016

@AquilesCanta 's change (ref'd above) adds preliminary live seeking support for HLS. Feel free to give it a try. Note that there are some known issues that we'll be cleaning up over the next week or two (e.g. temporary blacklisting of variants when a 404 is encountered is currently broken, and will need fixing before we do a stable release to).

ojw28 pushed a commit that referenced this issue Nov 18, 2016
@hemanthdn
Copy link

Thanks for the update, but still i dont see support for HLS DVR, the mpeg Dash stream works.

The seekbar position is in live wen player start and can rewind to desired position, but in DVR HLS stream I see its only live streams, can you explain the scenario or possible solution.

@ojw28
Copy link
Contributor

ojw28 commented Nov 25, 2016

Are you using the latest dev-v2 code? The changes haven't made it into a release yet.

@niket87
Copy link

niket87 commented Dec 8, 2016

Finally! The much awaited HLS Live DVR is working in latest dev-v2 code.

@xbezdeka
Copy link

Any estimate when this will hit the release version?

ojw28 pushed a commit that referenced this issue Dec 12, 2016
When the primary url is blacklisted (due to a 404, for example) or
the selected variant is different from primary url, allow the tracker
to change the url.

Issue:#87

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141291435
@niket87
Copy link

niket87 commented Dec 12, 2016 via email

@ojw28
Copy link
Contributor

ojw28 commented Dec 14, 2016

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

@quanghuy1288
Copy link

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

Is HLS DVR available now?

@AquilesCanta
Copy link
Contributor

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

@quanghuy1288
Copy link

"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?

@AquilesCanta
Copy link
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.

@quanghuy1288
Copy link

Do you have any demo for DVR on HLS?

@AquilesCanta
Copy link
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.

@ojw28
Copy link
Contributor

ojw28 commented May 8, 2017

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?

@quanghuy1288
Copy link

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

@hemanthdn
Copy link

hemanthdn commented May 9, 2017 via email

@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests