If I try to concat two mp4 video files via -filter_complex
using command:
ffmpeg -i a.mp4 -i b.mp4 -filter_complex \
"[0:1] [0:0] [1:1] [1:0] concat=n=2:v=1:a=1 [v] [a]" \
-map [v] -map [a] -y testfull.mp4
It works fine but if I try similar with audio files like:
ffmpeg -i a.mp3 -i b.mp3 -filter_complex \
"[0:1] [0:0] [1:1] [1:0] concat=n=2:a=1 [a]" \
-map [a] -y testfull.mp3
Error arises:
Input #1, mp3, from 'b.mp3': Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isomavc1mp42
creation_time : 2010-12-13 21:15:11
encoder : Lavf53.4.0 Duration: 00:02:01.61, start: 0.000000, bitrate: 64 kb/s
Stream #1:0: Audio: mp3, 8000 Hz, stereo, s16p, 64 kb/s
Stream specifier ':1' in filtergraph description [0:1] [0:0] [1:1] [1:0] concat= n=2:a=1 [a] matches no streams.
If I modify -filter_complex
argument and run command as:
ffmpeg -i a.mp3 -i b.mp3 -filter_complex \
"concat=n=2:a=1 [a]" -map [a] -y testfull.mp3
The following error arises
Input #1, mp3, from 'b.mp3': Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isomavc1mp42
creation_time : 2010-12-13 21:15:11
encoder : Lavf53.4.0 Duration: 00:02:01.61, start: 0.000000, bitrate: 64 kb/s
Stream #1:0: Audio: mp3, 8000 Hz, stereo, s16p, 64 kb/s
Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_concat_ 0
Can anyone help me how can I join two audio files via latest ffmpeg
builds possibly with -filter_complex
.
Update: Ok, resolved my issue with this ffmpeg
command:
ffmpeg -i "concat:a.mp3|b.mp3" -c copy output.mp3