Tuesday, January 22, 2013

Converting OGV files to AVI on Linux

Recently when I was presenting a research work I wanted to show a video on how to do it practically. For this purpose I used Record My Desktop tool. However the video output from this tool were in OGV file format which is not that commonly used outside Linux environments. Therefore I wanted to convert these video files in OGV format to some commonly used video file format.

After searching on the web I found that the command line tool mencoder can be used to convert between different video file formats. It seems this tool comes as a support program for the video player called MPlayer. Therefore when we do "man mencoder" in the terminal, the manual pages gives details about both Mencoder tool and MPlayer.

For example consider we have file called my_video.ogv and we need to convert it to the AVI format so that the resulting file should be my_video.avi. We do the conversion by issuing the following command with the given parameters.

mencoder my_video.ogv -o my_video.avi -oac mp3lame -lameopts fast:preset=standard -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=4000

I have no clear understanding on what each parameter represent in the command. However this is the way I found it in the web somewhere.