Mercurial > mplayer.hg
comparison DOCS/encoding.html @ 6906:3274d0725fde
Changed all link names from the section number to a sensible label.
Section numbers were 2.3.2.1. in the section names and 2.3.2.1 in the TOC.
I settled for the former everywhere. "Misc OS" is now called "Ports".
Checked all internal links, some of them were falsely pointing to renumbered
sections. This should no longer happen.
And in case some of you think "This must have been a lot of work!", that
does not even begin to describe it...
author | diego |
---|---|
date | Sun, 04 Aug 2002 22:13:09 +0000 |
parents | f3f87f6bf5cf |
children | 87deea511b1f |
comparison
equal
deleted
inserted
replaced
6905:e32d3d0d8998 | 6906:3274d0725fde |
---|---|
8 </HEAD> | 8 </HEAD> |
9 | 9 |
10 <BODY> | 10 <BODY> |
11 | 11 |
12 | 12 |
13 <P><B><A NAME=2.4>2.4. Encoding with MEncoder</A></B></P> | 13 <P><B><A NAME="encoding">2.4 Encoding with MEncoder</A></B></P> |
14 | 14 |
15 <P><B><A NAME=2.4.1>2.4.1. Overview</A></B></P> | 15 <P><B><A NAME="overview">2.4.1 Overview</A></B></P> |
16 | 16 |
17 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, | 17 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, |
18 designed to encode MPlayer-playable movies | 18 designed to encode MPlayer-playable movies |
19 (<B>AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET</B>) to other MPlayer-playable | 19 (<B>AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET</B>) to other MPlayer-playable |
20 formats (see below). It can encode with various codecs, like <B>DivX4</B> (1 or | 20 formats (see below). It can encode with various codecs, like <B>DivX4</B> (1 or |
21 2 passes), libavcodec, <B>PCM</B>/<B>MP3</B>/<B>VBRMP3</B> audio. Also has | 21 2 passes), libavcodec, <B>PCM</B>/<B>MP3</B>/<B>VBRMP3</B> audio. Also has |
22 powerful plugin system for video manipulation.</P> | 22 powerful plugin system for video manipulation.</P> |
23 | 23 |
24 <P><B><A NAME=2.4.2>2.4.2. Compiling</A></B></P> | 24 <P><B><A NAME="compilation">2.4.2 Compilation</A></B></P> |
25 | 25 |
26 <UL> | 26 <UL> |
27 <LI><B>OPTIONAL</B> - read <B>MPlayer</B>'s compilation instruction.</LI> | 27 <LI><B>OPTIONAL</B> - read <B>MPlayer</B>'s compilation instruction.</LI> |
28 <LI><B>OPTIONAL (LINUX ONLY)</B> - download the newest <B>DivX4linux</B> libs | 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>, | 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 | 30 and have them PROPERLY installed. You need them if you want DivX4 |
31 (1/2 pass) encoding.</LI> | 31 (1/2 pass) encoding.</LI> |
32 <LI><B>OPTIONAL</B> - <A HREF="codecs.html#2.2.1.9">download and install | 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 | 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> | 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 | 35 <LI><B>OPTIONAL</B> - for libavcodec support, install libavcodec as |
36 described in the <A HREF="codecs.html#2.2.1.2">libavcodec section</A>.</LI> | 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> | 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 | 38 <B>WARNING: DO NOT COMPILE LAME < 3.90 WITH <U>GCC 2.96</U>! It won't |
39 work properly!</B><BR> | 39 work properly!</B><BR> |
40 This | 40 This |
41 is needed for CBR/VBR MP3 audio encoding ability. Note that a single | 41 is needed for CBR/VBR MP3 audio encoding ability. Note that a single |
45 is over. The resulting number should be less than <B>30</B>. Don't | 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 | 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 <CODE>make test</CODE> ... | 47 quality decrease. Oh, and if your compiler doesn't even run <CODE>make test</CODE> ... |
48 Well, delete that <B>GCC 2.96</B> or upgrade lame to at least <B>3.90</B>.</LI> | 48 Well, delete that <B>GCC 2.96</B> or upgrade lame to at least <B>3.90</B>.</LI> |
49 <LI><B>OPTIONAL</B> - <CODE>libjpeg</CODE> and <CODE>libpng</CODE> - | 49 <LI><B>OPTIONAL</B> - <CODE>libjpeg</CODE> and <CODE>libpng</CODE> - |
50 as described in the <A HREF="documentation.html#1.3">Installation</A> | 50 as described in the <A HREF="documentation.html#installation">Installation</A> |
51 section</LI> | 51 section</LI> |
52 </UL> | 52 </UL> |
53 | 53 |
54 <P>You are ready. As you probably know, other encoding tools need the | 54 <P>You are ready. As you probably know, other encoding tools need the |
55 <I>avifile</I> library installed. <B>MEncoder</B> doesn't need it at all.</P> | 55 <I>avifile</I> library installed. <B>MEncoder</B> doesn't need it at all.</P> |
56 | 56 |
57 <P><B><A NAME=2.4.3>2.4.3. MEncoder features</A></B></P> | 57 <P><B><A NAME="features">2.4.3 MEncoder features</A></B></P> |
58 | 58 |
59 <UL> | 59 <UL> |
60 <LI>encoding from the wide range of fileformats and decoders of <B>MPlayer</B></LI> | 60 <LI>encoding from the wide range of fileformats and decoders of <B>MPlayer</B></LI> |
61 <LI>encoding to all the codecs of ffmpeg's | 61 <LI>encoding to all the codecs of ffmpeg's |
62 <A HREF="codecs.html#2.2.1.2">libavcodec</A></LI> | 62 <A HREF="codecs.html#libavcodec">libavcodec</A></LI> |
63 <LI>video encoding from <B>V4L compatible TV tuners</B></LI> | 63 <LI>video encoding from <B>V4L compatible TV tuners</B></LI> |
64 <LI>encoding/multiplexing to interleaved AVI files with proper index</LI> | 64 <LI>encoding/multiplexing to interleaved AVI files with proper index</LI> |
65 <LI>creating files from external audio stream</LI> | 65 <LI>creating files from external audio stream</LI> |
66 <LI>1, 2 or 3 pass <B>DivX4</B> video</LI> | 66 <LI>1, 2 or 3 pass <B>DivX4</B> video</LI> |
67 <LI><B>VBR</B> MP3 audio - <B>IMPORTANT NOTE:</B> VBR MP3 audio doesn't | 67 <LI><B>VBR</B> MP3 audio - <B>IMPORTANT NOTE:</B> VBR MP3 audio doesn't |
83 <LI>even wider variety of available en/decoding formats/codecs | 83 <LI>even wider variety of available en/decoding formats/codecs |
84 (creating VOB files with DivX4/Indeo5/VIVO streams :)</LI> | 84 (creating VOB files with DivX4/Indeo5/VIVO streams :)</LI> |
85 <LI>audio encoding from v4l (DONE for FreeBSD ?)</LI> | 85 <LI>audio encoding from v4l (DONE for FreeBSD ?)</LI> |
86 </UL> | 86 </UL> |
87 | 87 |
88 <P><B><A NAME=2.4.3.1>2.4.3.1. Encoding 2 or 3-pass DivX4</A></B></P> | 88 <P><B><A NAME="2pass">2.4.3.1 Encoding 2 or 3-pass DivX4</A></B></P> |
89 | 89 |
90 <P><U><B>2-pass encoding:</B></U> the name comes from the fact that this method encodes the file <I>twice</I>. | 90 <P><U><B>2-pass encoding:</B></U> the name comes from the fact that this method encodes the file <I>twice</I>. |
91 The first encoding (dubbed <I>pass</I>) creates some temporary files (*.log) with a | 91 The first encoding (dubbed <I>pass</I>) creates some temporary files (*.log) with a |
92 size of few megabytes, do not delete them yet (you can delete the AVI). In the second pass, the | 92 size of few megabytes, do not delete them yet (you can delete the AVI). In the second pass, the |
93 2-pass output file is created, using the bitrate data from the temporary files. The resulting | 93 2-pass output file is created, using the bitrate data from the temporary files. The resulting |
166 mencoder -dvd 2 -ovc frameno (audio-options) -o frameno.avi<BR> | 166 mencoder -dvd 2 -ovc frameno (audio-options) -o frameno.avi<BR> |
167 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi<BR> | 167 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi<BR> |
168 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi</CODE></LI> | 168 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi</CODE></LI> |
169 </UL> | 169 </UL> |
170 | 170 |
171 <P><B><A NAME=2.4.3.2>2.4.3.2. Rescaling movies</A></B></P> | 171 <P><B><A NAME="rescaling">2.4.3.2 Rescaling movies</A></B></P> |
172 | 172 |
173 <P>Often the need to resize movie images' size emerges. Its reasons can be many, | 173 <P>Often the need to resize movie images' size emerges. Its reasons can be many, |
174 examples are decreasing output file size, encoding SVCDs to DivX. Ripped DVDs | 174 examples are decreasing output file size, encoding SVCDs to DivX. Ripped DVDs |
175 are mostly rescaled, for example a 4:3 DVD should be 640x480, especially | 175 are mostly rescaled, for example a 4:3 DVD should be 640x480, especially |
176 when you want it to fit to 1 CD, and have good quality at the same time. | 176 when you want it to fit to 1 CD, and have good quality at the same time. |
186 | 186 |
187 <P>Usage:<BR> | 187 <P>Usage:<BR> |
188 <CODE> mencoder sample-svcd.mpg -lavcopts vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o output.avi</CODE></P> | 188 <CODE> mencoder sample-svcd.mpg -lavcopts vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o output.avi</CODE></P> |
189 | 189 |
190 | 190 |
191 <P><B><A NAME=2.4.3.3>2.4.3.3. Stream copying</A></B></P> | 191 <P><B><A NAME="copying">2.4.3.3 Stream copying</A></B></P> |
192 | 192 |
193 <P><B>MEncoder</B> can handle input streams in two ways: <B>encode</B> or | 193 <P><B>MEncoder</B> can handle input streams in two ways: <B>encode</B> or |
194 <B>copy</B> them. This section is about <B>copying</B>.</P> | 194 <B>copy</B> them. This section is about <B>copying</B>.</P> |
195 | 195 |
196 <UL> | 196 <UL> |
206 into the output stream. Use the <CODE>-audiofile <filename></CODE> | 206 into the output stream. Use the <CODE>-audiofile <filename></CODE> |
207 option for this.</LI> | 207 option for this.</LI> |
208 </UL> | 208 </UL> |
209 | 209 |
210 | 210 |
211 <P><B><A NAME=2.4.3.4>2.4.3.4. Fixing AVIs with broken index or interleaving</A></B></P> | 211 <P><B><A NAME="fixing">2.4.3.4 Fixing AVIs with broken index or interleaving</A></B></P> |
212 | 212 |
213 <P>Easiest thing. We simply copy the video and audio streams, and | 213 <P>Easiest thing. We simply copy the video and audio streams, and |
214 <B>MEncoder</B> generates the index. Of course this cannot fix possible bugs in | 214 <B>MEncoder</B> generates the index. Of course this cannot fix possible bugs in |
215 the video and/or audio streams. It also fixes files with broken interleaving, | 215 the video and/or audio streams. It also fixes files with broken interleaving, |
216 thus the <CODE>-ni</CODE> option won't be needed for them anymore.</P> | 216 thus the <CODE>-ni</CODE> option won't be needed for them anymore.</P> |
217 | 217 |
218 <P>Command: <CODE>mencoder -idx input.avi -ovc copy -oac copy -o output.avi</CODE></P> | 218 <P>Command: <CODE>mencoder -idx input.avi -ovc copy -oac copy -o output.avi</CODE></P> |
219 | 219 |
220 | 220 |
221 <P><B><A NAME=2.4.3.5>2.4.3.5. Encoding with the <I>libavcodec</I> codec family</A></B></P> | 221 <P><B><A NAME="libavcodec">2.4.3.5 Encoding with the libavcodec codec family</A></B></P> |
222 | 222 |
223 <P><A HREF="codecs.html#2.2.1.2">libavcodec</A> provides simple encoding to a | 223 <P><A HREF="codecs.html#libavcodec">libavcodec</A> provides simple encoding to a |
224 lot of interesting video and audio formats (currently its audio codecs are | 224 lot of interesting video and audio formats (currently its audio codecs are |
225 unsupported). You can encode to the following codecs:</P> | 225 unsupported). You can encode to the following codecs:</P> |
226 | 226 |
227 <UL> | 227 <UL> |
228 <LI>mjpeg - Motion JPEG</LI> | 228 <LI>mjpeg - Motion JPEG</LI> |
240 | 240 |
241 <P>An example, with MJPEG compression:<BR> | 241 <P>An example, with MJPEG compression:<BR> |
242 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg</CODE></P> | 242 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg</CODE></P> |
243 | 243 |
244 | 244 |
245 <P><B><A NAME=2.4.3.6>2.4.3.6. Encoding from multiple input image files (JPEGs or PNGs)</A></B></P> | 245 <P><B><A NAME="image_files">2.4.3.6 Encoding from multiple input image files (JPEGs or PNGs)</A></B></P> |
246 | 246 |
247 <P><B>MEncoder</B> is capable of creating movies from one or more JPEG or PNG | 247 <P><B>MEncoder</B> is capable of creating movies from one or more JPEG or PNG |
248 files. With simple framecopy it can create MJPEG (Motion JPEG) or MPNG | 248 files. With simple framecopy it can create MJPEG (Motion JPEG) or MPNG |
249 (Motion PNG) files.</P> | 249 (Motion PNG) files.</P> |
250 | 250 |
260 that require YUV as input, like DivX4 or ffmpeg's msmpeg4.</P> | 260 that require YUV as input, like DivX4 or ffmpeg's msmpeg4.</P> |
261 | 261 |
262 <P><B>Examples</B></P> | 262 <P><B>Examples</B></P> |
263 | 263 |
264 <P>The explanation of the <CODE>-mf</CODE> option can be found below in the | 264 <P>The explanation of the <CODE>-mf</CODE> option can be found below in the |
265 global <A HREF="#2.4.5">Options</A> section and in the man page.</P> | 265 global <A HREF="#options">Options</A> section and in the man page.</P> |
266 | 266 |
267 <P><I>Creating a DivX4 file from all the JPEG files in the current dir:</I><BR> | 267 <P><I>Creating a DivX4 file from all the JPEG files in the current dir:</I><BR> |
268 <CODE>mencoder \*.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -o | 268 <CODE>mencoder \*.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -o |
269 output.avi</CODE></P> | 269 output.avi</CODE></P> |
270 | 270 |
283 <P><I>Creating a Motion PNG (MPNG) file from all the PNG files in the current dir:</I><BR> | 283 <P><I>Creating a Motion PNG (MPNG) file from all the PNG files in the current dir:</I><BR> |
284 <CODE>mencoder \*.png -mf on:w=800:h=600:fps=25:type=png -ovc copy | 284 <CODE>mencoder \*.png -mf on:w=800:h=600:fps=25:type=png -ovc copy |
285 -o output.avi</CODE></P> | 285 -o output.avi</CODE></P> |
286 | 286 |
287 | 287 |
288 <P><B><A NAME=2.4.3.7>2.4.3.7. Extracting DVD subtitles to Vobsub file</A></B></P> | 288 <P><B><A NAME="vobsub">2.4.3.7 Extracting DVD subtitles to Vobsub file</A></B></P> |
289 | 289 |
290 <P><B>MEncoder</B> is capable of extracting subtitles from a DVD into | 290 <P><B>MEncoder</B> is capable of extracting subtitles from a DVD into |
291 Vobsub fomat files. They consist of a pair of files ending in <CODE>.idx</CODE> | 291 Vobsub fomat files. They consist of a pair of files ending in <CODE>.idx</CODE> |
292 and <CODE>.sub</CODE> and are usually packaged in a single <CODE>.rar</CODE> | 292 and <CODE>.sub</CODE> and are usually packaged in a single <CODE>.rar</CODE> |
293 archive. <B>MPlayer</B> can play these with the <CODE>-vobsub</CODE> and | 293 archive. <B>MPlayer</B> can play these with the <CODE>-vobsub</CODE> and |
320 <P><I>Copying a french subtitle from an MPEG file</I><BR> | 320 <P><I>Copying a french subtitle from an MPEG file</I><BR> |
321 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> | 321 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> |
322 <CODE>mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 -vobsuboutid fr -sid 1</CODE></P> | 322 <CODE>mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 -vobsuboutid fr -sid 1</CODE></P> |
323 | 323 |
324 | 324 |
325 <P><B><A NAME=2.4.4>2.4.4. Syntax</A></B></P> | 325 <P><B><A NAME="syntax">2.4.4 Syntax</A></B></P> |
326 | 326 |
327 <P> <CODE>mencoder [options] [input file] [options] ...</CODE></P> | 327 <P> <CODE>mencoder [options] [input file] [options] ...</CODE></P> |
328 | 328 |
329 | 329 |
330 <P><B><A NAME=2.4.5>2.4.5. Available options</A></B></P> | 330 <P><B><A NAME="options">2.4.5 Available options</A></B></P> |
331 | 331 |
332 <P>NOTE: for all available options, <B>read the man page!</B></P> | 332 <P>NOTE: for all available options, <B>read the man page!</B></P> |
333 | 333 |
334 <P> | 334 <P> |
335 As <B>MEncoder</B> is built on the same codebase as <B>MPlayer</B>, there | 335 As <B>MEncoder</B> is built on the same codebase as <B>MPlayer</B>, there |
441 <TD> <CODE>-vobsuboutid</CODE> langid</TD> | 441 <TD> <CODE>-vobsuboutid</CODE> langid</TD> |
442 <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> | 442 <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> |
443 </TR> | 443 </TR> |
444 </TABLE> | 444 </TABLE> |
445 | 445 |
446 <P><B><A NAME=2.4.6>2.4.6. Examples</A></B></P> | 446 <P><B><A NAME="examples">2.4.6 Examples</A></B></P> |
447 | 447 |
448 <P>Using <B>MEncoder</B> is the easiest thing on Earth. See the following:</P> | 448 <P>Using <B>MEncoder</B> is the easiest thing on Earth. See the following:</P> |
449 | 449 |
450 <P>Encoding from DVD, title 2:<BR> | 450 <P>Encoding from DVD, title 2:<BR> |
451 <CODE> mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options -o title2.avi</CODE></P> | 451 <CODE> mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options -o title2.avi</CODE></P> |
463 <CODE> rar p test-SVCD.rar | mencoder -lavcopts vcodec=mpeg4:more_options -ofps 24 -pass 1 -- -</CODE></P> | 463 <CODE> rar p test-SVCD.rar | mencoder -lavcopts vcodec=mpeg4:more_options -ofps 24 -pass 1 -- -</CODE></P> |
464 | 464 |
465 <P>Encoding multiple *.vob files:<BR> | 465 <P>Encoding multiple *.vob files:<BR> |
466 <CODE> cat *.vob | mencoder <options> -</CODE></P> | 466 <CODE> cat *.vob | mencoder <options> -</CODE></P> |
467 | 467 |
468 <P>Encoding from tuner (for tuner options <A HREF="documentation.html#2.5">see the TV input section!</A>):<BR> | 468 <P>Encoding from tuner (for tuner options <A HREF="documentation.html#tv">see the TV input section!</A>):<BR> |
469 <CODE> mencoder -tv on:driver=v4l:width=640:height=480 <options></CODE></P> | 469 <CODE> mencoder -tv on:driver=v4l:width=640:height=480 <options></CODE></P> |
470 | 470 |
471 <P>For all available options, <B>check the MEncoder man page!</B> | 471 <P>For all available options, <B>check the MEncoder man page!</B> |
472 <P> | 472 <P> |
473 | 473 |