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 759357 - multifilesink: Unable to set max-file-duration with 10 or more minutes value. It overflows
multifilesink: Unable to set max-file-duration with 10 or more minutes value....
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal major
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-12-11 15:32 UTC by AlexBolotsin
Modified: 2016-05-22 18:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description AlexBolotsin 2015-12-11 15:32:49 UTC
Trying to set max-file-size with g_object_set(...) to 600 * 10e8 I get while working with .ts data:

multifilesink gstmultifilesink.c:764:gst_multi_file_sink_write_buffer:<multifilesink0> new_duration: 480000000, max. duration 18446744072414130176

I've made a lil hack to be able to setup it with seconds value and get over overflowing.

https://gist.github.com/AlexBolotsin/f3ae7d785f16b47bccf6

multifilesink gstmultifilesink.c:764:gst_multi_file_sink_write_buffer:<multifilesink0> new_duration: 480000000, max. duration 60000000000
Comment 1 AlexBolotsin 2015-12-11 16:37:12 UTC
Its not 1e8 but 1e9 - nanoseconds.
Comment 2 Tim-Philipp Müller 2015-12-11 16:52:18 UTC
What is your full g_object_set() line where you try to set the value?

Something like:

g_object_set (multifilesink, "max-file-duration", (guint64) 900 * GST_SECOND, NULL);

or

  GstClockTime dur = 900 * GST_SECOND;
  g_object_set (multifilesink, "max-file-duration", dur, NULL);

should work.
Comment 3 AlexBolotsin 2015-12-11 17:26:41 UTC
I've tried:
  guint64 value = 600 * GST_SECOND;
  g_object_set (multifilesink, "max-file-duration", value , NULL);


As someone suggested me in irc:

  guint64 value = 600 * GST_SECOND;
  g_object_set (multifilesink, "max-file-duration", (guint64)value , NULL);


Tried to set it up with GValue:

  guint64 value = 600 * GST_SECOND;
  Gvalue gvalue = g_value_uint64(value, &gvalue);
  g_object_set_value(mfs, "max-file-duration", &gvalue);


After that I've tried to lure into structure and set variable directly.

I forgot to mention my system. So here it is.

3.19.0-33-generic #38~14.04.1-Ubuntu SMP Fri Nov 6 18:17:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Thx a lot for your attention.
Comment 4 Tim-Philipp Müller 2015-12-11 18:00:10 UTC
I'm not quite sure how to reproduce the problem.

This works fine for me:

$ GST_DEBUG=multifilesink:6 gst-launch-1.0 videotestsrc ! timeoverlay ! video/x-raw,framerate=5/1 ! x264enc ! mpegtsmux ! multifilesink next-file=max-duration max-file-duration=600000000000 location=/tmp/part-%03d.ts 2>&1 | grep -v 'total size of buffer list'
...
gst_multi_file_sink_open_next_file:<multifilesink0> opening file /tmp/part-000.ts
gst_multi_file_sink_write_buffer:<multifilesink0> new_duration: 600200000000, max. duration 600000000000
gst_multi_file_sink_open_next_file:<multifilesink0> opening file /tmp/part-001.ts
gst_multi_file_sink_write_stream_headers:<multifilesink0> Writing stream headers
gst_multi_file_sink_write_buffer:<multifilesink0> new_duration: 600200000000, max. duration 600000000000
...
^C
gst-play-1.0 /tmp/part-000.ts
0:00:13.4 / 0:09:59.7
Comment 5 Tim-Philipp Müller 2015-12-11 18:01:22 UTC
(Also works with 15mins as duration.)
Comment 6 Tim-Philipp Müller 2015-12-20 16:19:35 UTC
Do the above pipelines work fine for you as well, with gst-launch-1.0 ?
Comment 7 Vincent Penquerc'h 2016-03-18 12:52:13 UTC
Could there be some memory corruption ? The odd value you get isn't even -1, and nothing in gstmultifilesink.c does anything to that value except write to it from what it receives from glib. If you can run your test case with valgrind, that'd show up.
Comment 8 Tim-Philipp Müller 2016-05-22 18:09:24 UTC
Not sure what to do about this without more info such as a valgrind log.

Closing this bug report as no further information has been provided. Please feel free to reopen this bug report if you can provide the information that was asked for in a previous comment.
Thanks!