From ASP.Net, I use FFMPEG to convert FLV files on Flash Media Server to wavs, which I need to mix into a single MP3 file. At first I tried to fully use FFMPEG, but in the end I refused the mixing stage, because I do not consider it possible to combine audio tracks in only one result file. I would like to be wrong.
Now I use FFMPEG to access FLV files and extract the audio track in wav so that SOX can mix them. The problem is that I have to compensate for one of the audio tracks for a few seconds so that they sync. Each file represents half the conversation between student and teacher. For example, teacher.wav might need to start 3.3 seconds after student.wav. I can only understand how to mix files with SOX, where both tracks start at the same time.
My best attempt at this point:
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 selected based on my best research, but are not required. Any working solution will allow ASP.Net to introduce two FMS flvs and create a combined MP3 using open or free tools.
EDIT: I was able to compensate for the files using the delay switch in SOX.
sox -M student.wav teacher.wav combined.mp3 delay 2.8
I leave the question open if anyone has a better approach than the FFMPEG / SOX combined solution.
source share