GNOME Bugzilla – Bug 756181
hlssink: inconsistent segment duration since 1.5.2 onwards
Last modified: 2015-10-25 09:33:47 UTC
hlssink generates segments with different durations since version 1.5.2 (version 1.5.1 works fine). I downloaded and build on x86_64 gst-plugins-bad source versions 1.5.1, 1.5.2 and 1.6.0 and run the following pipeline: gst-launch-1.0 videotestsrc is-live=1 ! x264enc speed-preset=1 ! mpegtsmux ! hlssink target-duration=1 On version 1.5.2, I noticed that the segment duration starting from the second segment is 0.23 seconds: segment00000.ts -> 01.00 seconds segment00001.ts -> 00.23 seconds segment00002.ts -> 00.23 seconds ... This also happens on version 1.6.0. However, it works fine on version 1.5.1, the segment duration for all segments is always 1 second. I am not really sure if it is an hlssink issue, I have checked the changes between both versions (1.5.1 and 1.5.2) and I can see there is a big change in mpegtsmux that has to do with timestamps (commit e000a6f0a4984fbe81190df6cd439c70dafde3d6)
I'm using git master and it seems to work correctly for me, anything special on your setup?
This was probably fixed by this, which is not yet in 1.6.0: commit 5bf7432f81a095f55f89aa65b4f9f27335e2b747 Author: Tim-Philipp Müller <tim@centricular.com> Date: Wed Sep 30 00:36:14 2015 +0100 mpegtsmux: fix downstream key unit events handling with hlssink The buffer timestamps in the collect function will already be running time, don't try to convert them again to running time, this would yield CLOCK_TIME_NONE now that the segment is shifted to account for negative dts. This fixes x264enc ! mpegtsmux ! hlssink, which was broken because mpegtsmux would send a downstream key unit event with running time NONE and then hlssink would immediately send another one upstream and it would just be a flood of force keyframe events in both directions after the first one. This would then break hlssink because it uses multifilesink in next-file=key-unit-event mode, and starting a new file after every few kB does not work well for HLS. http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/gst/mpegtsmux?id=5bf7432f81a095f55f89aa65b4f9f27335e2b747 Could you try if that patch fixes it for you?
Hi Tim, That patch fixes the issue, now the segments are generated correctly. Thank you very much for your help, I appreciate it a lot as we were stuck with 1.5.1.
Thanks for testing and confirming it fixes it.
Forgot to mark this as FIXED.