How to use the concat to concatenate multiple .mp4 files
gotsring
gotsring at live.com
Thu Jan 21 17:11:28 UTC 2021
Using your pipeline and my own generated videos, I reproduced the error on
Windows using MSVC 1.18.0.
The error appears when the first file stream ends.
It looks like the codec_data cap that is set by qtdemux is different between
file streams, though I'm not sure this is even needed outside of decodebin.
Once the first stream ends, the second stream starts with different
codec_data, and qtmux refuses to renegotiating caps with the new codec_data.
Is this a bug? Is there a way to strip this cap?
In the meanwhile, you can try finding an MP4 demuxer that doesn't set this
cap, or, if this is a one-off concat operation, maybe use ffmpeg. Or I'm
completely wrong, and you can debug yourself using --gst-debug=4.
==============
Steps to reproduce:
==============
To create 2 test videos:
gst-launch-1.0 videotestsrc num-buffers=200 ! video/x-raw, framerate=20/1,
width=1024, height=768, format=I420 ! x264enc ! qtmux ! filesink
location=I420.mp4
gst-launch-1.0 videotestsrc pattern=ball num-buffers=300 ! video/x-raw,
framerate=30/1, width=1920, height=1080, format=Y444 ! x264enc ! qtmux !
filesink location=Y444.mp4
To concat:
gst-launch-1.0 --gst-debug=3 concat name=c ! queue ! videoconvert !
videoscale ! videorate ! video/x-raw, format=Y444, width=1280, height=720,
framerate=24/1 ! x264enc ! qtmux ! filesink location=output.mp4 \
filesrc location=Y444.mp4 ! decodebin ! c. \
filesrc location=I420.mp4 ! decodebin ! c.
Error log:
Redistribute latency...
0:00:00.704046000 12352 0000027708FCF480 FIXME basesink
gstbasesink.c:3386:gst_base_sink_default_event:<filesink0> stream-start
event without group-id. Consider implementing group-id handling in the
upstream elements
0:00:00.704210000 12352 0000027708FCF480 WARN qtmux
gstqtmux.c:3077:gst_qt_mux_start_file:<qtmux0> Robust muxing requires
reserved-moov-update-period to be set
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
0:00:00.709573000 12352 0000027708FCF480 FIXME aggregator
gstaggregator.c:1325:gst_aggregator_aggregate_func:<qtmux0> Subclass should
call gst_aggregator_selected_samples() from its aggregate implementation.
New clock: GstSystemClock
Redistribute latency...
Redistribute latency...
0:00:03.932631000 12352 0000027708FCF3C0 WARN qtmux
gstqtmux.c:5346:gst_qt_mux_can_renegotiate:<qtmux0> pad video_0 refused
renegotiation to video/x-h264,
codec_data=(buffer)01f4001fffe1001e67f4001f919b280a00b7602d4040405000000300100000030308f183196001000568ebec4480,
stream-format=(string)avc, alignment=(string)au, level=(string)3.1,
profile=(string)high-4:4:4, width=(int)1280, height=(int)720,
pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)24/1,
interlace-mode=(string)progressive, colorimetry=(string)bt709,
chroma-site=(string)mpeg2
<previous message repeated 8 times>
0:00:03.932831000 12352 0000027708FCF3C0 WARN GST_PADS
gstpad.c:4303:gst_pad_peer_query:<x264enc0:src> could not send sticky events
ERROR: from element
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0: Internal
data stream error.
Additional debug info:
../gst/isomp4/qtdemux.c(6545): gst_qtdemux_loop ():
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:03.232267000
Setting pipeline to NULL ...
Freeing pipeline ...
--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
More information about the gstreamer-devel
mailing list