如何使用ffmpeg将两个视频/音频流混合成一个 [英] How to mux two video/audio streams into one using ffmpeg
问题描述
我认为使用ffmpeg混合音轨不是一个好主意;使用 sox 是一个更好的主意。
你可以使用它如下:
-
使用ffmpeg从v1.flv和v2.flv中提取音频:
ffmpeg -i v1.flv -vn -acodec copy v1.mp3
ffmpeg -i v2.flv -vn -acodec copy v2 .mp3
-
使用sox混合音轨(未测试):
sox -M v1.mp3 v2.mp3 v3.mp3
-
使用ffmpeg复用音频和视频。尝试以下(也未测试):
ffmpeg -i v1.flv -i v3.mp3 -vcodec copy -acodec copy v3.flv
如果命令不完全正确,希望这个想法很清楚。
I have two videos v1.flv and v2.flv and would like to create v3.flv which contains video stream from v1.flv and "mixed" audio streams from v1.flv and v2.flv. Is something like this possible using ffmpeg command? Thanks.
I think it isn't a good idea to use ffmpeg to mix the audio tracks; Using sox is a better idea.
You could use it as follows:
Extract the audio from v1.flv and v2.flv using ffmpeg:
ffmpeg -i v1.flv -vn -acodec copy v1.mp3
ffmpeg -i v2.flv -vn -acodec copy v2.mp3
Mix the audio tracks using sox, something like this (not tested):
sox -M v1.mp3 v2.mp3 v3.mp3
Multiplex audio and video using ffmpeg. Try the following (also not tested):
ffmpeg -i v1.flv -i v3.mp3 -vcodec copy -acodec copy v3.flv
If the commands aren't exactly right, hopefully the idea is clear.
这篇关于如何使用ffmpeg将两个视频/音频流混合成一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!