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 discontinuity support #1335

Closed
joeyparrish opened this issue Mar 5, 2018 · 14 comments
Closed

HLS discontinuity support #1335

joeyparrish opened this issue Mar 5, 2018 · 14 comments
Assignees
Labels
component: HLS The issue involves Apple's HLS manifest format status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@joeyparrish
Copy link
Member

We need to add support for EXT-X-DISCONTINUITY and EXT-X-DISCONTINUITY-SEQUENCE to improve support for server-side ad insertion.

https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.2.3
https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-4.3.3.3

@joeyparrish joeyparrish added type: enhancement New feature or request component: HLS The issue involves Apple's HLS manifest format labels Mar 5, 2018
@joeyparrish joeyparrish added this to the v2.5 milestone Mar 5, 2018
@sandersaares
Copy link
Contributor

sandersaares commented Mar 6, 2018

What would be your expectations to HLS content that has a server-side ad inserted that has a different set of tracks than the main content. For example, main content has 3 audio languages and 5 video quality levels, whereas ad might have just one video and one audio track. How would such content need to be structured for Shaka to consume it without issues? How should the change in tracks be signaled at discontinuity time?

@joeyparrish
Copy link
Member Author

joeyparrish commented Mar 6, 2018

Since discontinuities happen inside the media playlist, I expect that the ad segments would need to be the same across media playlists. Any matching of N content streams to M ad streams would have to be done server-side.

The same thing in DASH is more complex, because the matching on N content streams in one period to M ad streams in the next period would have to be done client-side.

Here's an example using your scenario, where there is only one ad resolution and language, but multiple video resolutions and audio languages for the main content:

# Media playlist, 720p video
#EXTINF:2
v-720-500.mp4
#EXTINF:2
v-720-501.mp4

#EXT-X-DISCONTINUITY
#EXTINF:7
v-ad-1.mp4
#EXTINF:7
v-ad-2.mp4
#EXTINF:7
v-ad-3.mp4

#EXT-X-DISCONTINUITY
#EXTINF:2
v-720-502.mp4
#EXTINF:2
v-720-503.mp4
# Media playlist, 480p video
#EXTINF:2
v-480-500.mp4
#EXTINF:2
v-480-501.mp4

#EXT-X-DISCONTINUITY
#EXTINF:7
v-ad-1.mp4
#EXTINF:7
v-ad-2.mp4
#EXTINF:7
v-ad-3.mp4

#EXT-X-DISCONTINUITY
#EXTINF:2
v-480-502.mp4
#EXTINF:2
v-480-503.mp4
# Media playlist, English audio
#EXTINF:2
a-en-500.mp4
#EXTINF:2
a-en-501.mp4

#EXT-X-DISCONTINUITY
#EXTINF:7
a-ad-1.mp4
#EXTINF:7
a-ad-2.mp4
#EXTINF:7
a-ad-3.mp4

#EXT-X-DISCONTINUITY
#EXTINF:2
a-en-502.mp4
#EXTINF:2
a-en-503.mp4
# Media playlist, French audio
#EXTINF:2
a-fr-500.mp4
#EXTINF:2
a-fr-501.mp4

#EXT-X-DISCONTINUITY
#EXTINF:7
a-ad-1.mp4
#EXTINF:7
a-ad-2.mp4
#EXTINF:7
a-ad-3.mp4

#EXT-X-DISCONTINUITY
#EXTINF:2
a-fr-502.mp4
#EXTINF:2
a-fr-503.mp4

@joeyparrish joeyparrish modified the milestones: v2.5, Backlog Jul 9, 2018
@damienlevin
Copy link

damienlevin commented Nov 7, 2018

@joeyparrish Quick note, for fMP4 you also want to add support for multiple EXT-X-MAP. In the case of ad insertion the encoding setting as well as the timestamp/timescale of the ad and content is likely not going to match (which is why you have a discontinuity in the first place). So you will need to reinitialize the decoder setting by loading the initialization segment present in the EXT-X-MAP following any DISCONTINUITY. A fmp4/cmaf style playlist should look like this:

#EXT-X-MAP:URI="content-init.mp4"
#EXTINF:2
content-1.mp4
#EXTINF:2
content-2.mp4
#EXT-X-DISCONTINUITY
#EXT-X-MAP:URI="ad-init.mp4"
#EXTINF:2
ad-1.mp4
#EXTINF:2
ad-2.mp4
#EXTINF:7
ad-3.mp4
#EXT-X-DISCONTINUITY
#EXT-X-MAP:URI="content-init.mp4"
#EXTINF:2
content-3.mp4
#EXTINF:2
content-4.mp4

@joeyparrish
Copy link
Member Author

@damienlevin, thanks! We will make sure not to miss that.

@SVyatoslavG
Copy link

This issue is still valid.
I am using #EXT-X-DISCONTINUITY tags to insert ads in .m3u8 manifest in the server. This provides a great user experience for the user watching videos (avoids flickering with ads overlays, delayed starts, etc). Would be really great to this feature in the next release!

@joeyparrish
Copy link
Member Author

This feature will not make it into v2.6, but work in v2.6 will unblock the development of discontinuities, which could appear in v2.7+. It will be a priority once we begin that cycle, but I can't guarantee specifically v2.7. If some other major feature is completed first, then that would be the defining feature of v2.7, and discontinuity support might be completed in v2.8.

You can see our rough plans on our roadmap doc: https://github.com/google/shaka-player/blob/master/roadmap.md

@MilosRasic
Copy link
Contributor

@joeyparrish is this something community contributors could help with and if it is, is there some "prior art" you could share?

@joeyparrish
Copy link
Member Author

