summaryrefslogtreecommitdiffstats
path: root/DOCS/encoding.html
diff options
context:
space:
mode:
Diffstat (limited to 'DOCS/encoding.html')
-rw-r--r--DOCS/encoding.html275
1 files changed, 140 insertions, 135 deletions
diff --git a/DOCS/encoding.html b/DOCS/encoding.html
index e5105068ac..6d71936577 100644
--- a/DOCS/encoding.html
+++ b/DOCS/encoding.html
@@ -12,6 +12,7 @@
<P><B><A NAME="encoding">2.4 Encoding with MEncoder</A></B></P>
+
<P><B><A NAME="overview">2.4.1 Overview</A></B></P>
<P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder,
@@ -22,6 +23,7 @@
<B>PCM</B>/<B>MP3</B>/<B>VBR MP3</B> audio. Also has powerful plugin system
for video manipulation.</P>
+
<P><B><A NAME="compilation">2.4.2 Compilation</A></B></P>
<UL>
@@ -55,6 +57,7 @@
<P>You are ready. As you probably know, other encoding tools need the
<I>avifile</I> library installed. <B>MEncoder</B> doesn't need it at all.</P>
+
<P><B><A NAME="features">2.4.3 MEncoder features</A></B></P>
<UL>
@@ -86,6 +89,7 @@
<LI>audio encoding from v4l (DONE for FreeBSD ?)</LI>
</UL>
+
<P><B><A NAME="2pass">2.4.3.1 Encoding 2 or 3-pass DivX4</A></B></P>
<P><U><B>2-pass encoding:</B></U> the name comes from the fact that this method
@@ -113,34 +117,34 @@
audio is encoded only once, unlike in 2-pass mode. The schematics:</P>
<TABLE>
-<TR>
- <TD> <CODE>rm frameno.avi</CODE></TD>
- <TD> <B>remove conflicting temporary file</B></TD>
-</TR>
-<TR>
- <TD> <CODE>mencoder &lt;file/DVD&gt; -ovc frameno -o
+ <TR>
+ <TD><CODE>rm frameno.avi</CODE></TD>
+ <TD><B>remove conflicting temporary file</B></TD>
+ </TR>
+ <TR>
+ <TD><CODE>mencoder &lt;file/DVD&gt; -ovc frameno -o
frameno.avi</CODE></TD>
- <TD> <B><U>First pass:</U> an audio-only avi file will be created, containing
- ONLY the requested audio stream. Don't forget <CODE>-lameopts</CODE>, if
- you need to set it. If you were encoding a long movie, MEncoder prints
- the recommended bitrate values for 650Mb, 700Mb, and 800Mb destination
- sizes, after this pass finishes.</B></TD>
-</TR>
-<TR>
- <TD> <CODE>mencoder &lt;file/DVD&gt; -oac copy -pass 1
+ <TD><B><U>First pass:</U> an audio-only avi file will be created, containing
+ ONLY the requested audio stream. Don't forget <CODE>-lameopts</CODE>, if
+ you need to set it. If you were encoding a long movie, MEncoder prints
+ the recommended bitrate values for 650Mb, 700Mb, and 800Mb destination
+ sizes, after this pass finishes.</B></TD>
+ </TR>
+ <TR>
+ <TD><CODE>mencoder &lt;file/DVD&gt; -oac copy -pass 1
-ovc divx4 -divx4opts br=&lt;bitrate&gt;</CODE></TD>
- <TD> <B><U>Second pass:</U> alias the first pass of DivX4 video encoding.
- Optionally specify the video bitrate MEncoder printed at the end of the
- previous pass.</B></TD>
-</TR>
-<TR>
- <TD> <CODE>mencoder &lt;file/DVD&gt; -oac copy -pass 2
+ <TD><B><U>Second pass:</U> alias the first pass of DivX4 video encoding.
+ Optionally specify the video bitrate MEncoder printed at the end of the
+ previous pass.</B></TD>
+ </TR>
+ <TR>
+ <TD><CODE>mencoder &lt;file/DVD&gt; -oac copy -pass 2
-ovc divx4 -divx4opts br=&lt;bitrate&gt;</CODE></TD>
- <TD> <B><U>Third pass:</U> alias the second pass of DivX4 video encoding.
- Optionally specify the video bitrate MEncoder printed at the end of the
- previous pass. In this pass, audio from <CODE>frameno.avi</CODE> will be
- inserted into the destination file.. and it's all ready!</B></TD>
-</TR>
+ <TD><B><U>Third pass:</U> alias the second pass of DivX4 video encoding.
+ Optionally specify the video bitrate MEncoder printed at the end of the
+ previous pass. In this pass, audio from <CODE>frameno.avi</CODE> will be
+ inserted into the destination file.. and it's all ready!</B></TD>
+ </TR>
</TABLE>
<P><B>Example for 3-pass encoding:</B></P>
@@ -153,8 +157,7 @@
&nbsp;&nbsp;&nbsp;&nbsp;mencoder -dvd 2
-lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 1<BR>
&nbsp;&nbsp;&nbsp;&nbsp;mencoder -dvd 2
- -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 2</CODE>
-</P>
+ -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 2</CODE></P>
<P><U><B>2 or 3-pass encoding using internal libavcodec controller:</B></U>
Optionally you can use libavcodec's internal 2 or 3-pass mode, it may give
@@ -177,6 +180,7 @@
movie.avi</CODE></LI>
</UL>
+
<P><B><A NAME="rescaling">2.4.3.2 Rescaling movies</A></B></P>
<P>Often the need to resize movie images' size emerges. Its reasons can be many,
@@ -265,8 +269,7 @@
<P><B>Explanation of the process</B></P>
<P><B>MEncoder</B> <I>decodes</I> the input image(s) with <CODE>libjpeg</CODE>
- (when decoding PNGs, it will use <B>libpng</B>).
-</P>
+ (when decoding PNGs, it will use <B>libpng</B>).</P>
<P><B>MEncoder</B> then feeds the decoded image to the chosen video compressor
(DivX4, Xvid, ffmpeg msmpeg4, etc...). Watch for the PNG decoder, as
@@ -349,116 +352,118 @@
<P>NOTE: for all available options, <B>read the man page!</B></P>
-<P>
- As <B>MEncoder</B> is built on the same codebase as <B>MPlayer</B>, there
+<P>As <B>MEncoder</B> is built on the same codebase as <B>MPlayer</B>, there
are many <B>MPlayer</B> options that have function in <B>MEncoder</B> too!
See, you can use <CODE>-sid</CODE> to rip a DVD with subtitles, or
- <CODE>-noidx</CODE> to disregard buggy index of input AVI. <B>Be smart!</B>
-</P>
+ <CODE>-noidx</CODE> to disregard buggy index of input AVI. <B>Be smart!</B></P>
<TABLE BORDER=1>
-<TR>
- <TD> <CODE>-ss</CODE> time</TD>
- <TD> start encoding from the given time (can start only from keyframes!)
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-endpos</CODE> time</TD>
- <TD> stop encoding at the given time. See the man page for examples!
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-o</CODE> filename</TD>
- <TD> specify output filename
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-sws</CODE> 0-2</TD>
- <TD> type of scaling method<BR>
- &nbsp;&nbsp;0 - fast bilinear<BR>
- &nbsp;&nbsp;1 - bilinear<BR>
- &nbsp;&nbsp;2 - bicubic (best quality)<BR>
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-ovc</CODE> codecname</TD>
- <TD> Encode with the given codec (codec names are from codecs.conf). Examples:<BR>
- &nbsp;&nbsp;<B>help</B> - get list of available codecs<BR>
- &nbsp;&nbsp;<B>rawrgb</B> - ?<BR>
- &nbsp;&nbsp;<B>copy</B> - no encoding, just copy the stream (only from AVI/ASF now)<BR>
- &nbsp;&nbsp;<B>divx4</B> - encode to DivX4<BR>
- &nbsp;&nbsp;<B>lavc</B> - encode with a codec from libavcodec<BR>
- &nbsp;&nbsp;<B>vfw</B> - encode with a Windows DLL<BR>
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-oac</CODE> codecname</TD>
- <TD> Encode with the given codec (codec names are from codecs.conf). Examples:<BR>
- &nbsp;&nbsp;<B>help</B> - get list of available codecs<BR>
- &nbsp;&nbsp;<B>copy</B> - no encoding, just copy the stream (only from AVI/ASF now)<BR>
- &nbsp;&nbsp;<B>pcm</B> - encode to uncompressed PCM<BR>
- &nbsp;&nbsp;<B>mp3lame</B> - encode to MP3 (using Lame)<BR>
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-mf</CODE> multifile options</TD>
- <TD> Used when encoding from multiple JPEG files. Its sub-options are:<BR>
- &nbsp;&nbsp;<B>on</B> - turns on multifile support<BR>
- &nbsp;&nbsp;<B>w</B>=&lt;value&gt; - width of the output file<BR>
- &nbsp;&nbsp;<B>h</B>=&lt;value&gt; - height of the output file<BR>
- &nbsp;&nbsp;<B>fps</B>=&lt;value&gt; - fps of the output file<BR>
- &nbsp;&nbsp;<B>type</B>=&lt;value&gt; - type of input files (available types: <CODE>jpeg</CODE>, <CODE>png</CODE>)<BR>
- </TD>
-</TR>
-
-<TR>
- <TD> <CODE>-divx4opts</CODE></TD>
- <TD> If encoding to DivX4, you can specify its parameters here, like:<BR>
- &nbsp;&nbsp;<CODE>-divx4opts br=1800:deinterlace:key=250</CODE><BR>
- Common options: <B>(for full list, check the man page!)</B><BR>
- &nbsp;&nbsp;<B>help</B> - get help<BR>
- &nbsp;&nbsp;<B>br</B>=&lt;value&gt; - specify bitrate in kbit &lt;4-16000&gt; or bit &lt;16001-24000000&gt;<BR>
- &nbsp;&nbsp;<B>q</B>=&lt;value&gt; - quality (1-fastest, 5-best - default 5)<BR>
- &nbsp;&nbsp;<B>key</B>=&lt;value&gt; - keyframe interval<BR>
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-lavcopts</CODE></TD>
- <TD> If encoding with libavcodec, you can specify its parameters here, like:<BR>
- &nbsp;&nbsp;<CODE>-lavcopts vcodec=msmpeg4:vbitrate=1800:vhq:keyint=250</CODE><BR>
- Common options: <B>(for full list, check the man page!)</B><BR>
- &nbsp;&nbsp;<B>help</B> - get help<BR>
- &nbsp;&nbsp;<B>vcodec</B>=&lt;value&gt; - select videocodec (for the full list, see the libavcodec section above)<BR>
- &nbsp;&nbsp;<B>vbitrate</B>=&lt;value&gt; - specify bitrate in kbit &lt;4-16000&gt; or bit &lt;16001-24000000&gt;<BR>
- &nbsp;&nbsp;<B>vhq</B> - high quality<BR>
- &nbsp;&nbsp;<B>keyint</B>=&lt;value&gt; - keyframe interval<BR>
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-lameopts</CODE></TD>
- <TD> If encoding to MP3 with libmp3lame, you can specify its parameters here, like:<BR>
- &nbsp;&nbsp;<CODE>-lameopts q=3</CODE><BR>
- &nbsp;&nbsp;<CODE>-lameopts br=192:cbr</CODE><BR>
- Common options: <B>(for full list, check the man page!)</B><BR>
- &nbsp;&nbsp;<B>help</B> - get help<BR>
- &nbsp;&nbsp;<B>cbr</B> - select <B>CBR</B> MP3 (default is <B>VBR</B>)<BR>
- &nbsp;&nbsp;<B>br</B>=&lt;value&gt; - specify bitrate in kbit &lt;0-1024&gt; (this is for <B>CBR</B> only!)<BR>
- &nbsp;&nbsp;<B>q</B>=&lt;value&gt; - quality (0-highest, 9-fastest - default 0) (this is for <B>VBR</B> only!)<BR>
- &nbsp;&nbsp;<B>vbr</B>=&lt;value&gt; - VBR sub-mode (3-ABR, best quality/speed) (this is for <B>VBR</B> only!)<BR>
- </TD>
-</TR>
-<TR>
- <TD> <CODE>-vobsubout</CODE> basename</TD>
- <TD> Specify the basename for the output <CODE>.idx</CODE> and <CODE>.sub</CODE> files. This turns off subtitle rendering on the encoded movie.</TD>
-</TR>
-<TR>
- <TD> <CODE>-vobsuboutindex</CODE> index</TD>
- <TD> Specify the index of the subtitles in the output files. Defaults to 0.</TD>
-</TR>
-<TR>
- <TD> <CODE>-vobsuboutid</CODE> langid</TD>
- <TD> Specify the language two letter code for the subtitles. This overrides what is read from the DVD or the <CODE>.ifo</CODE> file.</TD>
-</TR>
+ <TR>
+ <TD><CODE>-ss</CODE> time</TD>
+ <TD>start encoding from the given time (can start only from keyframes!)
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-endpos</CODE> time</TD>
+ <TD>stop encoding at the given time. See the man page for examples!
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-o</CODE> filename</TD>
+ <TD>specify output filename
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-sws</CODE> 0-2</TD>
+ <TD>type of scaling method<BR>
+ &nbsp;&nbsp;0 - fast bilinear<BR>
+ &nbsp;&nbsp;1 - bilinear<BR>
+ &nbsp;&nbsp;2 - bicubic (best quality)<BR>
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-ovc</CODE> codecname</TD>
+ <TD>Encode with the given codec (codec names are from codecs.conf). Examples:<BR>
+ &nbsp;&nbsp;<B>help</B> - get list of available codecs<BR>
+ &nbsp;&nbsp;<B>rawrgb</B> - ?<BR>
+ &nbsp;&nbsp;<B>copy</B> - no encoding, just copy the stream (only from AVI/ASF now)<BR>
+ &nbsp;&nbsp;<B>divx4</B> - encode to DivX4<BR>
+ &nbsp;&nbsp;<B>lavc</B> - encode with a codec from libavcodec<BR>
+ &nbsp;&nbsp;<B>vfw</B> - encode with a Windows DLL<BR>
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-oac</CODE> codecname</TD>
+ <TD>Encode with the given codec (codec names are from codecs.conf). Examples:<BR>
+ &nbsp;&nbsp;<B>help</B> - get list of available codecs<BR>
+ &nbsp;&nbsp;<B>copy</B> - no encoding, just copy the stream (only from AVI/ASF now)<BR>
+ &nbsp;&nbsp;<B>pcm</B> - encode to uncompressed PCM<BR>
+ &nbsp;&nbsp;<B>mp3lame</B> - encode to MP3 (using Lame)<BR>
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-mf</CODE> multifile options</TD>
+ <TD>Used when encoding from multiple JPEG files. Its sub-options are:<BR>
+ &nbsp;&nbsp;<B>on</B> - turns on multifile support<BR>
+ &nbsp;&nbsp;<B>w</B>=&lt;value&gt; - width of the output file<BR>
+ &nbsp;&nbsp;<B>h</B>=&lt;value&gt; - height of the output file<BR>
+ &nbsp;&nbsp;<B>fps</B>=&lt;value&gt; - fps of the output file<BR>
+ &nbsp;&nbsp;<B>type</B>=&lt;value&gt; - type of input files (available types:
+ <CODE>jpeg</CODE>, <CODE>png</CODE>)<BR>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD><CODE>-divx4opts</CODE></TD>
+ <TD>If encoding to DivX4, you can specify its parameters here, like:<BR>
+ &nbsp;&nbsp;<CODE>-divx4opts br=1800:deinterlace:key=250</CODE><BR>
+ Common options: <B>(for full list, check the man page!)</B><BR>
+ &nbsp;&nbsp;<B>help</B> - get help<BR>
+ &nbsp;&nbsp;<B>br</B>=&lt;value&gt; - specify bitrate in kbit &lt;4-16000&gt;
+ or bit &lt;16001-24000000&gt;<BR>
+ &nbsp;&nbsp;<B>q</B>=&lt;value&gt; - quality (1-fastest, 5-best - default 5)<BR>
+ &nbsp;&nbsp;<B>key</B>=&lt;value&gt; - keyframe interval<BR>
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-lavcopts</CODE></TD>
+ <TD>If encoding with libavcodec, you can specify its parameters here, like:<BR>
+ &nbsp;&nbsp;<CODE>-lavcopts vcodec=msmpeg4:vbitrate=1800:vhq:keyint=250</CODE><BR>
+ Common options: <B>(for full list, check the man page!)</B><BR>
+ &nbsp;&nbsp;<B>help</B> - get help<BR>
+ &nbsp;&nbsp;<B>vcodec</B>=&lt;value&gt; - select videocodec (for the full list, see the libavcodec section above)<BR>
+ &nbsp;&nbsp;<B>vbitrate</B>=&lt;value&gt; - specify bitrate in kbit &lt;4-16000&gt; or bit &lt;16001-24000000&gt;<BR>
+ &nbsp;&nbsp;<B>vhq</B> - high quality<BR>
+ &nbsp;&nbsp;<B>keyint</B>=&lt;value&gt; - keyframe interval<BR>
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-lameopts</CODE></TD>
+ <TD>If encoding to MP3 with libmp3lame, you can specify its parameters here, like:<BR>
+ &nbsp;&nbsp;<CODE>-lameopts q=3</CODE><BR>
+ &nbsp;&nbsp;<CODE>-lameopts br=192:cbr</CODE><BR>
+ Common options: <B>(for full list, check the man page!)</B><BR>
+ &nbsp;&nbsp;<B>help</B> - get help<BR>
+ &nbsp;&nbsp;<B>cbr</B> - select <B>CBR</B> MP3 (default is <B>VBR</B>)<BR>
+ &nbsp;&nbsp;<B>br</B>=&lt;value&gt; - specify bitrate in kbit &lt;0-1024&gt; (this is for <B>CBR</B> only!)<BR>
+ &nbsp;&nbsp;<B>q</B>=&lt;value&gt; - quality (0-highest, 9-fastest - default 0) (this is for <B>VBR</B> only!)<BR>
+ &nbsp;&nbsp;<B>vbr</B>=&lt;value&gt; - VBR sub-mode (3-ABR, best quality/speed) (this is for <B>VBR</B> only!)<BR>
+ </TD>
+ </TR>
+ <TR>
+ <TD><CODE>-vobsubout</CODE> basename</TD>
+ <TD>Specify the basename for the output <CODE>.idx</CODE> and <CODE>.sub</CODE>
+ files. This turns off subtitle rendering on the encoded movie.</TD>
+ </TR>
+ <TR>
+ <TD><CODE>-vobsuboutindex</CODE> index</TD>
+ <TD>Specify the index of the subtitles in the output files. Defaults to 0.</TD>
+ </TR>
+ <TR>
+ <TD><CODE>-vobsuboutid</CODE> langid</TD>
+ <TD>Specify the language two letter code for the subtitles. This overrides
+ what is read from the DVD or the <CODE>.ifo</CODE> file.</TD>
+ </TR>
</TABLE>
<P><B><A NAME="examples">2.4.6 Examples</A></B></P>