<div dir="ltr"><div><div><div>on Wed, 02 Nov 2016 09:50:31 +0200, Sebastian Dröge wrote:<br>
> Maybe you'd like to use the splitmuxsink element (and then splitmuxsrc)<br>
> for generating your files? Alternatively you will have to demux them<br>
> (all in <span class="gmail-il">one</span> pipeline) and mux them again with (the same) mp4mux.<br><br></div>Thank you! So, I write some chunks using splitmuxsink. Chunks are valid and have correct pts, pts_time, dts, dts_time, duration and duration_time for each packet.<br><br>sonntex@home ~/video0 $ ls -l<br>total 3696<br>-rw-r--r-- 1 sonntex sonntex 1890215 Nov 18 16:58 video-chunk-00.mp4<br>-rw-r--r-- 1 sonntex sonntex 1891161 Nov 18 16:58 video-chunk-01.mp4<br><br>sonntex@home ~/video0 $ ffprobe -show_packets video-chunk-01.mp4 2>&1 | tail -n 30<br>[PACKET]<br>codec_type=video<br>stream_index=0<br>pts=124771<br>pts_time=12.477100<br>dts=124771<br>dts_time=12.477100<br>duration=98<br>duration_time=0.009800<br>convergence_duration=N/A<br>convergence_duration_time=N/A<br>size=10329<br>pos=1866712<br>flags=_<br>[/PACKET]<br>[PACKET]<br>codec_type=video<br>stream_index=0<br>pts=124869<br>pts_time=12.486900<br>dts=124869<br>dts_time=12.486900<br>duration=697<br>duration_time=0.069700<br>convergence_duration=N/A<br>convergence_duration_time=N/A<br>size=10478<br>pos=1877041<br>flags=_<br>[/PACKET]<br><br></div><div>But result of the merge is incorrect!<br></div><div><br>sonntex@home ~/video0 $ GST_DEBUG=3 gst-launch-1.0 splitmuxsrc location="video-chunk-*.mp4" ! splitmuxsink location="video.mp4"<br>Setting pipeline to PAUSED ...<br>0:00:00.010555250 29243      0x1a28500 WARN                 basesrc gstbasesrc.c:3491:gst_base_src_start_complete:<filesrc0> pad not activated yet<br>0:00:00.012274605 29243 0x7fc71c0200f0 WARN                 qtdemux qtdemux.c:2886:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 1<br>0:00:00.012340497 29243 0x7fc71c0200f0 WARN                 basesrc gstbasesrc.c:2400:gst_base_src_update_length:<filesrc0> processing at or past EOS<br>0:00:00.013333616 29243      0x1a28500 WARN                 basesrc gstbasesrc.c:3491:gst_base_src_start_complete:<filesrc1> pad not activated yet<br>0:00:00.014049112 29243      0x19150f0 WARN                 qtdemux qtdemux.c:2886:qtdemux_parse_trex:<qtdemux1> failed to find fragment defaults for stream 1<br>0:00:00.014108777 29243      0x19150f0 WARN                 basesrc gstbasesrc.c:2400:gst_base_src_update_length:<filesrc1> processing at or past EOS<br>Pipeline is PREROLLING ...<br>0:00:00.015955797 29243 0x7fc71c020370 FIXME               basesink gstbasesink.c:3077:gst_base_sink_default_event:<sink> stream-start event without group-id. Consider implementing group-id handling in the upstream elements<br>Pipeline is PREROLLED ...<br>Setting pipeline to PLAYING ...<br>0:00:00.016233204 29243      0x1a28500 WARN                     bin gstbin.c:2796:gst_bin_do_latency_func:<pipeline0> did not really configure latency of 0:00:00.000000000<br>New clock: GstSystemClock<br>Got EOS from element "pipeline0".<br>Execution ended after 0:00:00.006390800<br>Setting pipeline to PAUSED ...<br>Setting pipeline to READY ...<br>Setting pipeline to NULL ...<br>Freeing pipeline ...<br><br>sonntex@home ~/video0 $ ls -l<br>total 7372<br>-rw-r--r-- 1 sonntex sonntex 1890215 Nov 18 16:58 video-chunk-00.mp4<br>-rw-r--r-- 1 sonntex sonntex 1891161 Nov 18 16:58 video-chunk-01.mp4<br>-rw-r--r-- 1 sonntex sonntex 3761145 Nov 18 21:20 video.mp4<br><br>sonntex@home ~/video0 $ ffprobe -show_packets video.mp4 2>&1 | tail -n 30<br>[PACKET]<br>codec_type=video<br>stream_index=0<br>pts=124416<br>pts_time=24.883200<br>dts=124416<br>dts_time=24.883200<br>duration=652<br>duration_time=0.130400<br>convergence_duration=N/A<br>convergence_duration_time=N/A<br>size=10139<br>pos=3734207<br>flags=_<br>[/PACKET]<br>[PACKET]<br>codec_type=video<br>stream_index=0<br>pts=125068<br>pts_time=25.013600<br>dts=125068<br>dts_time=25.013600<br>duration=49<br>duration_time=0.009800<br>convergence_duration=N/A<br>convergence_duration_time=N/A<br>size=10329<br>pos=3744346<br>flags=_<br>[/PACKET]<br><br></div>As you can see, pts, dts and duration <span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">do not</span> <span class="gmail-">correspond to pts_time, dts_time and duration_time.<br><br>It is not a problem for VLC in some cases, but I have one usb camera </span></span><span id="gmail-result_box" class="gmail-short_text" lang="en"><span>for which</span> VLC<span class="gmail-"> does not work. </span></span><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">Chunks are also valid and have correct pts, pts_time, dts, dts_time, duration and duration_time for each packet.<br><br>sonntex@home ~/video1 $ ls -l<br>total 132<br>-rw-r--r-- 1 sonntex sonntex 67913 Nov 18 17:32 video-chunk-00.mp4<br>-rw-r--r-- 1 sonntex sonntex 62051 Nov 18 17:32 video-chunk-01.mp4<br><br>sonntex@home ~/video1 $ ffprobe -show_packets video-chunk-01.mp4 2>&1 | tail -n 30<br>[PACKET]<br>codec_type=video<br>stream_index=0<br>pts=145692<br>pts_time=14.569200<br>dts=145692<br>dts_time=14.569200<br>duration=130<br>duration_time=0.013000<br>convergence_duration=N/A<br>convergence_duration_time=N/A<br>size=12<br>pos=54537<br>flags=_<br>[/PACKET]<br>[PACKET]<br>codec_type=video<br>stream_index=0<br>pts=145822<br>pts_time=14.582200<br>dts=145822<br>dts_time=14.582200<br>duration=1<br>duration_time=0.000100<br>convergence_duration=N/A<br>convergence_duration_time=N/A<br>size=12<br>pos=54549<br>flags=_<br>[/PACKET]<br></span></span><br><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">Result of the merge is incorrect too! B</span></span><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">ut, probably, there are overflows and some of the values are negative (not for each packet). </span></span><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">It's enough</span> for VLC <span>to</span> <span>not play this file.<br><br></span></span>sonntex@home ~/video1 $ GST_DEBUG=3 gst-launch-1.0 splitmuxsrc location="video-chunk-*.mp4" ! splitmuxsink location="video.mp4"<br>Setting pipeline to PAUSED ...<br>0:00:00.010366521 29326       0xaf6500 WARN                 basesrc gstbasesrc.c:3491:gst_base_src_start_complete:<filesrc0> pad not activated yet<br>0:00:00.012163232 29326 0x7f63a00200f0 WARN                 qtdemux qtdemux.c:2886:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 1<br>0:00:00.012269707 29326 0x7f63a00200f0 WARN                 basesrc gstbasesrc.c:2400:gst_base_src_update_length:<filesrc0> processing at or past EOS<br>0:00:00.013142921 29326       0xaf6500 WARN                 basesrc gstbasesrc.c:3491:gst_base_src_start_complete:<filesrc1> pad not activated yet<br>0:00:00.013882447 29326       0x9e30f0 WARN                 qtdemux qtdemux.c:2886:qtdemux_parse_trex:<qtdemux1> failed to find fragment defaults for stream 1<br>0:00:00.013956282 29326       0x9e30f0 WARN                 basesrc gstbasesrc.c:2400:gst_base_src_update_length:<filesrc1> processing at or past EOS<br>Pipeline is PREROLLING ...<br>0:00:00.015247807 29326 0x7f63a0020370 FIXME               basesink gstbasesink.c:3077:gst_base_sink_default_event:<sink> stream-start event without group-id. Consider implementing group-id handling in the upstream elements<br>Pipeline is PREROLLED ...<br>Setting pipeline to PLAYING ...<br>0:00:00.015483003 29326       0xaf6500 WARN                     bin gstbin.c:2796:gst_bin_do_latency_func:<pipeline0> did not really configure latency of 0:00:00.000000000<br>New clock: GstSystemClock<br>Got EOS from element "pipeline0".<br>Execution ended after 0:00:00.008565126<br>Setting pipeline to PAUSED ...<br>Setting pipeline to READY ...<br>Setting pipeline to NULL ...<br>Freeing pipeline ...<br><br>sonntex@home ~/video1 $ ls -l<br>total 260<br>-rw-r--r-- 1 sonntex sonntex  67913 Nov 18 17:32 video-chunk-00.mp4<br>-rw-r--r-- 1 sonntex sonntex  62051 Nov 18 17:32 video-chunk-01.mp4<br>-rw-r--r-- 1 sonntex sonntex 130286 Nov 18 21:29 video.mp4<br><br>sonntex@home ~/video1 $ ffprobe -show_packets video.mp4 2>&1 | tail -n 30<br>[PACKET]<br>codec_type=video<br>stream_index=0<br>pts=-161503839<br>pts_time=-140438.120870<br>dts=-161503839<br>dts_time=-140438.120870<br>duration=1<br>duration_time=0.000870<br>convergence_duration=N/A<br>convergence_duration_time=N/A<br>size=12<br>pos=114820<br>flags=_<br>[/PACKET]<br>[PACKET]<br>codec_type=video<br>stream_index=0<br>pts=-161503775<br>pts_time=-140438.065217<br>dts=-161503775<br>dts_time=-140438.065217<br>duration=1<br>duration_time=0.000870<br>convergence_duration=N/A<br>convergence_duration_time=N/A<br>size=12<br>pos=114832<br>flags=_<br>[/PACKET]<br><br></span></span></div><span id="gmail-result_box" class="gmail-short_text" lang="en"><span></span></span><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">I wrote you</span> <span>so many</span> <span>logs</span> <span>to show</span> <span>that</span> <span>the same</span> <span>problem can occur</span> <span class="gmail-">in very different ways.</span></span></div>