Mercurial > mplayer.hg
comparison DOCS/encoding.html @ 8133:630360b15089
Redundant compilation section removed, MEncoder features section moved to
documentation.html below MPlayer features section, sections renumbered to
reflect these changes.
author | diego |
---|---|
date | Sat, 09 Nov 2002 02:07:14 +0000 |
parents | 533e212cd282 |
children | 352b654c7787 |
comparison
equal
deleted
inserted
replaced
8132:06b20316d8cb | 8133:630360b15089 |
---|---|
10 <BODY> | 10 <BODY> |
11 | 11 |
12 | 12 |
13 <H2><A NAME="encoding">2.4 Encoding with MEncoder</A></H2> | 13 <H2><A NAME="encoding">2.4 Encoding with MEncoder</A></H2> |
14 | 14 |
15 <P>MEncoder (MPlayer's Movie Encoder) is a simple movie encoder, | 15 <P>For the complete list of available MEncoder options and examples, please see |
16 designed to encode MPlayer-playable movies | 16 the man page.</P> |
17 (<B>AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET/PVA</B>) to other | 17 |
18 MPlayer-playable formats (see below). It can encode with various codecs, like | 18 <H3><A NAME="2pass">2.4.1 Encoding 2 or 3-pass DivX4</A></H3> |
19 <B>DivX4</B> (1 or 2 passes), libavcodec, | |
20 <B>PCM</B>/<B>MP3</B>/<B>VBR MP3</B> audio. Also has powerful plugin system | |
21 for video manipulation.</P> | |
22 | |
23 | |
24 <H3><A NAME="compilation">2.4.1 Compilation</A></H3> | |
25 | |
26 <UL> | |
27 <LI><B>OPTIONAL</B> - read MPlayer's compilation instruction.</LI> | |
28 <LI><B>OPTIONAL (LINUX ONLY)</B> - download the newest <B>DivX4linux</B> libs | |
29 from <A HREF="http://avifile.sourceforge.net/download.htm">avifile.sourceforge.net</A>, | |
30 and have them PROPERLY installed. You need them if you want DivX4 | |
31 (1/2 pass) encoding.</LI> | |
32 <LI><B>OPTIONAL</B> - <A HREF="codecs.html#xvid">download and install | |
33 <B>XViD</B></A>. Not very useful, libavcodec's <I>mpeg4</I> codec | |
34 can encode with much better speed AND quality than XViD or DivX4/5.</LI> | |
35 <LI><B>OPTIONAL</B> - for libavcodec support, install libavcodec as | |
36 described in the <A HREF="codecs.html#libavcodec">libavcodec section</A>.</LI> | |
37 <LI><B>OPTIONAL</B> - download and compile <B>libmp3lame</B> (from lame 3.89beta or lame CVS).<BR> | |
38 <B>WARNING: DO NOT COMPILE LAME < 3.90 WITH <U>GCC 2.96</U>! It won't | |
39 work properly!</B><BR> | |
40 This | |
41 is needed for CBR/VBR MP3 audio encoding ability. Note that a single | |
42 <CODE>lame</CODE> binary isn't sufficient. BTW: the less optimization | |
43 you use for lame, the better the quality will be. You can test | |
44 quality by running <CODE>make test</CODE> after lame's compiling process | |
45 is over. The resulting number should be less than <B>30</B>. Don't | |
46 panic if it's <B>400</B> or so, you shouldn't heard any audible | |
47 quality decrease. Oh, and if your compiler doesn't even run | |
48 <CODE>make test</CODE> ... Well, delete that <B>GCC 2.96</B> or upgrade | |
49 lame to at least <B>3.90</B>.</LI> | |
50 <LI><B>OPTIONAL</B> - <CODE>libjpeg</CODE> and <CODE>libpng</CODE> - | |
51 as described in the <A HREF="documentation.html#installation">Installation</A> | |
52 section</LI> | |
53 </UL> | |
54 | |
55 <P>You are ready. As you probably know, other encoding tools need the | |
56 <I>avifile</I> library installed. MEncoder doesn't need it at all.</P> | |
57 | |
58 | |
59 <H3><A NAME="features">2.4.2 MEncoder features</A></H3> | |
60 | |
61 <UL> | |
62 <LI>encoding from the wide range of fileformats and decoders of MPlayer</LI> | |
63 <LI>encoding to all the codecs of ffmpeg's | |
64 <A HREF="codecs.html#libavcodec">libavcodec</A></LI> | |
65 <LI>video encoding from <B>V4L compatible TV tuners</B></LI> | |
66 <LI>encoding/multiplexing to interleaved AVI files with proper index</LI> | |
67 <LI>creating files from external audio stream</LI> | |
68 <LI>1, 2 or 3 pass encoding</LI> | |
69 <LI><B>VBR</B> MP3 audio - <B>IMPORTANT NOTE:</B> VBR MP3 audio doesn't | |
70 always play nicely on Windows players! On the other hand, currently | |
71 MEncoder's CBR encoding is totally broken on Win32 players :)</LI> | |
72 <LI>PCM audio</LI> | |
73 <LI>stream copying</LI> | |
74 <LI>input A/V synchronizing (PTS-based, can be disabled with -mc 0 option)</LI> | |
75 <LI>FPS correction with <CODE>-ofps</CODE> option (useful when encoding | |
76 29.97fps VOB to 24fps AVI)</LI> | |
77 <LI>using our very powerful plugin system (crop, expand, flip, postprocess, | |
78 rotate, scale, rgb/yuv conversion)</LI> | |
79 <LI>can encode DVD/VOBsub <B>AND</B> text subtitles into the output file</LI> | |
80 <LI>can rip DVD subtitles to Vobsub format</LI> | |
81 </UL> | |
82 | |
83 <H4>Planned features:</H4> | |
84 | |
85 <UL> | |
86 <LI>even wider variety of available en/decoding formats/codecs | |
87 (creating VOB files with DivX4/Indeo5/VIVO streams :)</LI> | |
88 <LI>audio encoding from v4l (DONE for FreeBSD ?)</LI> | |
89 </UL> | |
90 | |
91 | |
92 <H4><A NAME="2pass">2.4.2.1 Encoding 2 or 3-pass DivX4</A></H4> | |
93 | 19 |
94 <P><U><B>2-pass encoding:</B></U> the name comes from the fact that this method | 20 <P><U><B>2-pass encoding:</B></U> the name comes from the fact that this method |
95 encodes the file <I>twice</I>. The first encoding (dubbed <I>pass</I>) | 21 encodes the file <I>twice</I>. The first encoding (dubbed <I>pass</I>) |
96 creates some temporary files (*.log) with a size of few megabytes, do not | 22 creates some temporary files (*.log) with a size of few megabytes, do not |
97 delete them yet (you can delete the AVI). In the second pass, the 2-pass | 23 delete them yet (you can delete the AVI). In the second pass, the 2-pass |
172 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o | 98 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o |
173 movie.avi</CODE></LI> | 99 movie.avi</CODE></LI> |
174 </UL> | 100 </UL> |
175 | 101 |
176 | 102 |
177 <H4><A NAME="rescaling">2.4.2.2 Rescaling movies</A></H4> | 103 <H3><A NAME="rescaling">2.4.2 Rescaling movies</A></H3> |
178 | 104 |
179 <P>Often the need to resize movie images' size emerges. Its reasons can be many, | 105 <P>Often the need to resize movie images' size emerges. Its reasons can be many, |
180 examples are decreasing output file size, encoding SVCDs to DivX. Ripped DVDs | 106 examples are decreasing output file size, encoding SVCDs to DivX. Ripped DVDs |
181 are mostly rescaled, for example a 4:3 DVD should be 640x480, especially | 107 are mostly rescaled, for example a 4:3 DVD should be 640x480, especially |
182 when you want it to fit to 1 CD, and have good quality at the same time. | 108 when you want it to fit to 1 CD, and have good quality at the same time. |
194 <CODE> mencoder sample-svcd.mpg -ovc lavc -lavcopts | 120 <CODE> mencoder sample-svcd.mpg -ovc lavc -lavcopts |
195 vcodec=mpeg4:more_options -vop scale=640:480 -oac copy -o | 121 vcodec=mpeg4:more_options -vop scale=640:480 -oac copy -o |
196 output.avi</CODE></P> | 122 output.avi</CODE></P> |
197 | 123 |
198 | 124 |
199 <H4><A NAME="copying">2.4.2.3 Stream copying</A></H4> | 125 <H3><A NAME="copying">2.4.3 Stream copying</A></H3> |
200 | 126 |
201 <P>MEncoder can handle input streams in two ways: <B>encode</B> or | 127 <P>MEncoder can handle input streams in two ways: <B>encode</B> or |
202 <B>copy</B> them. This section is about <B>copying</B>.</P> | 128 <B>copy</B> them. This section is about <B>copying</B>.</P> |
203 | 129 |
204 <UL> | 130 <UL> |
215 into the output stream. Use the <CODE>-audiofile <filename></CODE> | 141 into the output stream. Use the <CODE>-audiofile <filename></CODE> |
216 option for this.</LI> | 142 option for this.</LI> |
217 </UL> | 143 </UL> |
218 | 144 |
219 | 145 |
220 <H4><A NAME="fixing">2.4.2.4 Fixing AVIs with broken index or interleaving</A></H4> | 146 <H3><A NAME="fixing">2.4.4 Fixing AVIs with broken index or interleaving</A></H3> |
221 | 147 |
222 <P>Easiest thing. We simply copy the video and audio streams, and | 148 <P>Easiest thing. We simply copy the video and audio streams, and |
223 MEncoder generates the index. Of course this cannot fix possible bugs | 149 MEncoder generates the index. Of course this cannot fix possible bugs |
224 in the video and/or audio streams. It also fixes files with broken | 150 in the video and/or audio streams. It also fixes files with broken |
225 interleaving, thus the <CODE>-ni</CODE> option won't be needed for them | 151 interleaving, thus the <CODE>-ni</CODE> option won't be needed for them |
226 anymore.</P> | 152 anymore.</P> |
227 | 153 |
228 <P>Command: <CODE>mencoder -idx input.avi -ovc copy -oac copy -o output.avi</CODE></P> | 154 <P>Command: <CODE>mencoder -idx input.avi -ovc copy -oac copy -o output.avi</CODE></P> |
229 | 155 |
230 | 156 |
231 <H4><A NAME="libavcodec">2.4.2.5 Encoding with the libavcodec codec family</A></H4> | 157 <H3><A NAME="libavcodec">2.4.5 Encoding with the libavcodec codec family</A></H3> |
232 | 158 |
233 <P><A HREF="codecs.html#libavcodec">libavcodec</A> provides simple encoding to a | 159 <P><A HREF="codecs.html#libavcodec">libavcodec</A> provides simple encoding to a |
234 lot of interesting video and audio formats (currently its audio codecs are | 160 lot of interesting video and audio formats (currently its audio codecs are |
235 unsupported). You can encode to the following codecs:</P> | 161 unsupported). You can encode to the following codecs:</P> |
236 | 162 |
251 <P>An example, with MJPEG compression:<BR> | 177 <P>An example, with MJPEG compression:<BR> |
252 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc | 178 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc |
253 -lavcopts vcodec=mjpeg -oac copy</CODE></P> | 179 -lavcopts vcodec=mjpeg -oac copy</CODE></P> |
254 | 180 |
255 | 181 |
256 <H4><A NAME="image_files">2.4.2.6 Encoding from multiple input image files (JPEGs, PNGs or TGAs)</A></H4> | 182 <H3><A NAME="image_files">2.4.6 Encoding from multiple input image files (JPEGs, PNGs or TGAs)</A></H3> |
257 | 183 |
258 <P>MEncoder is capable of creating movies from one or more JPEG, PNG or TGA | 184 <P>MEncoder is capable of creating movies from one or more JPEG, PNG or TGA |
259 files. With simple framecopy it can create MJPEG (Motion JPEG), MPNG | 185 files. With simple framecopy it can create MJPEG (Motion JPEG), MPNG |
260 (Motion PNG) or MTGA (Motion TGA) files.</P> | 186 (Motion PNG) or MTGA (Motion TGA) files.</P> |
261 | 187 |
299 <P><I>Creating a Motion TGA (MTGA) file from all the TGA files in the current dir:</I><BR> | 225 <P><I>Creating a Motion TGA (MTGA) file from all the TGA files in the current dir:</I><BR> |
300 <CODE>mencoder \*.tga -mf on:w=800:h=600:fps=25:type=tga -ovc copy | 226 <CODE>mencoder \*.tga -mf on:w=800:h=600:fps=25:type=tga -ovc copy |
301 -oac copy -o output.avi</CODE></P> | 227 -oac copy -o output.avi</CODE></P> |
302 | 228 |
303 | 229 |
304 <H4><A NAME="vobsub">2.4.2.7 Extracting DVD subtitles to Vobsub file</A></H4> | 230 <H3><A NAME="vobsub">2.4.7 Extracting DVD subtitles to a Vobsub file</A></H3> |
305 | 231 |
306 <P>MEncoder is capable of extracting subtitles from a DVD into | 232 <P>MEncoder is capable of extracting subtitles from a DVD into |
307 Vobsub fomat files. They consist of a pair of files ending in | 233 Vobsub fomat files. They consist of a pair of files ending in |
308 <CODE>.idx</CODE> and <CODE>.sub</CODE> and are usually packaged in a single | 234 <CODE>.idx</CODE> and <CODE>.sub</CODE> and are usually packaged in a single |
309 <CODE>.rar</CODE> archive. MPlayer can play these with the | 235 <CODE>.rar</CODE> archive. MPlayer can play these with the |
340 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> | 266 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> |
341 <CODE>mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles | 267 <CODE>mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles |
342 -vobsuboutindex 0 -vobsuboutid fr -sid 1</CODE></P> | 268 -vobsuboutindex 0 -vobsuboutid fr -sid 1</CODE></P> |
343 | 269 |
344 | 270 |
345 <H3><A NAME="options">2.4.3 Available options</A></H3> | |
346 | |
347 <P>For the complete list of available MEncoder options and examples, | |
348 please see the man page.</P> | |
349 | |
350 </BODY> | 271 </BODY> |
351 </HTML> | 272 </HTML> |