Mercurial > mplayer.hg
comparison DOCS/encoding.html @ 3438:963b39283f48
fixes, and some new stuff. sorry forgot :)
author | gabucino |
---|---|
date | Mon, 10 Dec 2001 17:37:18 +0000 |
parents | 7f06ef6c0168 |
children | 66e418645b67 |
comparison
equal
deleted
inserted
replaced
3437:ae0e2736a5d4 | 3438:963b39283f48 |
---|---|
3 | 3 |
4 <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> | 4 <FONT face="Verdana, Arial, Helvetica, sans-serif" size=2> |
5 | 5 |
6 <P><B><A NAME=2.4>2.4. Encoding with MEncoder</A></B></P> | 6 <P><B><A NAME=2.4>2.4. Encoding with MEncoder</A></B></P> |
7 | 7 |
8 <P><B><I>Overview</I></B> | 8 <A NAME=2.4.1><P><B><I>Overview</I></B> |
9 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, | 9 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, |
10 designed to encode MPlayer-playable movies | 10 designed to encode MPlayer-playable movies |
11 (<B>AVI/DVD/VCD/VOB/MPG/MOV/VIV/NET</B>) to other MPlayer-playable formats (see | 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 | 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 | 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 | 14 copying abilities. In the future, there will be cropping, resizing filters, and |
15 other interesting stuff.</P> | 15 other interesting stuff.</P> |
16 | 16 |
17 <P><B><I>Compiling</I></B> | 17 <A NAME=2.4.2><P><B><I>Compiling</I></B> |
18 <UL> | 18 <UL> |
19 <LI>read <B>MPlayer</B>'s compilation instructions, it contains info about | 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> | 20 how to install <I>libdvdread</I> for <B>DVD</B> support, etc.</LI> |
21 <LI>download the newest <B>DivX4linux</B> libs | 21 <LI>download the newest <B>DivX4linux</B> libs |
22 from <A HREF="http://avifile.sourceforge.net/download.htm">avifile.sourceforge.net</A>, | 22 from <A HREF="http://avifile.sourceforge.net/download.htm">avifile.sourceforge.net</A>, |
41 </P> | 41 </P> |
42 | 42 |
43 <P>You are ready. As you probably know, other encoding tools need the | 43 <P>You are ready. As you probably know, other encoding tools need the |
44 <I>avifile</I> library installed. <B>MEncoder</B> doesn't need it at all.</P> | 44 <I>avifile</I> library installed. <B>MEncoder</B> doesn't need it at all.</P> |
45 | 45 |
46 <P><B><I>MEncoder features</I></B> : | 46 <A NAME=2.4.3><P><B><I>MEncoder features</I></B> : |
47 <UL> | 47 <UL> |
48 <LI>encoding from the wide range of fileformats and decoders of <B>MPlayer</B></LI> | 48 <LI>encoding from the wide range of fileformats and decoders of <B>MPlayer</B></LI> |
49 <LI>encoding from <B>V4L compatible TV tuners</B></LI> | 49 <LI>encoding from <B>V4L compatible TV tuners</B></LI> |
50 <LI>encoding/multiplexing to interleaved AVI files with proper index</LI> | 50 <LI>encoding/multiplexing to interleaved AVI files with proper index</LI> |
51 <LI>1 or 2 pass <B>DivX4</B> video</LI> | 51 <LI>1 or 2 pass <B>DivX4</B> video</LI> |
52 <LI><B>VBR</B> MP3 audio</LI> | 52 <LI><B>VBR</B> MP3 audio</LI> |
53 <LI>PCM audio</LI> | 53 <LI>PCM audio</LI> |
54 <LI>stream copying (only from AVI/ASF now, and CBR audio only)</LI> | 54 <LI>stream copying (CBR audio only)</LI> |
55 <LI>input A/V synchronizing (PTS-based, can be disabled with -mc 0 option)</LI> | 55 <LI>input A/V synchronizing (PTS-based, can be disabled with -mc 0 option)</LI> |
56 <LI>FPS correction with <CODE>-ofps</CODE> option (useful when encoding | 56 <LI>FPS correction with <CODE>-ofps</CODE> option (useful when encoding |
57 29.97fps VOB to 24fps AVI)</LI> | 57 29.97fps VOB to 24fps AVI)</LI> |
58 <LI>movie rescaling</LI> | |
58 </UL> | 59 </UL> |
59 </P> | 60 </P> |
60 | 61 |
61 <P><B><I>Planned features</I></B> : | 62 <P><B><I>Planned features</I></B> : |
62 <UL> | 63 <UL> |
65 <LI>even wider variety of available en/decoding formats/codecs | 66 <LI>even wider variety of available en/decoding formats/codecs |
66 (creating VOB files with DivX4/Indeo5/VIVO streams :)</LI> | 67 (creating VOB files with DivX4/Indeo5/VIVO streams :)</LI> |
67 </UL> | 68 </UL> |
68 </P> | 69 </P> |
69 | 70 |
70 <P><B><I>Encoding 2-pass DivX4</I></B></P> | 71 <A NAME=2.4.3.1><P><B><I>Encoding 2-pass DivX4</I></B></P> |
71 | 72 |
72 <P>The name comes from the fact that this method encodes the file <I>twice</I>. | 73 <P>The name comes from the fact that this method encodes the file <I>twice</I>. |
73 The first encoding (dubbed <I>pass</I>) creates some temporary files with a | 74 The first encoding (dubbed <I>pass</I>) creates some temporary files with a |
74 size of few megabytes (do not delete them yet). In the second pass, the output | 75 size of few megabytes (do not delete them yet). In the second pass, the output |
75 file is created, using the bitrate data from the temporary file. The resulting | 76 file is created, using the bitrate data from the temporary file. The resulting |
80 commands are needed :<BR> | 81 commands are needed :<BR> |
81 <CODE> mencoder -dvd 2 -ovc divx4 -oac mp3lame -divx4opts br=1100 | 82 <CODE> mencoder -dvd 2 -ovc divx4 -oac mp3lame -divx4opts br=1100 |
82 -o movie.avi -pass 1<BR> | 83 -o movie.avi -pass 1<BR> |
83 mencoder -dvd 2 -ovc divx4 -oac mp3lame -divx4opts br=1100 -o movie.avi -pass 2</CODE></P> | 84 mencoder -dvd 2 -ovc divx4 -oac mp3lame -divx4opts br=1100 -o movie.avi -pass 2</CODE></P> |
84 | 85 |
85 <P><B><I>Syntax</I></B></P> | 86 <A NAME=2.4.3.2><P><B><I>Rescaling movies</I></B></P> |
86 | 87 |
87 <P> <CODE>mencoder [options] <input file> [options] ...</P> | 88 <P>Often the need to resize movie images' size emerges. Its reasons can be many, |
88 | 89 examples are decreasing output file size, encoding SVCDs to DivX. Ripped DVDs |
89 <P><B><I>Available options</I></B></P> | 90 are mostly rescaled, for example a 4:3 DVD should be 640x480, especially |
91 when you want it to fit to 1 CD, and have good quality at the same time. | |
92 SVCDs have 480x480 size, and their header contains the aspect ratio the | |
93 player should use (Ex.: 480x480 + 4:3 = 640x480). However when encoding to | |
94 AVI (DivX) files, you have be aware that AVI headers don't store this | |
95 value. Thus, the only solution is rescaling.</P> | |
96 | |
97 <P>The output size is specified with the <CODE>-x</CODE>, and <CODE>-y</CODE> | |
98 options. Furthermore, there are 3 rescaling filters in <B>MEncoder</B>, <I>0 | |
99 : fast 1 : bilinear</I>, <I>2 : bilinear</I>, <I>bicubic</I> (best quality). | |
100 They can be specified with the <CODE>-sws</CODE> option. If not specified, | |
101 <B>MEncoder</B> will use 0 : fast bilinear.</P> | |
102 | |
103 <P>Rescaling is very simple :<BR> | |
104 <CODE> mencoder sample-svcd.mpg -divx4opts br=1300 -x 640 -y 480 -sws 2 -o output.avi</CODE></P> | |
105 | |
106 <A NAME=2.4.3.3><P><B><I>Stream copying</I></B></P> | |
107 | |
108 <P><B>MEncoder</B> can handle input streams in two ways : <B>encode</B> or | |
109 <B>copy</B> them. This section is about <B>copying</B>.</P> | |
110 | |
111 <P> | |
112 <UL> | |
113 <LI><B>Video stream</B> (option <CODE>-ovc copy</CODE>) : nice stuff can be done :)<BR> | |
114 Like, putting (not converting!) FLI or VIVO or MPEG1 video into an AVI file ! | |
115 Of course only <B>MPlayer</B> can play such files :) And it probably has no | |
116 real life value at all. Rationally : video stream copying can be useful for | |
117 example when only the audio stream has to be encoded (like, uncompressed PCM | |
118 to MP3).</LI> | |
119 | |
120 <LI><B>Audio stream</B> (option <CODE>-oac copy</CODE>) : straightforward.</LI> | |
121 </UL> | |
122 </P> | |
123 | |
124 <A NAME=2.4.4><P><B><I>Syntax</I></B></P> | |
125 | |
126 <P> <CODE>mencoder [options] [input file] [options] ...</P> | |
127 | |
128 <A NAME=2.4.5><P><B><I>Available options</I></B></P> | |
90 | 129 |
91 <P>NOTE : for all available options, <B>read the manpage !</B></P> | 130 <P>NOTE : for all available options, <B>read the manpage !</B></P> |
92 | 131 |
93 <TABLE BORDER=0> | 132 <TABLE BORDER=0> |
94 <TR> | 133 <TR> |
185 <B>q</B>=XXXX - quality (0-highest, 9-fastest - default 0) (this is for <B>VBR</B> only!)<BR> | 224 <B>q</B>=XXXX - quality (0-highest, 9-fastest - default 0) (this is for <B>VBR</B> only!)<BR> |
186 </TD> | 225 </TD> |
187 </TR> | 226 </TR> |
188 </TABLE> | 227 </TABLE> |
189 | 228 |
190 <P><B><I>Examples</I></B></P> | 229 <A NAME=2.4.6><P><B><I>Examples</I></B></P> |
191 | 230 |
192 <P>Using <B>MEncoder</B> is the easiest thing on Earth. See the following :</P> | 231 <P>Using <B>MEncoder</B> is the easiest thing on Earth. See the following :</P> |
193 | 232 |
194 <P>Encoding from DVD, title 2 :<BR> | 233 <P>Encoding from DVD, title 2 :<BR> |
195 <CODE> mencoder -dvd 2 -o title2.avi</CODE></P> | 234 <CODE> mencoder -dvd 2 -o title2.avi</CODE></P> |
235 | |
236 <P>Encoding from DVD, title 2, with rescaling :<BR> | |
237 <CODE> mencoder -dvd 2 -x 640 -y 480 -sws 2 -o title2.avi</CODE></P> | |
196 | 238 |
197 <P>Encoding from HTTP :<BR> | 239 <P>Encoding from HTTP :<BR> |
198 <CODE> mencoder http://mplayer.hq/example.avi -o example.avi</CODE></P> | 240 <CODE> mencoder http://mplayer.hq/example.avi -o example.avi</CODE></P> |
199 | 241 |
200 <P>Encoding from a pipe :<BR> | 242 <P>Encoding from a pipe :<BR> |