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 794440 - hlssink2: Inconsistent fragment duration
hlssink2: Inconsistent fragment duration
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Windows
: Normal blocker
: 1.14.0
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-18 04:30 UTC by Seungha Yang
Modified: 2018-03-19 10:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
splitmuxsink: Allow splitting at exactly the time/bytes threshold (1.40 KB, patch)
2018-03-19 09:01 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Seungha Yang 2018-03-18 04:30:08 UTC
This bug must be related to splitmuxsink's behavior, that is, the "send-keyframe-requests" property cannot produce consistent fragment duration.

To reproduce this bug, below command was used and then the segment duration always fluctuates between 5 ~ 10 seconds.
gst-launch-1.0 videotestsrc ! queue ! x264enc ! h264parse ! hlssink2
Comment 1 Nicolas Dufresne (ndufresne) 2018-03-18 12:06:25 UTC
Have you tried configuring the key-max-int  to max into ? Otherwise don't you end up with a mix of requested IDR and the automatic IDR from x264 ?
Comment 2 Seungha Yang 2018-03-18 12:24:23 UTC
(In reply to Nicolas Dufresne (stormer) from comment #1)
> Have you tried configuring the key-max-int  to max into ? Otherwise don't
> you end up with a mix of requested IDR and the automatic IDR from x264 ?

I tried to configuring key-max-int to very large value and the result was also weird...

gst-launch-1.0 videotestsrc ! queue ! x264enc key-int-max=20000000 ! h264parse ! hlssink2
With very large key-max-int value like above command, the splitmuxsink request keyframe only the first time at https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/multifile/gstsplitmuxsink.c#n1726

And then, I could not observe the next request from splitmuxsink.
Comment 3 Sebastian Dröge (slomo) 2018-03-19 08:51:47 UTC
I can confirm this here. This is a regression in splitmuxsink, it worked not too long ago correctly.
Comment 4 Sebastian Dröge (slomo) 2018-03-19 08:56:23 UTC
GIT bisect leads to

commit 76e458a119926424e9dd5acf3210a592a314d713
Author: Jan Schmidt <jan@centricular.com>
Date:   Tue Apr 7 23:53:19 2015 +1000

    splitmuxsink: Use muxer reserved space properties if present.
    
    If the use-robust-muxing property is set, check if the
    assigned muxer has reserved-max-duration and
    reserved-duration-remaining properties, and if so set
    the configured maximum duration to the reserved-max-duration
    property, and monitor the remaining space to start
    a new file if the reserved header space is about to run out -
    even though it never ought to.
Comment 5 Sebastian Dröge (slomo) 2018-03-19 09:01:30 UTC
Created attachment 369855 [details] [review]
splitmuxsink: Allow splitting at exactly the time/bytes threshold

76e458a119926424e9dd5acf3210a592a314d713 changed the conditions from
"queued > threshold" to "queued >= threshold", which broke hlssink2 and
resulting in too small fragments being created although keyframes would
be at *exactly* the configured threshold.
Comment 6 Sebastian Dröge (slomo) 2018-03-19 09:02:13 UTC
I'm not entirely sure about the
>     if (queued_gop_time >= mux_reserved_remain) {
line in the same function.
Comment 7 Sebastian Dröge (slomo) 2018-03-19 10:25:10 UTC
Attachment 369855 [details] pushed as 42f5f3d - splitmuxsink: Allow splitting at exactly the time/bytes threshold