From 5461fc33baed9455a39b7ae1a4793a330251758c Mon Sep 17 00:00:00 2001
From: gabucino MEncoder (MPlayer's Movie Encoder) is a simple movie encoder,
-designed to encode MPlayer-playable movies
-(AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET) to other MPlayer-playable
-formats (see below). It can encode with various codecs, like DivX4 (1 or
-2 passes), libavcodec, PCM/MP3/VBRMP3 audio. Also has
-powerful plugin system for video manipulation.
You are ready. As you probably know, other encoding tools need the -avifile library installed. MEncoder doesn't need it at all.
+ avifile library installed. MEncoder doesn't need it at all. @@ -71,7 +72,7 @@ powerful plugin system for video manipulation.-ofps
option (useful when encoding
- 29.97fps VOB to 24fps AVI)2.4.3.1 Encoding 2 or 3-pass DivX4
-2-pass encoding: 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.
+2-pass encoding: 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.
This example shows how to encode a DVD to a 2-pass DivX4 AVI. Just two
-commands are needed:
- rm frameno.avi
- remove this file, which
- can come from a previous 3-pass encoding (it interferes with current one)
- mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options
- -o movie.avi -pass 1
- mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options -o movie.avi -pass 2
rm frameno.avi
- remove this file, which
+ can come from a previous 3-pass encoding (it interferes with current
+ one) mencoder -dvd 2 -lavcopts
+ -vcodec=mpeg4:more_options -o movie.avi -pass 1
+ mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options
+ -o movie.avi -pass 2
3-pass encoding: this is an extension of 2-pass encoding,
where the audio encoding takes place in a separate pass. This method enables
@@ -143,29 +148,33 @@ commands are needed:
rm frameno.avi
- remove this file,
which can come from a previous 3-pass encoding (it interferes with current
one)
- mencoder -dvd 2 -ovc frameno
- -o frameno.avi
- mencoder -dvd 2
- -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 1
+
- mencoder -dvd 2
- -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 2 mencoder -dvd 2 -ovc frameno
+ -o frameno.avi
+ mencoder -dvd 2
+ -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 1
+ mencoder -dvd 2
+ -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 2
2 or 3-pass encoding using internal libavcodec controller: -Optionally you can use libavcodec's internal 2 or 3-pass mode, it may gives you -better final rate accuracy than using the external, DivX4-inspired 2-pass rate -controler with libavcodec.
+ Optionally you can use libavcodec's internal 2 or 3-pass mode, it may give + you better final rate accuracy than using the external, DivX4-inspired 2-pass + rate controler with libavcodec.rm -f lavc_stats.txt
-mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 (audio-options) -o movie.avi
-mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 (audio-options) -o movie.avi
rm -f frameno.avi lavc_stats.txt
-mencoder -dvd 2 -ovc frameno (audio-options) -o frameno.avi
-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
rm -f lavc_stats.txt
+ mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 (audio-options) -o
+ movie.avi
+ mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 (audio-options) -o
+ movie.avi
rm -f frameno.avi lavc_stats.txt
+ mencoder -dvd 2 -ovc frameno (audio-options) -o frameno.avi
+ 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
Usage:
- mencoder sample-svcd.mpg -lavcopts vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o output.avi
mencoder sample-svcd.mpg -lavcopts
+ vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o
+ output.avi
@@ -194,26 +205,28 @@ mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi<
copy them. This section is about copying.
-ovc copy
): nice stuff can be done :)-ovc copy
): nice stuff can be
+ done :)-oac copy
): straightforward.
- It is possible to take an external audio file (MP3, AC3, Vorbis) and mux it
- into the output stream. Use the -audiofile <filename>
- option for this.-audiofile <filename>
+ option for this.
2.4.3.4 Fixing AVIs with broken index or interleaving
Easiest thing. We simply copy the video and audio streams, and
-MEncoder generates the index. Of course this cannot fix possible bugs in
-the video and/or audio streams. It also fixes files with broken interleaving,
-thus the -ni
option won't be needed for them anymore.
-ni
option won't be needed for them
+ anymore.
Command: mencoder -idx input.avi -ovc copy -oac copy -o output.avi
-ni
option won't be needed for them anymore.
2.4.3.5 Encoding with the libavcodec codec family
libavcodec provides simple encoding to a -lot of interesting video and audio formats (currently its audio codecs are -unsupported). You can encode to the following codecs:
+ lot of interesting video and audio formats (currently its audio codecs are + unsupported). You can encode to the following codecs:vcodec
config, like: -lavcopts vcodec=msmpeg4
An example, with MJPEG compression:
- mencoder -dvd 2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg
mencoder -dvd 2 -o title2.avi -ovc lavc
+ -lavcopts vcodec=mjpeg
2.4.3.6 Encoding from multiple input image files (JPEGs or PNGs)
@@ -288,38 +302,42 @@ unsupported). You can encode to the following codecs:2.4.3.7 Extracting DVD subtitles to Vobsub file
MEncoder is capable of extracting subtitles from a DVD into
-Vobsub fomat files. They consist of a pair of files ending in .idx
-and .sub
and are usually packaged in a single .rar
-archive. MPlayer can play these with the -vobsub
and
--vobsubid
options.
.idx
and .sub
and are usually packaged in a single
+ .rar
archive. MPlayer can play these with the
+ -vobsub
and -vobsubid
options.
You specify the basename (i.e without the .idx
or
-.sub
extension) of the output files with -vobsubout
-and the index for this subtitle in the resulting files with
--vobsuboutindex
.
.sub
extension) of the output files with -vobsubout
+ and the index for this subtitle in the resulting files with
+ -vobsuboutindex
.
If the input is not from a DVD you should use -ifo
to
-indicate the .ifo
file needed to construct the resulting
-.idx
file.
.ifo
file needed to construct the resulting
+ .idx
file.
-If the input is not from a DVD and you do not have the .ifo
file
-you will need to use the -vobsubid
option to let it know what
-language id to put in the .idx
file.
If the input is not from a DVD and you do not have the .ifo
+ file you will need to use the -vobsubid
option to let it know
+ what language id to put in the .idx
file.
Each run will append the running subtitle if the .idx
and
-.sub
files already exist. So you should remove any before starting.
.sub
files already exist. So you should remove any before
+ starting.
Examples
Copying two subtitles from a DVD while doing 3-pass encoding
- rm subtitles.idx subtitles.sub
- mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0 -sid 2 -o frameno.avi -ovc frameno
- mencoder -dvd 1 -oac copy -ovc divx4 -pass 1
- mencoder -dvd 1 -oac copy -ovc divx4 -pass 2 -vobsubout subtitles -vobsuboutindex 1 -sid 5
rm subtitles.idx subtitles.sub
mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0
+ -sid 2 -o frameno.avi -ovc frameno
mencoder -dvd 1 -oac copy -ovc divx4 -pass 1
mencoder -dvd 1 -oac copy -ovc divx4 -pass 2 -vobsubout
+ subtitles -vobsuboutindex 1 -sid 5
Copying a french subtitle from an MPEG file
- rm subtitles.idx subtitles.sub
- mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 -vobsuboutid fr -sid 1
rm subtitles.idx subtitles.sub
mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles
+ -vobsuboutindex 0 -vobsuboutid fr -sid 1
@@ -468,8 +486,7 @@ language id to put in the .idx
file.
Encoding from tuner (for tuner options see the TV input section!):
mencoder -tv on:driver=v4l:width=640:height=480 <options>
For all available options, check the MEncoder man page! -
+
For all available options, check the MEncoder man page!