混合音轨与SOX偏移 [英] Mix Audio tracks with offset in SOX
问题描述
从ASP.Net,我使用FFMPEG FLV文件转换为Flash Media Server的到,我需要组合成一个单一的MP3文件,wav文件上。我最初尝试FFMPEG这完全是,但最终放弃了对混合步骤,因为我不相信它有可能合并的音频只跟踪到一个结果文件。我会爱错了。
From ASP.Net, I am using FFMPEG to convert flv files on a Flash Media Server to wavs that I need to mix into a single MP3 file. I originally attempted this entirely with FFMPEG but eventually gave up on the mixing step because I don't believe it it possible to combine audio only tracks into a single result file. I would love to be wrong.
我现在用FFMPEG访问FLV文件,并提取音轨到wav,这样的 SOX 可以混合使用它们。的问题是,我必须抵消由几秒钟,使它们同步音轨中的一个。每个文件是一个学生和教师之间的对话的一半。例如teacher.wav可能需要student.wav后开始3.3秒。我只能想出如何到两个轨道开始在同一时间的文件,SOX混合。
I am now using FFMPEG to access the FLV files and extract the audio track to wav so that SOX can mix them. The problem is that I must offset one of the audio tracks by a few seconds so that they are synchronized. Each file is one half of a conversation between a student and a teacher. For example teacher.wav might need to begin 3.3 seconds after student.wav. I can only figure out how to mix the files with SOX where both tracks begin at the same time.
在这一点上我最好的尝试是:
My best attempt at this point is:
ffmpeg -y -i rtmp://server/appName/instance/student.flv -ac 1 student.wav
ffmpeg -y -i rtmp://server/appName/instance/teacher.flv -ac 1 teacher.wav
sox -m student.wav teacher.wav combined.mp3 splice 3.3
这些工具(FFMEG / SOX)是基于我最好的选择研究,但不是必需的。任何工作的解决方案将允许一个ASP.Net服务输入两个FMS FLV和使用开源或免费的工具来创建一个综合的MP3。
These tools (FFMEG/SoX) were chosen based on my best research, but are not required. Any working solution would allow an ASP.Net service to input the two FMS flvs and create a combined MP3 using open-source or free tools.
编辑:
我能够抵消使用延迟
开关SOX的文件。
I was able to offset the files using the delay
switch in SOX.
sox -M student.wav teacher.wav combined.mp3 delay 2.8
我要离开的问题,以防有人开了比合并FFMPEG / SOX解决方案,更好的方法。
I'm leaving the question open in case someone has a better approach than the combined FFMPEG/SOX solution.
推荐答案
有关它的价值,这的应的有可能与的 -itsoffset
和的 AMIX
过滤器,而是一个的与 -itsoffset
$ p $错误pvents它。的如果的它的工作,命令看起来是这样的:
For what it's worth, this should be possible with a combination of -itsoffset
and the amix
filter, but a bug with -itsoffset
prevents it. If it worked, the command would look something like this:
ffmpeg -i student.flv -itsoffset 3.3 -i teacher.flv -vn -filter_complex amix out.mp3
这篇关于混合音轨与SOX偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!