If you need to squeeze a DVD into a 700MB XviD file, you could use the following command, which forces the file size of the resulting AVI to 700MB.: You can use whatever bitrate option you want. Mencoder dvd:// -oac mp3lame -ovc xvid -xvidencopts pass=2:bitrate=800 -o xvidfile.avi Mencoder dvd:// -oac mp3lame -ovc xvid -xvidencopts pass=1 -o /dev/null By using two passes you can produce a better compressed file, but you’ll have to wait a little longer for it, and you’ll probably see CPU usage at 90% during the conversion: During the first pass, mencoder analyzes the content of the file on the second pass mencoder encodes the new file based on the information obtained. Now let’s get fancy and make an XviD copy of a DVD using two passes. The higher the bitrate, the better quality the video file will be. Mencoder -ovc xvid -oac mp3lame -xvidencopts bitrate=878 -o destination.avi source.avi If you need customized quality, you can add a few options to the XviD compression: Mencoder -ovc xvid -oac mp3lame -o destination.avi source.avi You can use xvid or divx directly, without going through lavc: With that option, the frames will be copied one by one from the source file. If you don’t want to use video compression, try vcodec=copy. Mencoder file.mpg -o file.avi -ovc lavc -oac lavc -lavcopts acodec=libmp3lame:abitrate=128 vcodec=xvid You can do the same thing with the video part of the file: Where q can be any number between 0 and 9. Mencoder file -o file.avi -ovc lavc -oac mp3lame -lameopts vbr=2:q=3 You can also create files with variable bit rate audio compression: You can use lameopts if you have libmp3lame installed and want to add extra options to the encoding process. Mencoder file.mpg -o file.avi -ovc lavc -oac lavc -lavcopts acodec=libmp3lame:abitrate=128 When it comes to MP3 compression, you can also choose a bitrate using abitrate: Mencoder file.mpg -o file.avi -ovc lavc -oac lavc -lavcopts acodec=pcm You can specify the type of audio codec you want by using the acodec option: Suppose you need a file with no compression on the audio part and decide to use PCM. To find out what video codecs are installed on your system, use mencoder -ovc help and mencoder -oac help. ovc and -oac represent the options for the video and audio codecs that mencoder will use. Mencoder file.mpg -o file.avi -ovc lavc -oac lavc Here’s a simple command that converts an MPG file to AVI format: There’s little mencoder can’t do when it comes to multimedia conversion.
The command syntax is straightforward despite a wealth of options. Here’s how.Īmong the file types mencoder can handle are MPEG/VOB, AVI, ASF/WMA/WMV, RM, QT/MOV/MP4, Ogg/OGM, MKV, VIVO, FLI, and FLV. The application has a ton of graphical user interfaces, but you can use it from the command line to produce video files in almost any format you want. While MPlayer can play audio and video files, mencoder converts and manages multimedia files. Mencoder is part of the MPlayer media player package.