Potentially, but we're still working on the refactoring that will allow this feature to be implemented. Flattening DASH periods so that each track is a single list of segment references will allow us to finally add discontinuities for HLS.

Sorry this has taken so long!

@jamescahall
Copy link

Any update on this? This support is pretty critical not only for SSAI for linear streams but also for m3u8 manifests where multiple videos have been stitched together (such as for adding branding bumper videos dynamically). Currently, as soon as a discontinuity tag is hit, playback stops and the player gets confused about duration and position.

@theodab
Copy link
Contributor

theodab commented Dec 16, 2019

Period flattening is still a work in progress; see #1339.

@joeyparrish joeyparrish modified the milestones: Backlog, Backlog 2 Jan 28, 2020
@michellezhuogg
Copy link
Contributor

Hello @jamescahall @MilosRasic @SVyatoslavG ,
Do you have any example manifests to share with us, so that we can work on implementing and testing? Thank you!

@jamescahall
Copy link

Potentially but not posted here

@michellezhuogg
Copy link
Contributor

@jamescahall ,
Could you please send the URIs to [email protected] if possible? Thank you!

@MilosRasic
Copy link
Contributor

https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxforensicfiles/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxnowthis/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxpetcollective/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dove-redbox.cinedigm.com/hls/amagi_hls_data_xumo-host-dovenow-redbox/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxjourny/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://comedy-redbox.amagi.tv/hls/amagi_hls_data_redboxAAA-comedy/CDN/playlist.m3u8?p=Redbox
https://spotlight-redbox.amagi.tv/hls/amagi_hls_data_redboxAAA-spotlight/CDN/playlist.m3u8?p=Redbox
https://rush-redbox.amagi.tv/hls/amagi_hls_data_redboxAAA-rush/CDN/playlist.m3u8?p=Redbox
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxfilmrisefreemovies/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxgravitas/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://contv-redbox.cinedigm.com/hls/amagi_hls_data_xumo-host-contv-redbox/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxfilmhub/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://docurama-redbox.cinedigm.com/hls/amagi_hls_data_xumo-host-docurama-redboxA/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redbox-maverickmovies/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dove-redbox.cinedigm.com/hls/amagi_hls_data_xumo-host-dovenow-redbox/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxhi-ya/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxamericanclassics/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxunsolvedmysteries/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxforensicfiles/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxfamilyfeud/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxgottalentglobal/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxafhv/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxfailarmy/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://comedydynamicsclean-redbox-ll.cinedigm.com/hls/amagi_hls_data_xumo-host-comedydynamicscleanredbox/CDN/playlist.m3u8?p=Redbox
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxpetcollective/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxpeopleareawesome/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxfood52A/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxjourny/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxusatoday/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxtmz/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxnowthis/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxkabillion/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=
https://dai2.xumo.com/amagi_hls_data_xumo1212A-redboxbatterypop/CDN/playlist.m3u8?p=redbox&deviceid=&is_lat=

This might change over time so you can always get our latest data with

curl 'https://www.redbox.com/gapi/ondemand/hcgraphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://www.redbox.com' --data-binary '{"query":"\tquery avod($id: ID!, $pageNumber: Int!, $pageSize: Int!) {\n\t\treelCollection(id: $id) {\n\t\t\tcollectionId\n\t\t\tname\n\t\t\ttype\n\t\t\treels {\n\t\t\t\tid\n\t\t\t\tname\n\t\t\t\titems (paging: { number: $pageNumber, size: $pageSize }) {\n\t\t\t\t\t... on LiveTvReelItem {\n\t\t\t\t\t\tid\n\t\t\t\t\t\tname\n\t\t\t\t\t\ttype\n\t\t\t\t\t\tsource\n\t\t\t\t\t\tdescription\n\t\t\t\t\t\turl\n\t\t\t\t\t\tgenres\n\t\t\t\t\t\timages\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmono\n\t\t\t\t\t\t\tstylized\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNow\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\tepisodeTitle\n\t\t\t\t\t\t\tcontentType\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t\tstartTime\n\t\t\t\t\t\t\tendTime\n\t\t\t\t\t\t\tcontentType\n\t\t\t\t\t\t\tgenres\n\t\t\t\t\t\t\trating\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNext\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\tepisodeTitle\n\t\t\t\t\t\t\tcontentType\n\t\t\t\t\t\t\tdescription\n\t\t\t\t\t\t\tstartTime\n\t\t\t\t\t\t\tendTime\n\t\t\t\t\t\t\tcontentType\n\t\t\t\t\t\t\tgenres\n\t\t\t\t\t\t\trating\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}","variables":{"id":"livetv-collection-id","pageNumber":1,"pageSize":50}}' --compressed

shaka-bot pushed a commit that referenced this issue Feb 26, 2020
TimestampOffset will be used as a paramater to create the segment
references with discontinuity tags.

Issue #1335

Change-Id: If7dfb63766c2397256561e6668e98f9136f885b5
shaka-bot pushed a commit that referenced this issue Mar 4, 2020
One playlist may contain multiple EXT-X-MAP tags, and each EXT-X-MAP tag
represents the initalization information for the segments after it,
until the next EXT-X-MAP tag or the end of the playlist.

Issue #1335
Closes #2397

Change-Id: Ibb0b4f5da6a48f0303d205cb6bd3abad278527fd
@joeyparrish joeyparrish modified the milestones: Backlog, v2.6 Apr 13, 2020
@michellezhuogg michellezhuogg self-assigned this May 21, 2020
@shaka-project shaka-project locked and limited conversation to collaborators Jun 8, 2020
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
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 status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants