<div dir="ltr">Dear Sebastian,<div><br></div><div>I tried to run the same python code on a linux box and I made some progress. On Linux I can set the faststart property of the multiplexer in the encoderbin to True. In this case the code generates a valid mp4 file, with a moov atom right after the ftyp atom at the begining of the file as expected. On the other hand if I set the faststart property to False I have the same result as on windows. The mdat atom has an invalid size at byte offset 32.</div>
<div><br></div><div>I don't know if this helps or not.</div><div><br></div><div>Best regards,</div><div><br></div><div>Lajos</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 7, 2014 at 12:29 PM, Lajos Okos <span dir="ltr"><<a href="mailto:lajos.okos@gmail.com" target="_blank">lajos.okos@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Sebastian,<div><br></div><div>Thanks for your reply.</div><div><br></div><div>The pipeline I'm using is uridecodebin ! encodebin ! filesink. The uri property of uridecodebin is configured for appsrc. My code is in python, and it is based on the example provided with the Livestreamer application. I set up the pads between uridecodebin and encodebin in the pad-added signal handler of uridecodebin.</div>
<div><br></div><div>I'm not sure what do you mean by "finalizing the file". Once I cannot push more buffers in the need-data signal handler, I send the end-of stream signal from the appsrc. I also have the eos message handler configured on the pipeline bus and once I have the message, I put the pipeline into NULL state and wait for the result with the get_state(timeout) function. Once this function returns, I quit the main loop. Should I do anything more or in a different way? Switching on logging on qtmux, filesink and the pipeline I find the followings in the log related to the file close...</div>
<div><br></div><div><div>0:00:32.033203000 7140 577e428 DEBUG qtmux gstqtmux.c:1802:gst_qt_mux_stop_file:<muxer> Updating remaining values and sending last data</div><div>0:00:32.033203000 7140 577e428 DEBUG qtmux gstqtmux.c:1819:gst_qt_mux_stop_file:<muxer> Sending the last buffer for pad video_0</div>
<div>0:00:32.033203000 7140 577e428 LOG qtmux gstqtmux.c:2315:gst_qt_mux_add_buffer:<muxer> Pad (video_0) dts updated to 0:00:59.920000000</div><div>0:00:32.033203000 7140 577e428 LOG qtmux gstqtmux.c:2319:gst_qt_mux_add_buffer:<muxer> Adding 1 samples to track, duration: 100 size: 3171 chunk offset: 15134478</div>
<div>0:00:32.034203000 7140 577e428 DEBUG qtmux gstqtmux.c:2347:gst_qt_mux_add_buffer: dts: 0:00:59.880000000 pts: 0:00:59.840000000 timebase_dts: 149700 pts_offset: -100</div><div>0:00:32.034203000 7140 577e428 LOG qtmux gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 3171</div>
<div>0:00:32.034203000 7140 577e428 LOG qtmux gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream</div><div>0:00:32.034203000 7140 577e428 DEBUG filesink gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 3171 bytes at 15134526</div>
<div>0:00:32.035204000 7140 577e428 DEBUG qtmux gstqtmux.c:1819:gst_qt_mux_stop_file:<muxer> Sending the last buffer for pad audio_0</div><div>0:00:32.035204000 7140 577e428 LOG qtmux gstqtmux.c:2315:gst_qt_mux_add_buffer:<muxer> Pad (audio_0) dts updated to 0:01:00.000000000</div>
<div>0:00:32.035204000 7140 577e428 LOG qtmux gstqtmux.c:2319:gst_qt_mux_add_buffer:<muxer> Adding 1 samples to track, duration: 1024 size: 378 chunk offset: 15137649</div><div>0:00:32.035204000 7140 577e428 DEBUG qtmux gstqtmux.c:2347:gst_qt_mux_add_buffer: dts: 99:99:99.999999999 pts: 0:00:59.968000000 timebase_dts: 1918976 pts_offset: 0</div>
<div>0:00:32.036204000 7140 577e428 LOG qtmux gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 378</div><div>0:00:32.036204000 7140 577e428 LOG qtmux gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream</div>
<div>0:00:32.036204000 7140 577e428 DEBUG filesink gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 378 bytes at 15137697</div><div>0:00:32.036204000 7140 577e428 DEBUG qtmux gstqtmux.c:1532:gst_qt_mux_configure_moov:<muxer> Updating timescale to 1000</div>
<div>0:00:32.036204000 7140 577e428 DEBUG qtmux gstqtmux.c:1908:gst_qt_mux_stop_file:<muxer> Media first ts selected: 0:00:00.000000000</div><div>0:00:32.037204000 7140 577e428 LOG qtmux gstqtmux.c:1162:gst_qt_mux_setup_metadata:<muxer> tags: taglist, encoder=(string)x264, encoder-version=(uint)125, minimum-bitrate=(uint)55750, bitrate=(uint)56650, maximum-bitrate=(uint)55750;</div>
<div>0:00:32.037204000 7140 577e428 DEBUG qtmux gstqtmux.c:1167:gst_qt_mux_setup_metadata:<muxer> Removing bogus tags</div><div>0:00:32.037204000 7140 577e428 DEBUG qtmux gstqtmux.c:1172:gst_qt_mux_setup_metadata:<muxer> Formatting tags</div>
<div>0:00:32.037204000 7140 577e428 DEBUG qtmux gstqtmux.c:559:gst_qt_mux_add_mp4_tag:<muxer> Adding tag İtoo -> x264</div><div>0:00:32.038204000 7140 577e428 DEBUG qtmux gstqtmux.c:1050:gst_qt_mux_add_xmp_tags:<muxer> Adding xmp tags</div>
<div>0:00:32.038204000 7140 577e428 LOG qtmux gstqtmux.c:1553:gst_qt_mux_send_moov:<muxer> Copying movie header into buffer</div><div>0:00:32.038204000 7140 577e428 DEBUG qtmux gstqtmux.c:1558:gst_qt_mux_send_moov:<muxer> Pushing moov atoms</div>
<div>0:00:32.039204000 7140 577e428 LOG qtmux gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 36589</div><div>0:00:32.039204000 7140 577e428 LOG qtmux gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream</div>
<div>0:00:32.039204000 7140 577e428 DEBUG filesink gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 36589 bytes at 15138075</div><div>0:00:32.039204000 7140 577e428 DEBUG qtmux gstqtmux.c:1595:gst_qt_mux_send_extra_atoms:<muxer> Pushing extra top-level atom uuid</div>
<div>0:00:32.040204000 7140 577e428 LOG qtmux gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 731</div><div>0:00:32.040204000 7140 577e428 LOG qtmux gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream</div>
<div>0:00:32.040204000 7140 577e428 DEBUG filesink gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 731 bytes at 15174664</div><div>0:00:32.040204000 7140 577e428 DEBUG qtmux gstqtmux.c:1988:gst_qt_mux_stop_file:<muxer> updating mdat size</div>
<div>0:00:32.040204000 7140 577e428 DEBUG filesink gstfilesink.c:516:gst_file_sink_do_seek:<rec_sink> Seeking to offset 32 using fseeko</div><div>0:00:32.041204000 7140 577e428 LOG qtmux gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 16</div>
<div>0:00:32.041204000 7140 577e428 LOG qtmux gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream</div><div>0:00:32.041204000 7140 577e428 DEBUG filesink gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 16 bytes at 32</div>
<div>0:00:32.041204000 7140 577e428 DEBUG qtmux gstqtmux.c:2447:gst_qt_mux_handle_buffer:<muxer> Pushing eos</div><div>0:00:32.042204000 7140 3d88ea0 DEBUG pipeline gstpipeline.c:346:pipeline_update_start_time:<pipeline> start_time=0:00:31.330426053, now=0:00:31.330437221, base_time 0:00:00.000011168</div>
<div>0:00:32.042204000 7140 3d88ea0 DEBUG pipeline gstpipeline.c:346:pipeline_update_start_time:<pipeline> start_time=0:00:31.331194277, now=0:00:31.331205445, base_time 0:00:00.000011168</div><div>
0:00:32.054205000 7140 3d88ea0 DEBUG filesink gstfilesink.c:435:gst_file_sink_close_file:<rec_sink> closed file</div></div><div><br></div><div>This suggests me that the output file is properly closed, but I'm not sure.</div>
<div><br></div><div>gst-discoverer complains about the length of the mdat atom at offset 32 that is set up close to the end of the above log. </div><div><br></div><div>Hope you have some ideas....</div><div><br></div><div>
Best Regards,</div><div><br></div><div>Lajos</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 6, 2014 at 9:10 AM, Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fr, 2014-04-04 at 16:42 +0200, Lajos Okos wrote:<br>
> Hi Everyone,<br>
><br>
><br>
><br>
> I created a simple pipeline with uridecode, encodebin and filesink to<br>
> capture a HLS stream, transcode it to mp4 and save it to a file. (I<br>
> enclosed the dot file of the pipeline in PLAYING state.) Depending on the<br>
> variant of the mp4mux I use, I experience different kind of problems with<br>
> the recorded mp4 file.<br>
<br>
What's the pipeline you're using? Are you finalising the file once<br>
you're done by having an EOS event going into the muxer and waiting for<br>
the EOS message from the sink before shutting down the pipeline?<span class="HOEnZb"><font color="#888888"><br>
<span><font color="#888888"><br>
--<br>
Sebastian Dröge, Centricular Ltd - <a href="http://www.centricular.com" target="_blank">http://www.centricular.com</a><br>
Expertise, Straight from the Source<br>
</font></span><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></font></span></blockquote></div><br></div>
</blockquote></div><br></div>