‘Let’s have a look at a rather simple mencoder command that should create a WMP-compatible MPEG file:
[rechosen@localhost ~]$ mencoder
-oac lavc -ovc lavc -lavcopts acodec=mp2:vcodec=mpeg2video:mbd=1:vbitrate=1800 -of mpeg -o
Replace “
” with the video source (for example a file or a DVD scene) and “
Note that the above example will try to encode the movie at the same resolution and fps as the source. However, this does not always work correctly and also isn’t always what you want. Furthermore, the above example doesn’t use two-pass encoding. Two-pass encoding is useful because it results in a higher quality outputfile with about the same size (it needs to read the source twice, though).
A more feature-rich example
The next example features rescaling (adapting the resolution), specifies a framerate for the outputfile and encodes in two passes.
[rechosen@localhost ~]$ for i in {1,2}; do mencoder
-oac lavc -ovc lavc -lavcopts acodec=mp2:vcodec=mpeg2video:mbd=1:vpass=$i:vbitrate=1800 -of mpeg -ofps 25 -vf scale=640:480 -o
Replace “
” with any source that can be read twice (a file or a DVD scene) and “
One more handy trick: you can set only the width of the encoded video and let mencoder determine the height, keeping the right aspect ratio:
[rechosen@localhost ~]$ for i in {1,2}; do mencoder
-oac lavc -ovc lavc -lavcopts acodec=mp2:vcodec=mpeg2video:mbd=1:vpass=$i:vbitrate=1800 -of mpeg -ofps 25 -vf scale -zoom -xy 640 -o
Again, replace “
” with any source that can be read twice (a file or a DVD scene) and “

