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
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?
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 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
@damienlevin, thanks! We will make sure not to miss that.
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!
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
@joeyparrish is this something community contributors could help with and if it is, is there some "prior art" you could share?
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!
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.
Period flattening is still a work in progress; see #1339.
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!
Potentially but not posted here
@jamescahall ,
Could you please send the URIs to [email protected] if possible? Thank you!
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
Most helpful comment
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!