如果我尝试连接两个mp4视频文件 -filter_complex
使用命令:
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
它工作正常,但如果我尝试类似音频文件,如:
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
出现错误:
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.
如果我修改 -filter_complex
参数和运行命令为:
ffmpeg -i a.mp3 -i b.mp3 -filter_complex \
"concat=n=2:a=1 [a]" -map [a] -y testfull.mp3
出现以下错误
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
任何人都可以帮助我如何通过最新加入两个音频文件 ffmpeg
建立可能与 -filter_complex
。
更新: 好的,解决了我的问题 ffmpeg
命令:
ffmpeg -i "concat:a.mp3|b.mp3" -c copy output.mp3