我有两个输入文件(track1.m3 和 track2.opus),我想从中提取四个剪辑并按顺序交叉淡入淡出。我根据Gyan 在 Stack Overflow 上的回答得出了这个命令:
ffmpeg -hide_banner -y -ss 00:00:00 -i ./track1.mp3 -t 00:04:10 -ss 00:00:00 -i ./track2.opus -t 00:00:20 -ss 00:01:15 -i ./track2.opus -t 00:00:35 -ss 00:06:07 -i ./track2.opus -t 00:00:53 -vn -filter_complex "[0][1]acrossfade=d=2:c1=tri:c2=exp[a01];[a01][2]acrossfade=d=2:c1=tri:c2=exp[a02];[a02][3]acrossfade=d=2:c1=tri:c2=exp[output]" -map "[output]" output.mp3
但是,它仅生成一个时长为 53 秒的文件,该文件似乎仅包含最后的输入(最长的输入),而没有任何淡入淡出:
Input #0, mp3, from './track1.mp3':
Metadata:
encoder : Lavf61.1.100
Duration: 00:04:23.31, start: 0.025057, bitrate: 128 kb/s
Stream #0:0: Audio: mp3 (mp3float), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
encoder : Lavf
Input #1, ogg, from './track2.opus':
Duration: 00:07:12.31, start: 0.007500, bitrate: 109 kb/s
Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp
Metadata:
encoder : Lavf61.1.100
Input #2, ogg, from './track2.opus':
Duration: 00:07:12.31, start: 0.007500, bitrate: 109 kb/s
Stream #2:0(eng): Audio: opus, 48000 Hz, stereo, fltp
Metadata:
encoder : Lavf61.1.100
Input #3, ogg, from './track2.opus':
Duration: 00:07:12.31, start: 0.007500, bitrate: 109 kb/s
Stream #3:0(eng): Audio: opus, 48000 Hz, stereo, fltp
Metadata:
encoder : Lavf61.1.100
Stream mapping:
Stream #0:0 (mp3float) -> acrossfade
Stream #1:0 (opus) -> acrossfade
Stream #2:0 (opus) -> acrossfade
Stream #3:0 (opus) -> acrossfade
acrossfade:default -> Stream #0:0 (libmp3lame)
Press [q] to stop, [?] for help
Output #0, mp3, to 'output.mp3':
Metadata:
TSSE : Lavf61.1.100
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp
Metadata:
encoder : Lavc61.3.100 libmp3lame
[out#0/mp3 @ 000001e763527380] video:0KiB audio:829KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.029701%
size= 829KiB time=00:00:53.00 bitrate= 128.1kbits/s speed= 119x
我需要做什么特别的事情来让所有剪辑按顺序淡入淡出吗?
这是 Windows 10 上的 ffmpeg 7.0.1-full_build-www.gyan.dev,希望它有帮助。
-ss
编辑:我更正了和的顺序-i
并更新了输出。没有变化。我还更新了调用以明确参数的引用正确,并删除了多余的-map_metadata 1
。