Fejezet 7. Encoding with MEncoder

Tartalom
Encoding 2-pass MPEG-4 ("DivX")
Encoding to MPEG format
Rescaling movies
Stream copying
Fixing AVIs with broken index or interleaving
Encoding with the libavcodec codec family
Encoding from multiple input image files (JPEG, PNG, TGA, SGI)
Extracting DVD subtitles to VOBsub file
Preserving aspect ratio
Custom inter/intra matrices
Making a high quality MPEG-4 ("DivX") rip of a DVD movie
How to deal with telecine and interlacing within NTSC DVDs

For the complete list of available MEncoder options and examples, please see the man page. For a series of hands-on examples and detailed guides on using several encoding parameters, read the encoding-tips that were collected from several mailing list threads on mplayer-users. Search the archives for a wealth of discussions about all aspects of and problems related to encoding with MEncoder.

Encoding 2-pass MPEG-4 ("DivX")

The name comes from the fact that this method encodes the file twice. The first encoding (dubbed pass) creates some temporary files (*.log) with a size of few megabytes, do not delete them yet (you can delete the AVI). In the second pass, the 2-pass output file is created, using the bitrate data from the temporary files. The resulting file will have much better image quality. If this is the first time you heard about this, you should consult some guides available on the net.

Példa 7-1. copy audio track

2-pass encode of a DVD to an MPEG-4 ("DivX") AVI while copying the audio track.


mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi
mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi

Példa 7-2. encode audio track

2-pass encode of a DVD to an MPEG-4 ("DivX") AVI while encoding the audio track to MP3.


mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac mp3lame -lameopts vbr=3 -o movie.avi
mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac mp3lame -lameopts vbr=3 -o movie.avi