GNOME Bugzilla – Bug 759357
multifilesink: Unable to set max-file-duration with 10 or more minutes value. It overflows
Last modified: 2016-05-22 18:09:24 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
Its not 1e8 but 1e9 - nanoseconds.
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.
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.
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
(Also works with 15mins as duration.)
Do the above pipelines work fine for you as well, with gst-launch-1.0 ?
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.
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!