MEncoder is a free command line tool for video encoding and filtering. It is a sister tool of popular MPlayer video player that is also a command line tool. This small tool can convert video files between all the formats that the video player MPlayer supports. It supports multiple codecs and uses a very simple to follow command line syntax. Compared to another popular command line media conversion tool FFmpeg, MEncoder does not support as many options or features, but it is enough for some basic video encoding and decoding.
MEncoder follows a very simple syntax. In order to encode a video file input.mp4, you can give the following command:
mencoder input.mp4 -ovc lavc -oac lavc -o output.mp4
In order to specify the output file, you have to first use the -o switch and then follow it by the output file name. There are two basic things you can do in the command line to encode the video – specify the audio codec and the video codec.
In order to specify a video codec, you can use the switch -ovc and then specify one of the supported video codecs. It supports lavc, xvid, x264 or nuv video codecs. You can also specify raw as video codec to use uncompressed video frames (no codecs). You can use copy to avoid re-encoding.
The audio codecs supported by MEncoder are mp3lame, lavc, faac, toolame, and twolame. You have to specify the audio codecs using the switch -oac. If you specify pcm as the audio codec, it will not compress the audio. And if you specify copy, it will not re-encode the audio stream.
MEncoder can do much more than encoding the video files. In order to see the full expanse of MEncoder features, you can read the online documentation at http://www.mplayerhq.hu/DOCS/HTML/en/index.html (it starts from Chapter 6).
You can download MEncoder along with MPlayer from http://www.mplayerhq.hu/.