GNOME Bugzilla – Bug 796002
hlssink/hlssink2: support append-list option
Last modified: 2018-11-03 14:22:46 UTC
The "append-list" option is able to append segment files after parsing previous playlist file. The sequence number will start from previous sequence number + 1.
Created attachment 371891 [details] [review] hlssink: support append-list option Appends the new segments into old hls segment list
Created attachment 371893 [details] [review] hlssink2: support append-list option
It would be nice if you could expand on why this is needed and/or in what context it would be useful :)
The "append-list" option could be used to live stream. For example, something happened in encoder and the encoder is restarted but continue the segment files from previous m3u8. And also the append-list option is one of hls flags in Ffmpeg. The patch link below is related to "append-list" on ffmpeg. https://patchwork.ffmpeg.org/patch/156/
This seems useful, but apart from just reading the latest seqnum you also should parse the different fragments so that hlssink can remove old fragments as configured.
You mean, if previous m3u8 file has below contents: #EXTM3U #EXT-X-VERSION:3 #EXT-X-ALLOW-CACHE:NO #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-TARGETDURATION:15 #EXTINF:15.000000953674316, segment00000.ts #EXTINF:15.000000953674316, segment00001.ts #EXTINF:15.000000953674316, segment00002.ts #EXTINF:15.000000953674316, segment00003.ts #EXTINF:6.5999999046325684, segment00004.ts Run Gstreamer with "append-list=true", it appends segnum started from 1 instead of 4. (currently, the seqnum starts from 4 in this example) Am I right?
See the max-files and playlist-length properties on hlssink/hlssink2. By default, at most 5 files are kept in the playlist and 10 files on disk.
Also yes, the seqnums should stay continuous after starting again with append-list=true
ok. I will put patches again after fixing it as your comment. Thanks.
Created attachment 372046 [details] [review] hlssink: support append-list option v2: start segnum from (previous start segnum + 1)
Created attachment 372047 [details] [review] hlssink2: support append-list option v2: same reason with hlssink
Hi Sebastian, I tried to fix this path up to adjust sequence number as previous start number + 1. But as I know, if playlist-length is smaller value than max-files, m3u8 couldn't have all of segment files what are kept on disk. It means, when append-list option is used, hlssink could not parse the number of files on disk from playlist.m3u8, right? Actually, I ran ffmpeg following options: $ ffmpeg -i ~/Videos/sample.mp4 -codec copy -strict -2 -hls_time 10 -hls_flags append_list+delete_segments -f hls ./playlist.m3u8 I think "append_list+delete_segments" option could not manage previous generated segment files. Please check updated patches and provide your comment for this.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/703.