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

HLS failover does not work #2541

Closed
kerberozt opened this issue Apr 30, 2020 · 8 comments · Fixed by #4189
Closed

HLS failover does not work #2541

kerberozt opened this issue Apr 30, 2020 · 8 comments · Fixed by #4189
Labels
component: HLS The issue involves Apple's HLS manifest format priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@kerberozt
Copy link

kerberozt commented Apr 30, 2020

According to HLS specification one should be able to specify multiple variant-streams, and if one of them is down the player should pick another variant-stream. This does not seem to be the case for Shaka Player. This is between a Bug report and a feature request, because it might not really be a bug that the HLS specification is not implemented fully.

From the official HLS specification:
https://developer.apple.com/library/archive/referencelibrary/GettingStarted/AboutHTTPLiveStreaming/about/about.html
"Fallback with Stream Alternates

Not only do alternate media playlists in your master playlist operate as bandwidth or device alternatives, the alternates also serve as failure fallbacks. If the player cannot reload the media playlist file—due to issues such as 404 errors, server crashing, or a content distributor node problem—the player attempts to switch to another compatible media playlist provided on a different server. Offering multiple media playlists with the same bandwidth, the player switches to an identical playlist, providing consistent stream performance.
"

The reason we want this to reducancy to work is because we use multiple CDNs as backups, if one CDN goes down. Now if one CDN is down the whole playback will break for everyone, even as we have multiple CDNs.

Have you read the FAQ and checked for duplicate open issues?

What version of Shaka Player are you using?
2.5.0

Can you reproduce the issue with our latest release version?
Yes, I can reproduce on 2.5.10

Can you reproduce the issue with the latest code from master?
Yes, I can reproduce on 2.5.0

Are you using the demo app or your own custom app?
I have tried in both, same result

If custom app, can you reproduce the issue using our demo app?
I can

What browser and OS are you using?
Ubuntu + multiple browsers, Google Chrome, Chromium, Firefox. Same result

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
No embedded device

What are the manifest and license server URIs?

Manifest uri and shaka hosting on: http://localhost:8000/
No license server

What did you do?

  1. I produced two HLS manifests. One with only one working variant, and all segments available. That one worked! (just to verify nothing else was broken)

  2. I modified that working HLS manifest to have two HLS variants, one working variant (same as in 1.) and one broken variant substream with missing segments.

What did you expect to happen?

Here I expect the player to play it, and automatically use the not broken variant of the HLS stream

What actually happened?

It failed the whole playback trying to fetch segments from the broken variant.

@joeyparrish joeyparrish added type: enhancement New feature or request component: HLS The issue involves Apple's HLS manifest format labels Apr 30, 2020
@joeyparrish joeyparrish added this to the Backlog milestone Apr 30, 2020
@joeyparrish
Copy link
Member

The failover behavior would have to be implemented in Shaka Player's core, beyond where the HLS playlists are parsed. Perhaps this is something we could do in StreamingEngine.

@MilosRasic
Copy link
Contributor

Any chance of this in 2.7, regardless of which manifest is used? It's not on the roadmap so I didn't want to post it in the 2.7 issue. Some other players we've tested for HLS have this so it doesn't seem to be an exotic feature.

@avelad
Copy link
Member

avelad commented Apr 30, 2020

I think it might also be a good idea to have it in DASH.

@joeyparrish
Copy link
Member

I'm not sure what our schedule for v2.7 is yet, but we can add this to the list of candidate features. We'd be happy to help motivated members of the community work on a design and a PR, if that's helpful. There are five of us on the team, and we're responsible for multiple projects, so we're a bit limited in terms of what we can get done right now.

@joeyparrish joeyparrish added the flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this label Apr 30, 2020
@joeyparrish
Copy link
Member

Was just discussing this feature with @bradoutlaw, and we decided this could be done relatively simply.

If we can identify redundant media playlist URLs from the master playlist alone, we could group the playlist URLs together and pass an Array to the media playlist parsing method, instead of a single URL. The parser would only fetch one playlist URL, but it could use those multiple playlist URLs as multiple base URLs in resolving relative segment URLs.

This could be a fairly small change, and relatively easy to implement. The only catch is correctly identifying redundant media playlist URLs, so we should study the HLS spec carefully to determine how this should be done.

@michellezhuogg michellezhuogg added gsoc and removed flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this labels Mar 24, 2021
@himanshujaidka
Copy link

working :)

@aditmehta9
Copy link
Contributor

aditmehta9 commented Mar 27, 2021

working :)

Hello, Himanshu I think we are not supposed to work on GSoC projects until our proposal is accepted and the program begins i.e 17th May. It is mentioned in 1st point of this doc https://storage.googleapis.com/wvtemp/shaka/Shaka%20Player%20GSoC%20Projects%20List.pdf that's why they might have removed label contributions welcome.

@joeyparrish joeyparrish removed the gsoc label Sep 27, 2021
@TheModMaker TheModMaker added the priority: P2 Smaller impact or easy workaround label Sep 29, 2021
joeyparrish pushed a commit that referenced this issue Apr 18, 2022
Parse EXT-X-GAP HLS tag and add a status enum to shaka.media.SegmentReference.

shaka.media.SegmentReference.Status.AVAILABLE --> Normal behaviour
shaka.media.SegmentReference.Status. UNAVAILABLE --> Related to #2541
shaka.media.SegmentReference.Status. MISSING --> EXT-X-GAP in HLS

Note: only the parsing is added, but the functionality is not yet implemented.

Issue #1308
@joeyparrish
Copy link
Member

This appears to have been resolved in #4189.

@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 9, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: HLS The issue involves Apple's HLS manifest format priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants