Mix Audio tracks with offset in SOX

旧时模样 提交于 2019-12-04 13:43:17

问题


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.

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

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.

EDIT: I was able to offset the files using the delay switch in SOX.

sox -M student.wav teacher.wav combined.mp3 delay 2.8

I'm leaving the question open in case someone has a better approach than the combined FFMPEG/SOX solution.


回答1:


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



回答2:


mixing can be pretty simple: how to mix two audio channels?




回答3:


well i suggest you should use flash. it may sounds weird, correct me if im wrong but with Flash's new multimedia abilities you can mix a couple tracks.

im not sure, but i'm just trying to help you, theese 2 link can help you for your aim (specially second link i guess);

http://3d2f.com/programs/25-187-swf-to-mp3-converter-download.shtml

http://blog.debit.nl/2009/02/mp3-to-swf-converter-in-actionscript-3/



来源:https://stackoverflow.com/questions/4588998/mix-audio-tracks-with-offset-in-sox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!