Audio and video codecs for encoding are selected with the -oac and -ovc options, respectively. Type for instance:
mencoder -ovc helpto list all video codecs supported by the version of MEncoder on your machine. The following choices are available:
Audio Codecs:
Audio codec name | Description |
---|---|
mp3lame | Encode to VBR, ABR or CBR MP3 with LAME |
lavc | Use one of libavcodec's audio codecs |
faac | FAAC AAC audio encoder |
toolame | MPEG Audio Layer 2 encoder |
twolame | MPEG Audio Layer 2 encoder based on tooLAME |
pcm | Uncompressed PCM audio |
copy | Do not reencode, just copy compressed frames |
Video codecs:
Video codec name | Description |
---|---|
lavc | Use one of libavcodec's video codecs |
xvid | XviD, MPEG-4 Advanced Simple Profile (ASP) codec |
x264 | x264, MPEG-4 Advanced Video Coding (AVC), AKA H.264 codec |
nuv | nuppel video, used by some realtime applications |
raw | Uncompressed video frames |
copy | Do not reencode, just copy compressed frames |
frameno | Used for 3-pass encoding (not recommended) |
Output container formats are selected with the -of option. Type:
mencoder -of helpto list all containers supported by the version of MEncoder on your machine. The following choices are available:
Container formats:
Container format name | Description |
---|---|
lavf | One of the containers supported by libavformat |
avi | Audio-Video Interleaved |
mpeg | MPEG-1 and MPEG-2 PS |
rawvideo | raw video stream (no muxing - one video stream only) |
rawaudio | raw audio stream (no muxing - one audio stream only) |
libavformat containers:
If you selected libavformat to do the muxing of the output file (by using the -of lavf), the appropriate container format will be determined by the file extension of the output file. You may force a particular container format with libavformat's format option.
libavformat container name | Description |
---|---|
mpg | MPEG-1 and MPEG-2 PS |
asf | Advanced Streaming Format |
avi | Audio-Video Interleaved |
wav | Waveform Audio |
swf | Macromedia Flash |
flv | Macromedia Flash video |
rm | RealMedia |
au | SUN AU |
nut | NUT open container (experimental and not yet spec-compliant) |
mov | QuickTime |
mp4 | MPEG-4 format |
dv | Sony Digital Video container |
Example:
Creating a Macromedia Flash video suitable for playback in a web browser with the Macromedia Flash plugin:
mencoder input.avi -o output.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc \ -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 \ -srate 22050