After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796002 - hlssink/hlssink2: support append-list option
hlssink/hlssink2: support append-list option
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-05-10 12:39 UTC by Daeseok Youn
Modified: 2018-11-03 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
hlssink: support append-list option (5.06 KB, patch)
2018-05-10 12:43 UTC, Daeseok Youn
none Details | Review
hlssink2: support append-list option (5.49 KB, patch)
2018-05-10 12:43 UTC, Daeseok Youn
none Details | Review
hlssink: support append-list option (5.04 KB, patch)
2018-05-15 09:27 UTC, Daeseok Youn
none Details | Review
hlssink2: support append-list option (5.44 KB, patch)
2018-05-15 09:28 UTC, Daeseok Youn
none Details | Review

Description Daeseok Youn 2018-05-10 12:39:32 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.
Comment 1 Daeseok Youn 2018-05-10 12:43:16 UTC
Created attachment 371891 [details] [review]
hlssink: support append-list option

Appends the new segments into old hls segment list
Comment 2 Daeseok Youn 2018-05-10 12:43:44 UTC
Created attachment 371893 [details] [review]
hlssink2: support append-list option
Comment 3 Tim-Philipp Müller 2018-05-10 14:52:21 UTC
It would be nice if you could expand on why this is needed and/or in what context it would be useful :)
Comment 4 Daeseok Youn 2018-05-11 06:41:02 UTC
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/
Comment 5 Sebastian Dröge (slomo) 2018-05-11 07:22:42 UTC
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.
Comment 6 Daeseok Youn 2018-05-11 08:49:49 UTC
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?
Comment 7 Sebastian Dröge (slomo) 2018-05-11 08:54:40 UTC
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.
Comment 8 Sebastian Dröge (slomo) 2018-05-11 08:55:14 UTC
Also yes, the seqnums should stay continuous after starting again with append-list=true
Comment 9 Daeseok Youn 2018-05-11 09:38:37 UTC
ok. I will put patches again after fixing it as your comment.
Thanks.
Comment 10 Daeseok Youn 2018-05-15 09:27:16 UTC
Created attachment 372046 [details] [review]
hlssink: support append-list option

v2: start segnum from (previous start segnum + 1)
Comment 11 Daeseok Youn 2018-05-15 09:28:09 UTC
Created attachment 372047 [details] [review]
hlssink2: support append-list option

v2: same reason with hlssink
Comment 12 Daeseok Youn 2018-05-15 09:37:36 UTC
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.
Comment 13 GStreamer system administrator 2018-11-03 14:22:46 UTC
-- 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.