Mercurial > mplayer.hg
annotate DOCS/encoding.html @ 2907:33c720ea4654
*** empty log message ***
| author | gabucino |
|---|---|
| date | Wed, 14 Nov 2001 22:07:34 +0000 |
| parents | 632032ff27bf |
| children | 53d168c38d29 |
| rev | line source |
|---|---|
| 2674 | 1 <HTML> |
| 2 <BODY BGCOLOR=white> | |
| 3 | |
| 4 <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 5 | |
| 2745 | 6 <P><B><A NAME=2.4>2.4. Encoding with MEncoder</A></B></P> |
| 2674 | 7 |
| 8 <P><B><I>Overview</I></B> | |
| 9 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, | |
| 10 designed to encode MPlayer-playable movies | |
| 11 (<B>AVI/DVD/VCD/VOB/MPG/MOV/VIV/NET</B>) to other MPlayer-playable formats (see | |
| 12 below). Currently it's in beta stage, and encodes only to <B>DivX4</B> (1 or 2 | |
| 13 passes) video, <B>PCM</B>/<B>MP3</B>/<B>VBRMP3</B> audio. Also has stream | |
| 14 copying abilities. In the future, there will be cropping, resizing filters, and | |
| 15 other interesting stuff.</P> | |
| 16 | |
| 17 <P><B><I>Compiling</I></B> | |
| 18 <UL> | |
| 19 <LI>read <B>MPlayer</B>'s compilation instructions, it contains info about | |
| 20 how to install <I>libdvdread</I> for <B>DVD</B> support, etc.</LI> | |
| 21 <LI>download the newest <B>DivX4linux</B> libs | |
| 22 from <A HREF="http://avifile.sourceforge.net/download.htm">avifile.sourceforge.net</A>, | |
| 23 and have them PROPERLY installed. This is needed for DivX4 (1/2 pass) | |
| 24 encoding.</LI> | |
| 25 <LI>download and install <B>libmp3lame</B> (from lame 3.89beta or lame CVS). This | |
| 26 is needed for CBR/VBR MP3 audio encoding ability. Note that a single | |
| 27 <CODE>lame</CODE> binary isn't sufficient.</LI> | |
| 28 <LI>use <CODE>./configure</CODE> with optional parameters as usual, and | |
|
2848
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
29 type : <CODE>make mencoder</CODE> , then <CODE>make install</CODE> . |
| 2674 | 30 </UL> |
| 31 </P> | |
| 32 | |
| 33 <P>You are ready. As you probably know, other encoding tools need the | |
| 34 <I>avifile</I> library installed. <B>MEncoder</B> doesn't need it at all.</P> | |
| 35 | |
| 36 <P><B><I>MEncoder features</I></B> : | |
| 37 <UL> | |
| 2868 | 38 <LI>encoding from the wide range of fileformats and decoders of <B>MPlayer</B></LI> |
| 39 <LI>encoding from <B>V4L compatible TV tuners</B></LI> | |
| 2674 | 40 <LI>encoding/multiplexing to interleaved AVI files with proper index</LI> |
| 41 <LI>1 or 2 pass <B>DivX4</B> video</LI> | |
| 42 <LI><B>VBR</B> MP3 audio</LI> | |
| 43 <LI>PCM audio</LI> | |
| 44 <LI>stream copying (only from AVI/ASF now, and CBR audio only)</LI> | |
| 45 <LI>input A/V synchronizing (PTS-based, can be disabled with -mc 0 option)</LI> | |
| 46 <LI>FPS correction with <CODE>-ofps</CODE> option (useful when encoding | |
| 47 29.97fps VOB to 24fps AVI)</LI> | |
| 48 </UL> | |
| 49 </P> | |
| 50 | |
| 51 <P><B><I>Planned features</I></B> : | |
| 52 <UL> | |
| 53 <LI>using audio from separate file (AC3, MP3, OGG)</LI> | |
| 54 <LI>VBR audio stream copy</LI> | |
| 55 <LI>even wider variety of available en/decoding formats/codecs | |
| 56 (creating VOB files with DivX4/Indeo5/VIVO streams :)</LI> | |
| 57 </UL> | |
| 58 </P> | |
| 59 | |
|
2848
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
60 <P><B><I>Encoding 2-pass DivX4</I></B></P> |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
61 |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
62 <P>The name comes from the fact that this method encodes the file <I>twice</I>. |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
63 The first encoding (dubbed <I>pass</I>) creates a temporary file with a size |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
64 of few megabytes. In the second pass, the output file is created, using the |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
65 bitrate data from the temporary file. The resulting file will have much |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
66 better image quality. If this is the first time you heard about this, you |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
67 should consult some guides available on the Net.</P> |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
68 |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
69 <P>This example shows how to encode a DVD to a 2-pass DivX4 AVI. Just two |
|
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
70 commands are needed :<BR> |
| 2907 | 71 <CODE> mencoder -dvd 2 -ovc divx4 -oac mp3lame -divx4opts br=1100 |
|
2848
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
72 -o movie.avi -pass 1<BR> |
| 2907 | 73 mencoder -dvd 2 -ovc divx4 -oac mp3lame -divx4opts br=1100 -o movie.avi -pass 2</CODE></P> |
| 2868 | 74 |
| 75 <P><B><I>Syntax</I></B></P> | |
| 76 | |
| 77 <P> <CODE>mencoder [options] <input file> [options] ...</P> | |
| 78 | |
| 79 <P><B><I>Available options</I></B></P> | |
| 80 | |
| 81 <P>NOTE : for all available options, <B>read the manpage !</B></P> | |
| 82 | |
| 83 <TABLE BORDER=0> | |
| 84 <TR> | |
| 85 <TD> </TD> | |
| 86 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 87 <I>-o</I> filename</TD> | |
| 88 <TD> </TD> | |
| 89 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 90 specify output filename | |
| 91 </TD> | |
| 92 </TR> | |
| 93 <TR> | |
| 94 <TD> </TD> | |
| 95 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 96 <I>-ovc</I> codecname</TD> | |
| 97 <TD> </TD> | |
| 98 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 99 Encode with the given codec (codec names are from codecs.conf). Examples:<BR> | |
| 100 <B>help</B> - get list of available codecs<BR> | |
| 101 <B>copy</B> - no encoding, just copy the stream (only from AVI/ASF now)<BR> | |
| 102 <B>divx4</B> - encode to DivX4<BR> | |
| 103 </TD> | |
| 104 </TR> | |
| 105 <TR> | |
| 106 <TD> </TD> | |
| 107 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 108 <I>-oac</I> codecname</TD> | |
| 109 <TD> </TD> | |
| 110 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 111 Encode with the given codec (codec names are from codecs.conf). Examples:<BR> | |
| 112 <B>help</B> - get list of available codecs<BR> | |
| 113 <B>copy</B> - no encoding, just copy the stream (only from AVI/ASF now)<BR> | |
| 114 <B>pcm</B> - encode to uncompressed PCM<BR> | |
| 115 <B>mp3lame</B> - encode to MP3 (using Lame)<BR> | |
| 116 </TD> | |
| 117 </TR> | |
| 118 <TR> | |
| 119 <TD> </TD> | |
| 120 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 121 <I>-divx4opts</I></TD> | |
| 122 <TD> </TD> | |
| 123 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 124 If encoding to DivX4, you can specify its parameters here, like:<BR> | |
| 125 <CODE>-divx4opts br=1800:deinterlace:key=250</CODE><BR> | |
| 126 Common options: <B>(for full list, check the manpage!)</B><BR> | |
| 127 <B>help</B> - get help<BR> | |
| 128 <B>br</B>=XXX - specify bitrate in kbit <4-16000> or bit <16001-24000000><BR> | |
| 129 <B>q</B>=XXXX - quality (1-fastest, 5-best - default 5)<BR> | |
| 130 </TD> | |
| 131 </TR> | |
| 132 <TR> | |
| 133 <TD> </TD> | |
| 134 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 135 <I>-lameopts</I></TD> | |
| 136 <TD> </TD> | |
| 137 <TD><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | |
| 138 If encoding to MP3 with libmp3lame, you can specify its parameters here, like:<BR> | |
| 139 <CODE>-lameopts q=3</CODE><BR> | |
| 140 <CODE>-lameopts br=192:cbr</CODE><BR> | |
| 141 Common options: <B>(for full list, check the manpage!)</B><BR> | |
| 142 <B>help</B> - get help<BR> | |
| 143 <B>cbr</B> - select <B>CBR</B> MP3 (default is <B>VBR</B>)<BR> | |
| 144 <B>br</B>=XXX - specify bitrate in kbit <0-1024> (this is for <B>CBR</B> only!)<BR> | |
| 145 <B>q</B>=XXXX - quality (0-highest, 9-fastest - default 0) (this is for <B>VBR</B> only!)<BR> | |
| 146 </TD> | |
| 147 </TR> | |
| 148 </TABLE> | |
|
2848
33c32f3d9f1f
many small updates, fixes (some/more to be completed soon)
gabucino
parents:
2745
diff
changeset
|
149 |
| 2674 | 150 <P><B><I>Examples</I></B></P> |
| 151 | |
| 152 <P>Using <B>MEncoder</B> is the easiest thing on Earth. See the following :</P> | |
| 153 | |
| 154 <P>Encoding from DVD, title 2 :<BR> | |
| 155 <CODE> mencoder -dvd 2 -o title2.avi</CODE></P> | |
| 156 | |
| 157 <P>Encoding from HTTP :<BR> | |
| 158 <CODE> mencoder http://mplayer.hq/example.avi -o example.avi</CODE></P> | |
| 159 | |
|
2874
632032ff27bf
patch applied from Colin Marquardt <colin@marquardt-home.de>
gabucino
parents:
2868
diff
changeset
|
160 <P>Encoding from a pipe :<BR> |
| 2674 | 161 <CODE> rar p test-SVCD.rar | mencoder -divx4opts br=800 -ofps 24 -pass 1 -- -</CODE></P> |
| 162 | |
|
2874
632032ff27bf
patch applied from Colin Marquardt <colin@marquardt-home.de>
gabucino
parents:
2868
diff
changeset
|
163 <P>Encoding multiple *.vob files :<BR> |
|
632032ff27bf
patch applied from Colin Marquardt <colin@marquardt-home.de>
gabucino
parents:
2868
diff
changeset
|
164 <CODE> cat *.vob | mencoder <options> -</CODE></P> |
|
632032ff27bf
patch applied from Colin Marquardt <colin@marquardt-home.de>
gabucino
parents:
2868
diff
changeset
|
165 |
| 2674 | 166 <P>For all available options, <B><I>check the MEncoder man page !</I></B> |
| 167 <P> | |
| 168 </FONT> | |
| 169 </BODY> | |
| 170 </HTML> |
