<html><body><span style="font-family:Verdana; color:#000000; font-size:10pt;"><div>Thanks Sebastian...</div><div><br></div><div>Initially this pipeline choked with the two different test clips, so just used the same clip for 1 and 2.  And that works.  As far as I know both clips were created with the same parameters, but I may have missed something so I'll have some digging to do but this is closer to what we need.</div><div><br></div><div>Thanks again for your assistance.<br></div><div><br></div><div>Burt</div><div><br></div><div><br></div>
<blockquote id="replyBlockquote" webmail="1" style="border-left: 2px solid blue; margin-left: 8px; padding-left: 8px; font-size:10pt; color:black; font-family:verdana;">
<div id="wmQuoteWrapper">
-------- Original Message --------<br>
Subject: Re: Using concat to join multiple .mp4 files into a single .mp4<br>
file<br>
From: Sebastian Dröge <<a href="mailto:sebastian@centricular.com">sebastian@centricular.com</a>><br>
Date: Mon, April 06, 2020 5:54 am<br>
To: Discussion of the development of and with GStreamer<br>
<<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>><br>
<br>
On Sun, 2020-04-05 at 08:50 -0700, <a href="mailto:burt@burtbicksler.com">burt@burtbicksler.com</a> wrote:<br>
> <br>
> We found slomo's blog post and the first file related example<br>
> basically just does a cat of two files so it doesn't of course play<br>
> properly, it just plays the first clip in the output file and ends.<br>
<br>
That depends on the file format, but for MP4 that's certainly true.<br>
<br>
> The second example <br>
> gst-launch-1.0 concat name=c ! queue ! avdec_h264 ! queue !<br>
> videoconvert ! videoscale ! autovideosink   filesrc location=1.mp4 !<br>
> qtdemux ! h264parse ! c.   filesrc location=2.mp4 ! qtdemux !<br>
> h264parse ! c.<br>
> <br>
> Streams fine to the display but if I replace autovideosink with<br>
> filesink location=foodoo.mp4 I get a very large .mp4 file (larger<br>
> than the combined input files e.g. 64 Mbytes vs 398 Mbytes from this<br>
> pipeline.  While the video "plays" it is blank.<br>
<br>
You're decoding both streams and then dump the decoded raw video data<br>
into a file. That's not going to work like this. The concat element is<br>
not doing any magic, it's only concatenating two or more streams into a<br>
continuous timeline.<br>
<br>
> I asked on the IRC channel and received this pipeline:<br>
> gst-launch-1.0 concat name=c ! queue ! qtmux ! filesink<br>
> location=output.mp4  filesrc location=1.mp4 ! qtdemux ! h264parse !<br>
> c.   filesrc location=2.mp4 ! qtdemux ! h264parse ! c.<br>
> <br>
> But that fails with "WARNING: erroneous pipeline: could not link<br>
> h264parse0 to c"<br>
<br>
Check the debug logs for the reason why it is failing to link. Due to<br>
how the pipeline string parser works, this is connecting concat with<br>
the audio sink pad of qtmux, and that of course doesn't work for video.<br>
<br>
That's why I usually recommend to write proper code for such pipelines,<br>
it also makes everything more maintainable and debuggable.<br>
<br>
<br>
The following pipeline works here for me:<br>
<br>
gst-launch-1.0 concat name=c ! queue ! m.video_0 <br>
    qtmux name=m ! filesink location=test.mp4<br>
    filesrc location=in.mp4 ! qtdemux ! h264parse ! c.<br>
    filesrc location=in.mp4 ! qtdemux ! h264parse ! c.<br>
<br>
If you use different input files then you need to make sure that the<br>
h264 streams of both are completely compatible as MP4 does not allow<br>
stream format changes mid-stream. Specifically for H264 that means that<br>
the SPS and PPS need to be the same.<br>
<br>
-- <br>
Sebastian Dröge, Centricular Ltd · <a href="https://www.centricular.com">https://www.centricular.com</a><br>
<hr>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>

</div>
</blockquote></span></body></html>