Mercurial > mplayer.hg
comparison DOCS/encoding.html @ 7047:4f87cd0f642f
Converted the docs to use proper headings tags.
Headings start at <H1> for sections and decrease one size for each level in
the section hierarchy, thus 2.3.4 is <H3>. Headings without numbering are
<H4> unless they are in a <H5> section, then <H5> also.
author | diego |
---|---|
date | Tue, 20 Aug 2002 00:33:04 +0000 |
parents | ba9c212ed577 |
children | c214aa9110d0 |
comparison
equal
deleted
inserted
replaced
7046:e6cab2610139 | 7047:4f87cd0f642f |
---|---|
8 </HEAD> | 8 </HEAD> |
9 | 9 |
10 <BODY> | 10 <BODY> |
11 | 11 |
12 | 12 |
13 <P><B><A NAME="encoding">2.4 Encoding with MEncoder</A></B></P> | 13 <<H2>><A NAME="encoding">2.4 Encoding with MEncoder</A></<H2>> |
14 | 14 |
15 | 15 |
16 <P><B><A NAME="overview">2.4.1 Overview</A></B></P> | 16 <H3><A NAME="overview">2.4.1 Overview</A></H3> |
17 | 17 |
18 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, | 18 <P><B>MEncoder</B> (<B>MPlayer</B>'s Movie Encoder) is a simple movie encoder, |
19 designed to encode MPlayer-playable movies | 19 designed to encode MPlayer-playable movies |
20 (<B>AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET</B>) to other | 20 (<B>AVI/ASF/OGG/DVD/VCD/VOB/MPG/MOV/VIV/FLI/RM/NUV/NET</B>) to other |
21 MPlayer-playable formats (see below). It can encode with various codecs, like | 21 MPlayer-playable formats (see below). It can encode with various codecs, like |
22 <B>DivX4</B> (1 or 2 passes), libavcodec, | 22 <B>DivX4</B> (1 or 2 passes), libavcodec, |
23 <B>PCM</B>/<B>MP3</B>/<B>VBR MP3</B> audio. Also has powerful plugin system | 23 <B>PCM</B>/<B>MP3</B>/<B>VBR MP3</B> audio. Also has powerful plugin system |
24 for video manipulation.</P> | 24 for video manipulation.</P> |
25 | 25 |
26 | 26 |
27 <P><B><A NAME="compilation">2.4.2 Compilation</A></B></P> | 27 <H3><A NAME="compilation">2.4.2 Compilation</A></H3> |
28 | 28 |
29 <UL> | 29 <UL> |
30 <LI><B>OPTIONAL</B> - read <B>MPlayer</B>'s compilation instruction.</LI> | 30 <LI><B>OPTIONAL</B> - read <B>MPlayer</B>'s compilation instruction.</LI> |
31 <LI><B>OPTIONAL (LINUX ONLY)</B> - download the newest <B>DivX4linux</B> libs | 31 <LI><B>OPTIONAL (LINUX ONLY)</B> - download the newest <B>DivX4linux</B> libs |
32 from <A HREF="http://avifile.sourceforge.net/download.htm">avifile.sourceforge.net</A>, | 32 from <A HREF="http://avifile.sourceforge.net/download.htm">avifile.sourceforge.net</A>, |
56 | 56 |
57 <P>You are ready. As you probably know, other encoding tools need the | 57 <P>You are ready. As you probably know, other encoding tools need the |
58 <I>avifile</I> library installed. <B>MEncoder</B> doesn't need it at all.</P> | 58 <I>avifile</I> library installed. <B>MEncoder</B> doesn't need it at all.</P> |
59 | 59 |
60 | 60 |
61 <P><B><A NAME="features">2.4.3 MEncoder features</A></B></P> | 61 <H3><A NAME="features">2.4.3 MEncoder features</A></H3> |
62 | 62 |
63 <UL> | 63 <UL> |
64 <LI>encoding from the wide range of fileformats and decoders of <B>MPlayer</B></LI> | 64 <LI>encoding from the wide range of fileformats and decoders of <B>MPlayer</B></LI> |
65 <LI>encoding to all the codecs of ffmpeg's | 65 <LI>encoding to all the codecs of ffmpeg's |
66 <A HREF="codecs.html#libavcodec">libavcodec</A></LI> | 66 <A HREF="codecs.html#libavcodec">libavcodec</A></LI> |
80 rotate, scale, rgb/yuv conversion)</LI> | 80 rotate, scale, rgb/yuv conversion)</LI> |
81 <LI>can encode DVD/VOBsub <B>AND</B> text subtitles into the output file</LI> | 81 <LI>can encode DVD/VOBsub <B>AND</B> text subtitles into the output file</LI> |
82 <LI>can rip DVD subtitles to Vobsub format</LI> | 82 <LI>can rip DVD subtitles to Vobsub format</LI> |
83 </UL> | 83 </UL> |
84 | 84 |
85 <B>Planned features:</B> | 85 <H4>Planned features:</H4> |
86 | |
86 <UL> | 87 <UL> |
87 <LI>even wider variety of available en/decoding formats/codecs | 88 <LI>even wider variety of available en/decoding formats/codecs |
88 (creating VOB files with DivX4/Indeo5/VIVO streams :)</LI> | 89 (creating VOB files with DivX4/Indeo5/VIVO streams :)</LI> |
89 <LI>audio encoding from v4l (DONE for FreeBSD ?)</LI> | 90 <LI>audio encoding from v4l (DONE for FreeBSD ?)</LI> |
90 </UL> | 91 </UL> |
91 | 92 |
92 | 93 |
93 <P><B><A NAME="2pass">2.4.3.1 Encoding 2 or 3-pass DivX4</A></B></P> | 94 <H4><A NAME="2pass">2.4.3.1 Encoding 2 or 3-pass DivX4</A></H4> |
94 | 95 |
95 <P><U><B>2-pass encoding:</B></U> the name comes from the fact that this method | 96 <P><U><B>2-pass encoding:</B></U> the name comes from the fact that this method |
96 encodes the file <I>twice</I>. The first encoding (dubbed <I>pass</I>) | 97 encodes the file <I>twice</I>. The first encoding (dubbed <I>pass</I>) |
97 creates some temporary files (*.log) with a size of few megabytes, do not | 98 creates some temporary files (*.log) with a size of few megabytes, do not |
98 delete them yet (you can delete the AVI). In the second pass, the 2-pass | 99 delete them yet (you can delete the AVI). In the second pass, the 2-pass |
145 previous pass. In this pass, audio from <CODE>frameno.avi</CODE> will be | 146 previous pass. In this pass, audio from <CODE>frameno.avi</CODE> will be |
146 inserted into the destination file.. and it's all ready!</B></TD> | 147 inserted into the destination file.. and it's all ready!</B></TD> |
147 </TR> | 148 </TR> |
148 </TABLE> | 149 </TABLE> |
149 | 150 |
150 <P><B>Example for 3-pass encoding:</B></P> | 151 <H4>Example for 3-pass encoding:</H4> |
151 | 152 |
152 <P><CODE> rm frameno.avi</CODE> - remove this file, | 153 <P><CODE> rm frameno.avi</CODE> - remove this file, |
153 which can come from a previous 3-pass encoding (it interferes with current | 154 which can come from a previous 3-pass encoding (it interferes with current |
154 one)<BR> | 155 one)<BR> |
155 <CODE> mencoder -dvd 2 -ovc frameno | 156 <CODE> mencoder -dvd 2 -ovc frameno |
179 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o | 180 mencoder -dvd 2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o |
180 movie.avi</CODE></LI> | 181 movie.avi</CODE></LI> |
181 </UL> | 182 </UL> |
182 | 183 |
183 | 184 |
184 <P><B><A NAME="rescaling">2.4.3.2 Rescaling movies</A></B></P> | 185 <H4><A NAME="rescaling">2.4.3.2 Rescaling movies</A></H4> |
185 | 186 |
186 <P>Often the need to resize movie images' size emerges. Its reasons can be many, | 187 <P>Often the need to resize movie images' size emerges. Its reasons can be many, |
187 examples are decreasing output file size, encoding SVCDs to DivX. Ripped DVDs | 188 examples are decreasing output file size, encoding SVCDs to DivX. Ripped DVDs |
188 are mostly rescaled, for example a 4:3 DVD should be 640x480, especially | 189 are mostly rescaled, for example a 4:3 DVD should be 640x480, especially |
189 when you want it to fit to 1 CD, and have good quality at the same time. | 190 when you want it to fit to 1 CD, and have good quality at the same time. |
201 <CODE> mencoder sample-svcd.mpg -lavcopts | 202 <CODE> mencoder sample-svcd.mpg -lavcopts |
202 vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o | 203 vcodec=mpeg4:more_options -vop scale=640:480 -sws 2 -o |
203 output.avi</CODE></P> | 204 output.avi</CODE></P> |
204 | 205 |
205 | 206 |
206 <P><B><A NAME="copying">2.4.3.3 Stream copying</A></B></P> | 207 <H4><A NAME="copying">2.4.3.3 Stream copying</A></H4> |
207 | 208 |
208 <P><B>MEncoder</B> can handle input streams in two ways: <B>encode</B> or | 209 <P><B>MEncoder</B> can handle input streams in two ways: <B>encode</B> or |
209 <B>copy</B> them. This section is about <B>copying</B>.</P> | 210 <B>copy</B> them. This section is about <B>copying</B>.</P> |
210 | 211 |
211 <UL> | 212 <UL> |
222 into the output stream. Use the <CODE>-audiofile <filename></CODE> | 223 into the output stream. Use the <CODE>-audiofile <filename></CODE> |
223 option for this.</LI> | 224 option for this.</LI> |
224 </UL> | 225 </UL> |
225 | 226 |
226 | 227 |
227 <P><B><A NAME="fixing">2.4.3.4 Fixing AVIs with broken index or interleaving</A></B></P> | 228 <H4><A NAME="fixing">2.4.3.4 Fixing AVIs with broken index or interleaving</A></H4> |
228 | 229 |
229 <P>Easiest thing. We simply copy the video and audio streams, and | 230 <P>Easiest thing. We simply copy the video and audio streams, and |
230 <B>MEncoder</B> generates the index. Of course this cannot fix possible bugs | 231 <B>MEncoder</B> generates the index. Of course this cannot fix possible bugs |
231 in the video and/or audio streams. It also fixes files with broken | 232 in the video and/or audio streams. It also fixes files with broken |
232 interleaving, thus the <CODE>-ni</CODE> option won't be needed for them | 233 interleaving, thus the <CODE>-ni</CODE> option won't be needed for them |
233 anymore.</P> | 234 anymore.</P> |
234 | 235 |
235 <P>Command: <CODE>mencoder -idx input.avi -ovc copy -oac copy -o output.avi</CODE></P> | 236 <P>Command: <CODE>mencoder -idx input.avi -ovc copy -oac copy -o output.avi</CODE></P> |
236 | 237 |
237 | 238 |
238 <P><B><A NAME="libavcodec">2.4.3.5 Encoding with the libavcodec codec family</A></B></P> | 239 <H4><A NAME="libavcodec">2.4.3.5 Encoding with the libavcodec codec family</A></H4> |
239 | 240 |
240 <P><A HREF="codecs.html#libavcodec">libavcodec</A> provides simple encoding to a | 241 <P><A HREF="codecs.html#libavcodec">libavcodec</A> provides simple encoding to a |
241 lot of interesting video and audio formats (currently its audio codecs are | 242 lot of interesting video and audio formats (currently its audio codecs are |
242 unsupported). You can encode to the following codecs:</P> | 243 unsupported). You can encode to the following codecs:</P> |
243 | 244 |
258 <P>An example, with MJPEG compression:<BR> | 259 <P>An example, with MJPEG compression:<BR> |
259 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc | 260 <CODE> mencoder -dvd 2 -o title2.avi -ovc lavc |
260 -lavcopts vcodec=mjpeg</CODE></P> | 261 -lavcopts vcodec=mjpeg</CODE></P> |
261 | 262 |
262 | 263 |
263 <P><B><A NAME="image_files">2.4.3.6 Encoding from multiple input image files (JPEGs or PNGs)</A></B></P> | 264 <H4><A NAME="image_files">2.4.3.6 Encoding from multiple input image files (JPEGs or PNGs)</A></H4> |
264 | 265 |
265 <P><B>MEncoder</B> is capable of creating movies from one or more JPEG or PNG | 266 <P><B>MEncoder</B> is capable of creating movies from one or more JPEG or PNG |
266 files. With simple framecopy it can create MJPEG (Motion JPEG) or MPNG | 267 files. With simple framecopy it can create MJPEG (Motion JPEG) or MPNG |
267 (Motion PNG) files.</P> | 268 (Motion PNG) files.</P> |
268 | 269 |
269 <P><B>Explanation of the process</B></P> | 270 <H4>Explanation of the process</H4> |
270 | 271 |
271 <P><B>MEncoder</B> <I>decodes</I> the input image(s) with <CODE>libjpeg</CODE> | 272 <P><B>MEncoder</B> <I>decodes</I> the input image(s) with <CODE>libjpeg</CODE> |
272 (when decoding PNGs, it will use <B>libpng</B>).</P> | 273 (when decoding PNGs, it will use <B>libpng</B>).</P> |
273 | 274 |
274 <P><B>MEncoder</B> then feeds the decoded image to the chosen video compressor | 275 <P><B>MEncoder</B> then feeds the decoded image to the chosen video compressor |
275 (DivX4, Xvid, ffmpeg msmpeg4, etc...). Watch for the PNG decoder, as | 276 (DivX4, Xvid, ffmpeg msmpeg4, etc...). Watch for the PNG decoder, as |
276 currently it can output only to RGB formats, thus can't be used with codecs | 277 currently it can output only to RGB formats, thus can't be used with codecs |
277 that require YUV as input, like DivX4 or ffmpeg's msmpeg4.</P> | 278 that require YUV as input, like DivX4 or ffmpeg's msmpeg4.</P> |
278 | 279 |
279 <P><B>Examples</B></P> | 280 <H4>Examples</H4> |
280 | 281 |
281 <P>The explanation of the <CODE>-mf</CODE> option can be found below in the | 282 <P>The explanation of the <CODE>-mf</CODE> option can be found below in the |
282 global <A HREF="#options">Options</A> section and in the man page.</P> | 283 global <A HREF="#options">Options</A> section and in the man page.</P> |
283 | 284 |
284 <P><I>Creating a DivX4 file from all the JPEG files in the current dir:</I><BR> | 285 <P><I>Creating a DivX4 file from all the JPEG files in the current dir:</I><BR> |
300 <P><I>Creating a Motion PNG (MPNG) file from all the PNG files in the current dir:</I><BR> | 301 <P><I>Creating a Motion PNG (MPNG) file from all the PNG files in the current dir:</I><BR> |
301 <CODE>mencoder \*.png -mf on:w=800:h=600:fps=25:type=png -ovc copy | 302 <CODE>mencoder \*.png -mf on:w=800:h=600:fps=25:type=png -ovc copy |
302 -o output.avi</CODE></P> | 303 -o output.avi</CODE></P> |
303 | 304 |
304 | 305 |
305 <P><B><A NAME="vobsub">2.4.3.7 Extracting DVD subtitles to Vobsub file</A></B></P> | 306 <H4><A NAME="vobsub">2.4.3.7 Extracting DVD subtitles to Vobsub file</A></H4> |
306 | 307 |
307 <P><B>MEncoder</B> is capable of extracting subtitles from a DVD into | 308 <P><B>MEncoder</B> is capable of extracting subtitles from a DVD into |
308 Vobsub fomat files. They consist of a pair of files ending in | 309 Vobsub fomat files. They consist of a pair of files ending in |
309 <CODE>.idx</CODE> and <CODE>.sub</CODE> and are usually packaged in a single | 310 <CODE>.idx</CODE> and <CODE>.sub</CODE> and are usually packaged in a single |
310 <CODE>.rar</CODE> archive. <B>MPlayer</B> can play these with the | 311 <CODE>.rar</CODE> archive. <B>MPlayer</B> can play these with the |
325 | 326 |
326 <P>Each run will append the running subtitle if the <CODE>.idx</CODE> and | 327 <P>Each run will append the running subtitle if the <CODE>.idx</CODE> and |
327 <CODE>.sub</CODE> files already exist. So you should remove any before | 328 <CODE>.sub</CODE> files already exist. So you should remove any before |
328 starting.</P> | 329 starting.</P> |
329 | 330 |
330 <P><B>Examples</B></P> | 331 <H4>Examples</H4> |
331 | 332 |
332 <P><I>Copying two subtitles from a DVD while doing 3-pass encoding</I><BR> | 333 <P><I>Copying two subtitles from a DVD while doing 3-pass encoding</I><BR> |
333 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> | 334 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> |
334 <CODE>mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0 | 335 <CODE>mencoder -dvd 1 -vobsubout subtitles -vobsuboutindex 0 |
335 -sid 2 -o frameno.avi -ovc frameno</CODE><BR> | 336 -sid 2 -o frameno.avi -ovc frameno</CODE><BR> |
340 <P><I>Copying a french subtitle from an MPEG file</I><BR> | 341 <P><I>Copying a french subtitle from an MPEG file</I><BR> |
341 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> | 342 <CODE>rm subtitles.idx subtitles.sub</CODE><BR> |
342 <CODE>mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles | 343 <CODE>mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles |
343 -vobsuboutindex 0 -vobsuboutid fr -sid 1</CODE></P> | 344 -vobsuboutindex 0 -vobsuboutid fr -sid 1</CODE></P> |
344 | 345 |
345 <P><B><A NAME="options">2.4.4 Options</A></B></P> | 346 |
347 <H3><A NAME="options">2.4.4 Options</A></H3> | |
346 | 348 |
347 <P>For the complete list of available MEncoder options and examples, please | 349 <P>For the complete list of available MEncoder options and examples, please |
348 see the manpage.</P> | 350 see the manpage.</P> |
349 | 351 |
350 </BODY> | 352 </BODY> |