我想将多个音频文件添加到输出视频中(将它们合并为一个流)。每个音频都有自己的持续时间和开始/结束点。我画了一张图来解释我想要实现的目标。
我尝试使用apad
和adeley
来执行此操作,但输出结果不正确,一些音频丢失或未在正确的时间启动。
这是我的filter_complex
命令(apad and adelay
参数不总是 0.0)。
-filter_complex
[1]
音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a1]; [a1]adelay=0.0|0.0,apad[b1]; [2] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a2]; [a2]adelay=0.0|0.0[b2]; [3] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a3]; [a3]adelay=0.0|0.0,apad[b3]; [4] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a4]; [a4]adelay=0.0|0.0,apad[b4]; [5] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a5]; [a5]adelay=0.0|0.0,apad[b5]; [6] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a6]; [a6]adelay=0.0|0.0,apad[b6]; [7] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a7]; [a7]adelay=0.0|0.0,apad[b7]; [8] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a8]; [a8]adelay=0.0|0.0,apad[b8]; [9] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a9]; [a9]adelay=0.0|0.0,apad[b9]; [10] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a10]; [a10]adelay=0.0|0.0,apad[b10]; [11] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a11]; [a11]adelay=0.0|0.0,apad[b11]; [12] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a12]; [a12]adelay=0.0|0.0,apad[b12]; [13] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a13]; [a13]adelay=0.0|0.0,apad[b13]; [14] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a14]; [a14]adelay=0.0|0.0,apad[b14]; [15] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a15]; [a15]adelay=0.0|0.0,apad[b15]; [16] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a16]; [a16]adelay=0.0|0.0,apad[b16]; [17] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a17]; [a17]adelay=0.0|0.0,apad[b17]; [18] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a18]; [a18]adelay=0.0|0.0,apad[b18]; [19] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a19];[a19]adelay=0.0|0.0,apad[b19];[20] 音量=0.0dB,aformat=sample_fmts=s16p:sample_rates=44100:channel_layouts=立体声 [a20];[a20]adelay=0.0|0.0,apad[b20]; [b1][b2][b3][b4][b5][b6][b7][b8][b9][b10][b11][b12][b13][b14][b15][b16][b17][b18][b19][b20]amerge=20[a] -map 0:v -map [a] -b:v 3200k -c:v libopenh264 -c:a aac -ac 2 /Users/Movies/test.mp4