Mercurial > mplayer.hg
comparison DOCS/encoding.html @ 7640:427935644581
updates, fixes
author | gabucino |
---|---|
date | Sun, 06 Oct 2002 20:55:38 +0000 |
parents | 892ebabb04e2 |
children | 5d4b0446a557 |
comparison
equal
deleted
inserted
replaced
7639:bec7bdad9976 | 7640:427935644581 |
---|---|
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><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, | 15 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, |
16 designed to encode MPlayer-playable movies | 16 designed to encode MPlayer-playable movies |
17 (<B>AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET</B>) to other | 17 (<B>AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET/PVA</B>) to other |
18 MPlayer-playable formats (see below). It can encode with various codecs, like | 18 MPlayer-playable formats (see below). It can encode with various codecs, like |
19 <B>DivX4</B> (1 or 2 passes), libavcodec, | 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 | 20 <B>PCM</B>/<B>MP3</B>/<B>VBR MP3</B> audio. Also has powerful plugin system |
21 for video manipulation.</P> | 21 for video manipulation.</P> |
22 | 22 |
102 <P>This example shows how to encode a DVD to a 2-pass DivX4 AVI. Just two | 102 <P>This example shows how to encode a DVD to a 2-pass DivX4 AVI. Just two |
103 commands are needed:<BR> | 103 commands are needed:<BR> |
104 <CODE> rm frameno.avi</CODE> - remove this file, which | 104 <CODE> rm frameno.avi</CODE> - remove this file, which |
105 can come from a previous 3-pass encoding (it interferes with current | 105 can come from a previous 3-pass encoding (it interferes with current |
106 one)<BR> | 106 one)<BR> |
107 <CODE> mencoder -dvd 2 -lavcopts | 107 <CODE> mencoder -dvd 2 -ovc lavc -lavcopts |
108 -vcodec=mpeg4:more_options -o movie.avi -pass 1<BR> | 108 vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 1<BR> |
109 mencoder -dvd 2 -lavcopts vcodec=mpeg4:more_options | 109 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:more_options |
110 -o movie.avi -pass 2</CODE></P> | 110 -oac copy -o movie.avi -pass 2</CODE></P> |
111 | 111 |
112 <P><U><B>3-pass encoding:</B></U> this is an extension of 2-pass encoding, | 112 <P><U><B>3-pass encoding:</B></U> this is an extension of 2-pass encoding, |
113 where the audio encoding takes place in a separate pass. This method enables | 113 where the audio encoding takes place in a separate pass. This method enables |
114 estimation of recommended video bitrate in order to fit on a CD. Also, the | 114 estimation of recommended video bitrate in order to fit on a CD. Also, the |
115 audio is encoded only once, unlike in 2-pass mode. The schematics:</P> | 115 audio is encoded only once, unlike in 2-pass mode. The schematics:</P> |
116 | 116 |
117 <OL> | 117 <OL> |
118 <LI>Remove conflicting temporary file: | 118 <LI>Remove conflicting temporary file: |
119 <P><CODE>rm frameno.avi</CODE></P></LI> | 119 <P><CODE>rm frameno.avi</CODE></P></LI> |
120 <LI>First pass: | 120 <LI>First pass: |
121 <P><CODE>mencoder <file/DVD> -ovc frameno -o frameno.avi</CODE></P> | 121 <P><CODE>mencoder <file/DVD> -ovc frameno -oac mp3lame -lameopts vbr=3:more_options -o frameno.avi</CODE></P> |
122 <P>An audio-only avi file will be created, containing | 122 <P>An audio-only avi file will be created, containing |
123 <B>only</B> the requested audio stream. Don't forget <CODE>-lameopts</CODE>, | 123 <B>only</B> the requested audio stream. Don't forget <CODE>-lameopts</CODE>, |
124 if you need to set it. If you were encoding a long movie, <B>MEncoder</B> | 124 if you need to set it. If you were encoding a long movie, <B>MEncoder</B> |
125 prints the recommended bitrate values for 650Mb, 700Mb, and 800Mb | 125 prints the recommended bitrate values for 650Mb, 700Mb, and 800Mb |
126 destination sizes, after this pass finishes.</P></LI> | 126 destination sizes, after this pass finishes.</P></LI> |
127 <LI>Second pass: | 127 <LI>Second pass: |
128 <P><CODE>mencoder <file/DVD> -oac copy -pass 1 | 128 <P><CODE>mencoder <file/DVD> -oac copy -pass 1 |
129 -ovc divx4 -divx4opts br=<bitrate></CODE></P> | 129 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=<bitrate></CODE></P> |
130 <P>Alias the first pass of DivX4 video encoding. | 130 <P>Alias the first pass of DivX4 video encoding. |
131 Optionally specify the video bitrate <B>MEncoder</B> printed at the end of | 131 Optionally specify the video bitrate <B>MEncoder</B> printed at the end of |
132 the previous pass.</P></LI> | 132 the previous pass.</P></LI> |
133 <LI>Third pass: | 133 <LI>Third pass: |
134 <P><CODE>mencoder <file/DVD> -oac copy -pass 2 | 134 <P><CODE>mencoder <file/DVD> -oac copy -pass 2 |
135 -ovc divx4 -divx4opts br=<bitrate></CODE></P> | 135 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=<bitrate></CODE></P> |
136 <P>Alias the second pass of DivX4 video encoding. | 136 <P>Alias the second pass of DivX4 video encoding. |
137 Optionally specify the video bitrate <B>MEncoder</B> printed at the end of | 137 Optionally specify the video bitrate <B>MEncoder</B> printed at the end of |
138 the previous pass. In this pass, audio from <CODE>frameno.avi</CODE> will | 138 the previous pass. In this pass, audio from <CODE>frameno.avi</CODE> will |
139 be inserted into the destination file.. and it's all ready!</P></LI> | 139 be inserted into the destination file.. and it's all ready!</P></LI> |
140 </OL> | 140 </OL> |
143 | 143 |
144 <P><CODE> rm frameno.avi</CODE> - remove this file, | 144 <P><CODE> rm frameno.avi</CODE> - remove this file, |
145 which can come from a previous 3-pass encoding (it interferes with current | 145 which can come from a previous 3-pass encoding (it interferes with current |
146 one)<BR> | 146 one)<BR> |
147 <CODE> mencoder -dvd 2 -ovc frameno | 147 <CODE> mencoder -dvd 2 -ovc frameno |
148 -o frameno.avi<BR> | 148 -o frameno.avi -oac mp3lame -lameopts vbr=3:more_options<BR> |
149 mencoder -dvd 2 | 149 mencoder -dvd 2 -ovc lavc |
150 -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 1<BR> | 150 -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 1<BR> |
151 mencoder -dvd 2 | 151 mencoder -dvd 2 -ovc lavc |
152 -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 2</CODE></P> | 152 -lavcopts vcodec=mpeg4:more_options -oac copy -o movie.avi -pass 2</CODE></P> |
153 | 153 |
154 <P><U><B>2 or 3-pass encoding using internal libavcodec controller:</B></U> | 154 <P><U><B>2 or 3-pass encoding using internal libavcodec controller:</B></U> |
155 Optionally you can use libavcodec's internal 2 or 3-pass mode, it may give | 155 Optionally you can use libavcodec's internal 2 or 3-pass mode, it may give |
156 you better final rate accuracy than using the external, DivX4-inspired 2-pass | 156 you better final rate accuracy than using the external, DivX4-inspired 2-pass |
188 <CODE>-vop scale=X:Y</CODE>. Its quality can be set with the | 188 <CODE>-vop scale=X:Y</CODE>. Its quality can be set with the |
189 <CODE>-sws</CODE> option. If it's not specified, <B>MEncoder</B> will use 0: | 189 <CODE>-sws</CODE> option. If it's not specified, <B>MEncoder</B> will use 0: |
190 fast bilinear.</P> | 190 fast bilinear.</P> |
191 | 191 |
192 <P>Usage:<BR> | 192 <P>Usage:<BR> |
193 <CODE> mencoder sample-svcd.mpg -lavcopts | 193 <CODE> mencoder sample-svcd.mpg -ovc lavc -lavcopts |
194 vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o | 194 vcodec=mpeg4:more_options -vop scale=640:480 -oac copy -o |
195 output.avi</CODE></P> | 195 output.avi</CODE></P> |
196 | 196 |
197 | 197 |
198 <H4><A NAME="copying">2.4.2.3 Stream copying</A></H4> | 198 <H4><A NAME="copying">2.4.2.3 Stream copying</A></H4> |
199 | 199 |
247 <P>The first column contains the codec names that should be passed after the | 247 <P>The first column contains the codec names that should be passed after the |
248 <CODE>vcodec</CODE> config, like: <CODE>-lavcopts vcodec=msmpeg4</CODE></P> | 248 <CODE>vcodec</CODE> config, like: <CODE>-lavcopts vcodec=msmpeg4</CODE></P> |
249 | 249 |
250 <P>An example, with MJPEG compression:<BR> | 250 <P>An example, with MJPEG compression:<BR> |
251 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc | 251 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc |
252 -lavcopts vcodec=mjpeg</CODE></P> | 252 -lavcopts vcodec=mjpeg -oac copy</CODE></P> |
253 | 253 |
254 | 254 |
255 <H4><A NAME="image_files">2.4.2.6 Encoding from multiple input image files (JPEGs, PNGs or TGAs)</A></H4> | 255 <H4><A NAME="image_files">2.4.2.6 Encoding from multiple input image files (JPEGs, PNGs or TGAs)</A></H4> |
256 | 256 |
257 <P><B>MEncoder</B> is capable of creating movies from one or more JPEG, PNG or TGA | 257 <P><B>MEncoder</B> is capable of creating movies from one or more JPEG, PNG or TGA |
274 | 274 |
275 <P>The explanation of the <CODE>-mf</CODE> option can be found below in the | 275 <P>The explanation of the <CODE>-mf</CODE> option can be found below in the |
276 global <A HREF="#options">Options</A> section and in the man page.</P> | 276 global <A HREF="#options">Options</A> section and in the man page.</P> |
277 | 277 |
278 <P><I>Creating a DivX4 file from all the JPEG files in the current dir:</I><BR> | 278 <P><I>Creating a DivX4 file from all the JPEG files in the current dir:</I><BR> |
279 <CODE>mencoder \*.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -o | 279 <CODE>mencoder \*.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -oac copy -o |
280 output.avi</CODE></P> | 280 output.avi</CODE></P> |
281 | 281 |
282 <P><I>Creating a DivX4 file from some JPEG files in the current dir:</I><BR> | 282 <P><I>Creating a DivX4 file from some JPEG files in the current dir:</I><BR> |
283 <CODE>mencoder frame001.jpg,frame002.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -o | 283 <CODE>mencoder frame001.jpg,frame002.jpg -mf on:w=800:h=600:fps=25 -ovc divx4 -oac copy -o |
284 output.avi</CODE></P> | 284 output.avi</CODE></P> |
285 | 285 |
286 <P><I>Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current dir:</I><BR> | 286 <P><I>Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current dir:</I><BR> |
287 <CODE>mencoder \*.jpg -mf on:w=800:h=600:fps=25 -ovc copy | 287 <CODE>mencoder \*.jpg -mf on:w=800:h=600:fps=25 -ovc copy |
288 -oac copy -o output.avi</CODE></P> | |
289 | |
290 <P><I>Creating an uncompressed file from all the PNG files in the current dir:</I><BR> | |
291 <CODE>mencoder \*.png -mf on:w=800:h=600:fps=25:type=png -ovc raw -oac copy -o | |
292 output.avi</CODE></P> | |
293 | |
294 <P><I>Creating a Motion PNG (MPNG) file from all the PNG files in the current dir:</I><BR> | |
295 <CODE>mencoder \*.png -mf on:w=800:h=600:fps=25:type=png -ovc copy -oac copy | |
288 -o output.avi</CODE></P> | 296 -o output.avi</CODE></P> |
289 | 297 |
290 <P><I>Creating an uncompressed file from all the PNG files in the current dir:</I><BR> | |
291 <CODE>mencoder \*.png -mf on:w=800:h=600:fps=25:type=png -ovc raw -o | |
292 output.avi</CODE></P> | |
293 | |
294 <P><I>Creating a Motion PNG (MPNG) file from all the PNG files in the current dir:</I><BR> | |
295 <CODE>mencoder \*.png -mf on:w=800:h=600:fps=25:type=png -ovc copy | |
296 -o output.avi</CODE></P> | |
297 | |
298 <P><I>Creating a Motion TGA (MTGA) file from all the TGA files in the current dir:</I><BR> | 298 <P><I>Creating a Motion TGA (MTGA) file from all the TGA files in the current dir:</I><BR> |
299 <CODE>mencoder \*.tga -mf on:w=800:h=600:fps=25:type=tga -ovc copy | 299 <CODE>mencoder \*.tga -mf on:w=800:h=600:fps=25:type=tga -ovc copy -oac copy |
300 -o output.avi</CODE></P> | 300 -o output.avi</CODE></P> |
301 | 301 |
302 | 302 |
303 <H4><A NAME="vobsub">2.4.2.7 Extracting DVD subtitles to Vobsub file</A></H4> | 303 <H4><A NAME="vobsub">2.4.2.7 Extracting DVD subtitles to Vobsub file</A></H4> |
304 | 304 |
328 <H4>Examples</H4> | 328 <H4>Examples</H4> |
329 | 329 |
330 <P><I>Copying two subtitles from a DVD while doing 3-pass encoding</I><BR> | 330 <P><I>Copying two subtitles from a DVD while doing 3-pass encoding</I><BR> |
331 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> | 331 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> |
332 <CODE>mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0 | 332 <CODE>mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0 |
333 -sid 2 -o frameno.avi -ovc frameno</CODE><BR> | 333 -sid 2 -o frameno.avi -ovc frameno -oac mp3lame -lameopts vbr=3</CODE><BR> |
334 <CODE>mencoder -dvd 1 -oac copy -ovc divx4 -pass 1</CODE><BR> | 334 <CODE>mencoder -dvd 1 -oac copy -ovc divx4 -pass 1</CODE><BR> |
335 <CODE>mencoder -dvd 1 -oac copy -ovc divx4 -pass 2 -vobsubout | 335 <CODE>mencoder -dvd 1 -oac copy -ovc divx4 -pass 2 -vobsubout |
336 subtitles -vobsuboutindex 1 -sid 5</CODE></P> | 336 subtitles -vobsuboutindex 1 -sid 5</CODE></P> |
337 | 337 |
338 <P><I>Copying a french subtitle from an MPEG file</I><BR> | 338 <P><I>Copying a french subtitle from an MPEG file</I><BR> |