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 724983 - hlsdemux: Invalid timestamps generated for live streams and otherwise broken for live streams
hlsdemux: Invalid timestamps generated for live streams and otherwise broken ...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-22 23:19 UTC by Sebastian Dröge (slomo)
Modified: 2018-11-03 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2014-02-22 23:19:52 UTC
a) Currently hlsdemux generates timestamps by summing all the fragment durations in the playlist. Only that this will lead to invalid timestamps because the playlists are like a ringbuffer, only having a few fragments and not all since the beginning of time. We could keep all fragments around forever or try to assign a timestamp to the beginning of the playlist by looking at the sequence numbers of the fragments, but this is going to fail once we e.g. switch from one bitrate to another. Also it will fail if after a playlist update we have no old fragments around... we can't know how much gap there was in between.

b) If we pause the pipeline, we will lack behind... and can easily get to a point where all fragments have disappeared already. We need to resync then, and probably always resync whenever we unpause.

c) Due to us and the sender having different clocks, we will run out of sync at some point. Either being in the future for the sender (downloading fragments that don't exist yet) or too far in the past (downloading fragments that disappeared already). We need some resync logic for that. Probably rather unlikely case as it requires a lot of clock drift and everybody using HLS for such long-term live streaming doesn't deserve something else ;)


a) and b) definitely need to be fixed, c) would be bonus if someone is bored :)
Comment 1 Sebastian Dröge (slomo) 2014-02-23 09:50:24 UTC
I think Andoni had some fixes for that in bug #698155, but those were dependent on the other feature additions... and are not applying to the 1.x version of the demuxer anyway.
Comment 2 Sebastian Dröge (slomo) 2014-02-23 14:19:56 UTC
a) is fixed by this here (hopefully):

commit b3a72429107b5f9dea2633735314c07b065f233a
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Sun Feb 23 15:18:22 2014 +0100

    hlsdemux: Keep track of timestamps by adding them up during playback
    
    ...instead of adding them from the start of playlist every time. This
    among other things fixes timestamps for live streams, where the playlist
    is some kind of ringbuffer of fragments and thus adding from the beginning
    of the playlist will miss the past fragments.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724983
Comment 3 GstBlub 2014-06-20 19:12:39 UTC
I also have a fix for this in bug #731982
Comment 4 GStreamer system administrator 2018-11-03 13:21:15 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/134.