Sunday, June 2, 2013

Adding / Injecting Audio Track to Video Without Audio

Suppose you have a video file and that video has no sound. You have a separate audio Mp3 file which is of same length (same play time) as video file and you want to inject / add that audio file to video file. How it can be done?

It can be done by using mencoder, is a encoder for popular MPlayer.

To Add / inject audio file into video file, please following the following instructions.

Step-1: Install mencoder using following command
             $sudo apt-get install mencoder.

Step-2: Move audio file and video without audio file into same folder
             $mv myAudio.mp3 /home/myhome/InjectAudo/
             $mv myVideo.avi /home/myhome/InjectAudo/

Step-3: Run following commands to add/ inject audio into video
             $cd /home/myhome/InjectAudo/
             $mencoder -ovc copy -audiofile myAudio.mp3 -oac copy myVideo.avi -o OutPutAVFile.avi

Step-4: Play OutPutAVFile.avi file.

No comments:

Post a Comment