Saturday, January 22, 2011

Video file manipulation

Many times I have downloaded a movie and when opened it is in French or Russian or any other language I do not know. Most people outright delete the file. I thought no. In most of the cases the video quality is superb while it is difficult to find  the same movie in english with the same quality. The reason is obvious. However, as it turns out that the big uncle does not care about the prints in English which are very low quality. So, I thought that I can download them, extract their audio and plug the mp3 into the audio track of the high quality print in different language. And here's how to do it. These methods work only in Linux (sorry Windows users).

To extract audio from avi(or mpg) file :

ffmpeg -i file.avi -acodec copy output.mp3

acodec does a direct copy of the audio track without involving any encoding into mp3.

To add the audio to avi file :

Open avidemux and load the video file (with nn-english audio). Say yes to all pop-ups. Then goto the menu Audio-> Main track -> external file -> select your file i.e. output.mp3 .

Change the audio drop-down box (below video in left hand side) from COPY to MP3(LAME).

Save the file with a different name.

more recipes coming up ....

No comments:

Print chess board in command line

The following bash one-liner will print a chess board in a terminal (the script works for the shells bash and ksh only) for (( i = 1; i ...