having problem with mp4mux

Lajos Okos lajos.okos at gmail.com
Mon Apr 7 05:20:18 PDT 2014


Dear Sebastian,

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.

I don't know if this helps or not.

Best regards,

Lajos


On Mon, Apr 7, 2014 at 12:29 PM, Lajos Okos <lajos.okos at gmail.com> wrote:

> Dear Sebastian,
>
> Thanks for your reply.
>
> 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.
>
> 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...
>
> 0:00:32.033203000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:1802:gst_qt_mux_stop_file:<muxer> Updating remaining values and
> sending last data
> 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
> 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
> 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
> 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
> 0:00:32.034203000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 3171
> 0:00:32.034203000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream
> 0:00:32.034203000  7140    577e428 DEBUG               filesink
> gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 3171 bytes at
> 15134526
> 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
> 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
> 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
> 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
> 0:00:32.036204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 378
> 0:00:32.036204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream
> 0:00:32.036204000  7140    577e428 DEBUG               filesink
> gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 378 bytes at
> 15137697
> 0:00:32.036204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:1532:gst_qt_mux_configure_moov:<muxer> Updating timescale to 1000
> 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
> 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;
> 0:00:32.037204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:1167:gst_qt_mux_setup_metadata:<muxer> Removing bogus tags
> 0:00:32.037204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:1172:gst_qt_mux_setup_metadata:<muxer> Formatting tags
> 0:00:32.037204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:559:gst_qt_mux_add_mp4_tag:<muxer> Adding tag ©too -> x264
> 0:00:32.038204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:1050:gst_qt_mux_add_xmp_tags:<muxer> Adding xmp tags
> 0:00:32.038204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1553:gst_qt_mux_send_moov:<muxer> Copying movie header into
> buffer
> 0:00:32.038204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:1558:gst_qt_mux_send_moov:<muxer> Pushing moov atoms
> 0:00:32.039204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 36589
> 0:00:32.039204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream
> 0:00:32.039204000  7140    577e428 DEBUG               filesink
> gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 36589 bytes at
> 15138075
> 0:00:32.039204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:1595:gst_qt_mux_send_extra_atoms:<muxer> Pushing extra top-level
> atom uuid
> 0:00:32.040204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 731
> 0:00:32.040204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream
> 0:00:32.040204000  7140    577e428 DEBUG               filesink
> gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 731 bytes at
> 15174664
> 0:00:32.040204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:1988:gst_qt_mux_stop_file:<muxer> updating mdat size
> 0:00:32.040204000  7140    577e428 DEBUG               filesink
> gstfilesink.c:516:gst_file_sink_do_seek:<rec_sink> Seeking to offset 32
> using fseeko
> 0:00:32.041204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1203:gst_qt_mux_send_buffer:<muxer> sending buffer size 16
> 0:00:32.041204000  7140    577e428 LOG                    qtmux
> gstqtmux.c:1219:gst_qt_mux_send_buffer:<muxer> downstream
> 0:00:32.041204000  7140    577e428 DEBUG               filesink
> gstfilesink.c:661:gst_file_sink_render:<rec_sink> writing 16 bytes at 32
> 0:00:32.041204000  7140    577e428 DEBUG                  qtmux
> gstqtmux.c:2447:gst_qt_mux_handle_buffer:<muxer> Pushing eos
> 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
> 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
> 0:00:32.054205000  7140    3d88ea0 DEBUG               filesink
> gstfilesink.c:435:gst_file_sink_close_file:<rec_sink> closed file
>
> This suggests me that the output file is properly closed, but I'm not sure.
>
> 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.
>
> Hope you have some ideas....
>
> Best Regards,
>
> Lajos
>
>
> On Sun, Apr 6, 2014 at 9:10 AM, Sebastian Dröge <sebastian at centricular.com
> > wrote:
>
>> On Fr, 2014-04-04 at 16:42 +0200, Lajos Okos wrote:
>> > Hi Everyone,
>> >
>> >
>> >
>> > I created a simple pipeline with uridecode, encodebin and filesink to
>> > capture a HLS stream, transcode it to mp4 and save it to a file. (I
>> > enclosed the dot file of the pipeline in PLAYING state.) Depending on
>> the
>> > variant of the mp4mux I use, I experience different kind of problems
>> with
>> > the recorded mp4 file.
>>
>> What's the pipeline you're using? Are you finalising the file once
>> you're done by having an EOS event going into the muxer and waiting for
>> the EOS message from the sink before shutting down the pipeline?
>>
>> --
>> Sebastian Dröge, Centricular Ltd - http://www.centricular.com
>> Expertise, Straight from the Source
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140407/3bd6c76c/attachment.html>


More information about the gstreamer-devel mailing list