m3u8 icon indicating copy to clipboard operation
m3u8 copied to clipboard

Add function to merge segment playlists

Open ziima opened this issue 9 years ago • 5 comments

In case I want to play live stream, I download the playlist from one location and get few segments from continuing stream. I'd like have an function which merges these chunks to single playlist.

Playlist examples:

#EXTM3U
#EXT-X-MEDIA-SEQUENCE:58877187
#EXT-X-TARGETDURATION:8
#EXT-X-PROGRAM-DATE-TIME:2015-12-05T14:11:36Z
#EXTINF:8
1502/58877187.ts
#EXTINF:8
1502/58877188.ts
#EXTINF:8
1502/58877189.ts
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:58877188
#EXT-X-TARGETDURATION:8
#EXT-X-PROGRAM-DATE-TIME:2015-12-05T14:11:44Z
#EXTINF:8
1502/58877188.ts
#EXTINF:8
1502/58877189.ts
#EXTINF:8
1502/58877190.ts

ziima avatar Sep 02 '16 19:09 ziima

@ziima can you explain it a little bit more? :) maybe give us examples of your idea, what is your wish. Are these two playlists from different bitrates?

leandromoreira avatar Sep 02 '16 19:09 leandromoreira

I can point you to my script: https://github.com/ziima/televize/blob/master/televize.py#L77-L99

LiveStream.update is what I want. The playlist there is M3U8 object.

The playlists are from the same bitrates.

ziima avatar Sep 02 '16 19:09 ziima

@ziima do you want to generate a single VOD playlist from a live playlist? it's like converting live to event type ... maybe offering two kinds of representation for the same playlist.

leandromoreira avatar Sep 02 '16 20:09 leandromoreira

Sounds correct. I'm a bit lost in the terminology.

ziima avatar Sep 02 '16 20:09 ziima

The major problem though is that we need to keep track of the data we're merging... and if someone is using this library as part of a distributed system it shouldn't work as expected unless we can enforce that a given playlist is being "watched" uniquely from a single node.

leandromoreira avatar Sep 02 '16 20:09 leandromoreira