如何使用 ffmpeg 叠加/缩混两个音频文件 [英] How to overlay/downmix two audio files using ffmpeg

查看:110
本文介绍了如何使用 ffmpeg 叠加/缩混两个音频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 ffmpeg 将两个音频 mp3 文件叠加/缩混成一个 mp3 输出文件吗?

解决方案

立体声+立体声→立体声

普通缩混

使用

使用

使用

使用 amix 过滤器:

ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex amix=inputs=2:duration=longest output.mp3

<小时>

更多信息和示例

请参阅FFmpeg Wiki:音频频道

Can I overlay/downmix two audio mp3 files into one mp3 output file using ffmpeg?

解决方案

stereo + stereo → stereo

Normal downmix

Use the amix filter:

ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex amix=inputs=2:duration=longest output.mp3

Or the amerge filter:

ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex amerge=inputs=2 -ac 2 output.mp3

Downmix each input into specific output channel

Use the amerge and pan filters:

ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex "amerge=inputs=2,pan=stereo|c0<c0+c1|c1<c2+c3" output.mp3


mono + mono → stereo

Use the join filter:

ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex join=inputs=2:channel_layout=stereo output.mp3

Or amerge:

ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex amerge=inputs=2 output.mp3


mono + mono → mono

Use the amix filter:

ffmpeg -i input0.mp3 -i input1.mp3 -filter_complex amix=inputs=2:duration=longest output.mp3


More info and examples

See FFmpeg Wiki: Audio Channels

这篇关于如何使用 ffmpeg 叠加/缩混两个音频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