m3u8 playlist - multiple videos, multiple bitrates

This seems like a very basic question, but I cannot find an answer online for the life of me.


I want to make an HLS playlist in which multiple videos will play seamlessly one after another, with each one available in multiple bitrates. I'm able to create an m3u8 where multiple videos run one after another for a single bitrate, by just copying & pasting the #EXTINF lines and links to the appropriate .ts files from one file to another. But the m3u8 for a single video in multiple bitrates looks like this:


#EXTM3U

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=12251000,RESOLUTION=1920x1080,CODECS="avc1.420028,mp4a.40.2"

1M_Speed_Stick_Heated_Snowboard_Go_Faster__Every_Third_Thursday.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3443000,RESOLUTION=1024x576,CODECS="avc1.4d001f,mp4a.40.2"

2M_Speed_Stick_Heated_Snowboard_Go_Faster__Every_Third_Thursday.m3u8


I could create multiple-video playlists for each of the resolutions I want the final playlist to be available in, but I wouldn't know how then to calculate the values in the EXT-X-STREAM-INF lines. The existence of PROGRAM-ID suggests to me that it should be possible to have multiple videos play consecutively, but when I do that, e.g.:


#EXTM3U

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=12251000,RESOLUTION=1920x1080,CODECS="avc1.420028,mp4a.40.2"

hi_res_Speed_Stick_Heated_Snowboard_Go_Faster__Every_Third_Thursday.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3443000,RESOLUTION=1024x576,CODECS="avc1.4d001f,mp4a.40.2"

2M_Speed_Stick_Heated_Snowboard_Go_Faster__Every_Third_Thursday.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=2,BANDWIDTH=9516000,RESOLUTION=1280x720,CODECS="avc1.420028,mp4a.40.2"

hi_res_Amongst_Inspiration-_Part_5_-_With_Art___Crafter_Mick_Minogue-HD.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=2,BANDWIDTH=3610000,RESOLUTION=1024x576,CODECS="avc1.4d001f,mp4a.40.2"

2M_Amongst_Inspiration-_Part_5_-_With_Art___Crafter_Mick_Minogue-HD.m3u8


All 4 options play show up simultaneously and you can change between the videos by changing 'bitrates'


I could take the concatenated single-bitrate playlists I made and put them into a master playlist like:


#EXTM3U

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=12251000,RESOLUTION=1920x1080,CODECS="avc1.420028,mp4a.40.2"

hi_res_concatenated_playlist.m3u8

#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3443000,RESOLUTION=1024x576,CODECS="avc1.4d001f,mp4a.40.2"

2M_concatenated_playlist.m3u8

(sorry, hit post accidentally)


Which works, sort of, but, while both videos are available in 1024x576, the higher-res option for the first one is 1920x1080, and for the second it's 1280x720, so the BANDWIDTH and RESOLUTION fields in the EXT-X-STREAM-INF lines aren't strictly accurate once multiple videos get involved. Maybe that's not that big a deal, but it'd still be a better implementation if it were possible to specify each of the individual videos in the master playlist...is it?

First, PROGRAM-ID was deprecated a while back (in draft-pantos-12) and never really had any effect. So, while a seemingly plausible idea, that won't work.


The "right" solution is what you suggested - merge the successive playlists for s single bitrate and then make a master playlist that references these.

BANDWIDTH should be the maximum across the merged playlists, RESOLUTION and CODECS should also be the "maximum".

As you point out, this isn't necessarily strictly correct, but it will work.

m3u8 playlist - multiple videos, multiple bitrates
 
 
Q