Mercurial > mplayer.hg
annotate DOCS/xml/en/mencoder.xml @ 11209:904f8b9c617c
html.xsl -> html-single.xsl
author | lumag |
---|---|
date | Tue, 21 Oct 2003 14:57:41 +0000 |
parents | 49b1a67e7381 |
children | 252fb0cf331a |
rev | line source |
---|---|
9675 | 1 <?xml version="1.0" encoding="iso-8859-1"?> |
10913
49b1a67e7381
Add revision keyword to english xml files, to ease translation synchronization
lumag
parents:
10869
diff
changeset
|
2 <!-- $Revision$ --> |
9675 | 3 <chapter id="mencoder"> |
4 <title>Encoding with MEncoder</title> | |
5 | |
6 <para> | |
7 For the complete list of available <application>MEncoder</application> options | |
8 and examples, please see the man page. For a series of hands-on examples and | |
9 detailed guides on using several encoding parameters, read the | |
10 <ulink url="../../tech/encoding-tips.txt">encoding-tips</ulink> that were | |
11 collected from several mailing list threads on mplayer-users. Search the | |
12 <ulink url="http://mplayerhq.hu/pipermail/mplayer-users/">archives</ulink> | |
13 for a wealth of discussions about all aspects of and problems related to | |
14 encoding with <application>MEncoder</application>. | |
15 </para> | |
16 | |
17 <sect1 id="menc-feat-divx4"> | |
18 <title>Encoding 2 or 3-pass MPEG-4 ("DivX")</title> | |
19 | |
20 <formalpara> | |
21 <title>2-pass encoding</title> | |
22 <para> | |
23 The name comes from the fact that this method encodes the file <emphasis>twice</emphasis>. | |
24 The first encoding (dubbed pass) creates some temporary files | |
25 (<filename>*.log</filename>) with a size of few megabytes, do not delete | |
26 them yet (you can delete the AVI). In the second pass, the 2-pass output | |
27 file is created, using the bitrate data from the temporary files. The | |
28 resulting file will have much better image quality. If this is the first | |
29 time you heard about this, you should consult some guides available on the | |
30 Net. | |
31 </para> | |
32 </formalpara> | |
33 | |
34 <para> | |
35 This example shows how to encode a DVD to a 2-pass MPEG-4 ("DivX") AVI. | |
36 Just two commands are needed: | |
37 <screen>rm frameno.avi</screen> | |
38 remove this file, which can come from a previous 3-pass encoding (it interferes | |
39 with current one) | |
40 <screen> | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
41 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi |
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
42 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi |
9675 | 43 </screen> |
44 </para> | |
45 | |
46 <formalpara> | |
47 <title>3-pass encoding</title> | |
48 <para> | |
49 This is an extension of 2-pass encoding, where the audio encoding takes | |
50 place in a separate pass. This method enables estimation of recommended | |
51 video bitrate in order to fit on a CD. Also, the audio is encoded only | |
52 once, unlike in 2-pass mode. The schematics: | |
53 </para> | |
54 </formalpara> | |
55 | |
56 <procedure> | |
57 <step><para> | |
58 Remove conflicting temporary file: | |
59 <screen>rm frameno.avi</screen> | |
60 </para></step> | |
61 <step><para> | |
62 <emphasis>First pass:</emphasis> | |
63 | |
64 <screen>mencoder <replaceable>file/DVD</replaceable> -ovc frameno -oac mp3lame -lameopts vbr=3 -o frameno.avi</screen> | |
65 | |
66 An audio-only avi file will be created, containing | |
67 <emphasis role="bold">only</emphasis> the requested audio stream. Don't forget | |
68 <option>-lameopts</option>, if you need to set it. If you were encoding a | |
69 long movie, <application>MEncoder</application> prints the recommended | |
70 bitrate values for 650Mb, 700Mb, and 800Mb destination sizes, after this | |
71 pass finishes. | |
72 </para></step> | |
73 <step><para> | |
74 <emphasis>Second pass:</emphasis> | |
75 <screen> | |
76 mencoder <replaceable>file/DVD</replaceable> -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=<replaceable>bitrate</replaceable><!-- | |
77 --></screen> | |
78 This is the first pass of video encoding. Optionally specify the video | |
79 bitrate MEncoder printed at the end of the previous pass. | |
80 </para></step> | |
81 <step><para> | |
82 <emphasis>Third pass:</emphasis> | |
83 <screen> | |
84 mencoder <replaceable>file/DVD</replaceable> -oac copy -pass 2 \ | |
85 -ovc divx4 -divx4opts br=<replaceable>bitrate</replaceable> | |
86 </screen> | |
87 This is the second pass of video encoding. Specify the same bitrate | |
88 as in the previous pass unless you really know what you are doing. | |
89 In this pass, audio from <filename>frameno.avi</filename> will be | |
90 inserted into the destination file...and it's all ready! | |
91 </para></step> | |
92 </procedure> | |
93 | |
94 <example> | |
95 <title>Example of 3-pass encoding</title> | |
96 <para> | |
97 <screen>rm frameno.avi</screen> | |
98 remove this file, which can come from a previous 3-pass encoding | |
99 (it interferes with current one) | |
100 <screen> | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
101 mencoder dvd://2 -ovc frameno -o frameno.avi -oac mp3lame -lameopts vbr=3 |
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
102 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi |
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
103 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi |
9675 | 104 </screen> |
105 </para> | |
106 </example> | |
107 </sect1> | |
108 | |
109 <sect1 id="menc-feat-mpeg"> | |
110 <title>Encoding to MPEG format</title> | |
111 <para> | |
112 <application>MEncoder</application> can create MPEG (MPEG-PS) format output | |
10869 | 113 files. It's probably useful only with <link linkend="ffmpeg">libavcodec</link>'s |
114 <emphasis>mpeg1video</emphasis> codec, because players - except | |
115 <application>MPlayer</application> - expect MPEG1 video, and MPEG1 layer 2 (MP2) | |
116 audio streams in MPEG files. | |
9675 | 117 </para> |
118 | |
119 <para> | |
120 this feature is not very useful right now, aside that it probably has many bugs, | |
121 but the more importantly because MEncoder currently cannot encode MPEG1 layer 2 | |
122 (MP2) audio, which all other players expect in MPEG files. | |
123 </para> | |
124 | |
125 <para> | |
126 To change MEncoder's output file format, use the <option>-of mpeg</option> option. | |
127 </para> | |
128 | |
129 <para> | |
130 Example: | |
131 <screen> | |
132 mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy <replaceable>other options</replaceable> media.avi -o output.mpg | |
133 </screen> | |
134 </para> | |
135 </sect1> | |
136 | |
137 | |
138 <sect1 id="menc-feat-rescale"> | |
139 <title>Rescaling movies</title> | |
140 | |
141 <para> | |
142 Often the need to resize movie images' size emerges. Its reasons can be | |
143 many: decreasing file size, network bandwidth,etc. Most people even do | |
144 rescaling when converting DVDs or SVCDs to DivX AVI. This is <emphasis role="bold">bad</emphasis>. | |
145 Instead of even you doing so, read the <link linkend="aspect">Preserving aspect ratio</link> | |
146 section. | |
147 </para> | |
148 | |
149 <para> | |
150 The scaling process is handled by the <literal>scale</literal> video filter: | |
9677 | 151 <option>-vf scale=<replaceable>width</replaceable>:<replaceable>height</replaceable></option>. |
9675 | 152 Its quality can be set with the <option>-sws</option> option. |
153 If it's not specified, <application>MEncoder</application> will use 0: fast | |
154 bilinear. | |
155 </para> | |
156 | |
157 <para> | |
158 Usage: | |
159 <screen> | |
9677 | 160 mencoder <replaceable>input.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=640:480-o <replaceable>output.avi</replaceable> |
9675 | 161 </screen> |
162 </para> | |
163 </sect1> | |
164 | |
165 | |
166 <sect1 id="menc-feat-streamcopy"> | |
167 <title>Stream copying</title> | |
168 | |
169 <para> | |
170 <application>MEncoder</application> can handle input streams in two ways: | |
171 <emphasis role="bold">encode</emphasis> or <emphasis role="bold">copy</emphasis> | |
172 them. This section is about <emphasis role="bold">copying</emphasis>. | |
173 </para> | |
174 | |
175 <itemizedlist> | |
176 <listitem><para> | |
177 <emphasis role="bold">Video stream</emphasis> (option <option>-ovc copy</option>): | |
178 nice stuff can be done :) Like, putting (not converting!) FLI or VIVO or | |
179 MPEG1 video into an AVI file! Of course only | |
180 <application>MPlayer</application> can play such files :) And it probably | |
181 has no real life value at all. Rationally: video stream copying can be | |
182 useful for example when only the audio stream has to be encoded (like, | |
183 uncompressed PCM to MP3). | |
184 </para></listitem> | |
185 <listitem><para> | |
186 <emphasis role="bold">Audio stream</emphasis> (option <option>-oac copy</option>): | |
187 straightforward. It is possible to take an external audio file (MP3, | |
10429 | 188 WAV) and mux it into the output stream. Use the |
9675 | 189 <option>-audiofile <replaceable>filename</replaceable></option> option |
190 for this. | |
191 </para></listitem> | |
192 </itemizedlist> | |
193 </sect1> | |
194 | |
195 | |
196 <sect1 id="menc-feat-fix-avi"> | |
197 <title>Fixing AVIs with broken index or interleaving</title> | |
198 | |
199 <para> | |
200 Easiest thing. We simply copy the video and audio streams, and | |
201 <application>MEncoder</application> generates the index. Of course this cannot fix possible bugs in | |
202 the video and/or audio streams. It also fixes files with broken interleaving, | |
203 thus the <option>-ni</option> option won't be needed for them anymore. | |
204 </para> | |
205 | |
206 <para> | |
207 Command: | |
208 <screen> | |
209 mencoder -idx <replaceable>input.avi</replaceable> -ovc copy -oac copy -o <replaceable>output.avi</replaceable><!-- | |
210 --></screen> | |
211 </para> | |
212 | |
213 | |
214 <sect2 id="menc-feat-appending"> | |
215 <title>Appending multiple AVI files</title> | |
216 | |
217 <para> | |
218 As a side-effect, the broken AVI fixer function enables MEncoder to append | |
219 2 (or more) AVI files: | |
220 </para> | |
221 | |
222 <para> | |
223 Command: | |
224 <screen>cat 1.avi 2.avi | mencoder -noidx -ovc copy -oac copy -o output.avi -</screen> | |
225 </para> | |
226 | |
227 <note><para> | |
228 This expects <filename>1.avi</filename> and <filename>2.avi</filename> to use | |
229 the same codecs, resolution, stream rate etc, and at least <filename>1.avi</filename> | |
230 must not be broken. You may need to fix your input AVI files first, as described | |
231 <link linkend="menc-feat-fix-avi">above</link>. | |
232 </para></note> | |
233 </sect2> | |
234 </sect1> | |
235 | |
236 <sect1 id="menc-feat-enc-libavcodec"> | |
237 <title>Encoding with the libavcodec codec family</title> | |
238 | |
239 <para> | |
240 <link linkend="ffmpeg">libavcodec</link> provides simple encoding to a lot | |
241 of interesting video and audio formats (currently its audio codecs are | |
10869 | 242 unsupported). You can encode to the following codecs (more or less up to date): |
9675 | 243 |
244 <informaltable frame="all"> | |
245 <tgroup cols="2"> | |
246 <thead> | |
247 <row><entry>Codec name</entry><entry>Description</entry></row> | |
248 </thead> | |
249 <tbody> | |
250 <row><entry>mjpeg</entry><entry> | |
251 Motion JPEG | |
252 </entry></row> | |
10869 | 253 <row><entry>ljpeg</entry><entry> |
254 Lossless JPEG | |
255 </entry></row> | |
9675 | 256 <row><entry>h263</entry><entry> |
257 H263 | |
258 </entry></row> | |
259 <row><entry>h263p</entry><entry> | |
260 H263 Plus | |
261 </entry></row> | |
262 <row><entry>mpeg4</entry><entry> | |
263 ISO standard MPEG-4 (DivX 5, XVID compatible) | |
264 </entry></row> | |
265 <row><entry>msmpeg4</entry><entry> | |
266 pre-standard MPEG-4 variant by MS, v3 (aka DivX3) | |
267 </entry></row> | |
268 <row><entry>msmpeg4v2</entry><entry> | |
269 pre-standard MPEG-4 by MS, v2 (used in old asf files) | |
270 </entry></row> | |
10869 | 271 <row><entry>wmv1</entry><entry> |
9675 | 272 Windows Media Video, version 1 (aka WMV7) |
273 </entry></row> | |
10869 | 274 <row><entry>wmv2</entry><entry> |
275 Windows Media Video, version 2 (aka WMV8) | |
276 </entry></row> | |
9675 | 277 <row><entry>rv10</entry><entry> |
278 an old RealVideo codec | |
279 </entry></row> | |
280 <row><entry>mpeg1video</entry><entry> | |
10869 | 281 MPEG1 video |
282 </entry></row> | |
283 <row><entry>mpeg2video</entry><entry> | |
284 MPEG2 video | |
9675 | 285 </entry></row> |
286 <row><entry>huffyuv</entry><entry> | |
287 lossless compression | |
288 </entry></row> | |
10869 | 289 <row><entry>asv1</entry><entry> |
290 ASUS Video v1 | |
291 </entry></row> | |
292 <row><entry>asv2</entry><entry> | |
293 ASUS Video v2 | |
294 </entry></row> | |
295 <row><entry>ffv1</entry><entry> | |
296 FFmpeg's lossless video codec | |
297 </entry></row> | |
9675 | 298 </tbody> |
299 </tgroup> | |
300 </informaltable> | |
301 | |
302 The first column contains the codec names that should be passed after the | |
303 <literal>vcodec</literal> config, like: <option>-lavcopts vcodec=msmpeg4</option> | |
304 </para> | |
305 | |
306 <informalexample> | |
307 <para> | |
308 An example, with MJPEG compression: | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
309 <screen>mencoder dvd://2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -oac copy</screen> |
9675 | 310 </para> |
311 </informalexample> | |
312 </sect1> | |
313 | |
314 | |
315 <sect1 id="menc-feat-enc-images"> | |
316 <title>Encoding from multiple input image files (JPEGs,PNGs or TGAs)</title> | |
317 | |
318 <para> | |
319 <application>MEncoder</application> is capable of creating movies from one | |
320 or more JPEG, PNG or TGA files. With simple framecopy it can create MJPEG | |
321 (Motion JPEG), MPNG (Motion PNG) or MTGA (Motion TGA) files. | |
322 </para> | |
323 | |
324 <orderedlist> | |
325 <title>Explanation of the process:</title> | |
326 <listitem><para> | |
327 <application>MEncoder</application> <emphasis>decodes</emphasis> the input image(s) with | |
328 <systemitem class="library">libjpeg</systemitem> (when decoding PNGs, it | |
329 will use <systemitem class="library">libpng</systemitem>). | |
330 </para></listitem> | |
331 <listitem><para> | |
332 <application>MEncoder</application> then feeds the decoded image to the | |
333 chosen video compressor (DivX4, Xvid, ffmpeg msmpeg4, etc.). | |
334 </para></listitem> | |
335 </orderedlist> | |
336 | |
337 <formalpara> | |
338 <title>Examples</title> | |
339 <para> | |
340 The explanation of the <option>-mf</option> option can be found below in | |
341 the man page. | |
342 | |
343 <informalexample> | |
344 <para> | |
345 Creating a DivX4 file from all the JPEG files in the current dir: | |
346 <screen> | |
347 mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi \*.jpg<!-- | |
348 --></screen> | |
349 </para> | |
350 </informalexample> | |
351 | |
352 <informalexample> | |
353 <para> | |
354 Creating a DivX4 file from some JPEG files in the current dir: | |
355 <screen> | |
356 mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi frame001.jpg,frame002.jpg <!-- | |
357 --></screen> | |
358 </para> | |
359 </informalexample> | |
360 | |
361 <informalexample> | |
362 <para> | |
363 Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current | |
364 dir: | |
365 <screen> | |
366 mencoder -mf on:w=800:h=600:fps=25 -ovc copy -o output.avi \*.jpg<!-- | |
367 --></screen> | |
368 </para> | |
369 </informalexample> | |
370 | |
371 <informalexample> | |
372 <para> | |
373 Creating an uncompressed file from all the PNG files in the current dir: | |
374 <screen> | |
375 mencoder -mf on:w=800:h=600:fps=25:type=png -ovc raw -o output.avi \*.png<!-- | |
376 --></screen> | |
377 </para> | |
378 </informalexample> | |
379 | |
380 <note><para> | |
381 Width must be integer multiple of 4, it's a limitation of the RAW RGB AVI format. | |
382 </para></note> | |
383 | |
384 <informalexample> | |
385 <para> | |
386 Creating a Motion PNG (MPNG) file from all the PNG files in the current | |
387 dir: | |
388 <screen> | |
389 mencoder -mf on:w=800:h=600:fps=25:type=png -ovc copy -o output.avi \*.png<!-- | |
390 --></screen> | |
391 </para> | |
392 </informalexample> | |
393 | |
394 <informalexample> | |
395 <para> | |
396 Creating a Motion TGA (MTGA) file from all the TGA files in the current | |
397 dir: | |
398 <screen> | |
399 mencoder -mf on:w=800:h=600:fps=25:type=tga -ovc copy -o output.avi \*.tga<!-- | |
400 --></screen> | |
401 </para> | |
402 </informalexample> | |
403 | |
404 </para> | |
405 </formalpara> | |
406 </sect1> | |
407 | |
408 | |
409 <sect1 id="menc-feat-extractsub"> | |
410 <title>Extracting DVD subtitles to Vobsub file</title> | |
411 | |
412 <para> | |
413 <application>MEncoder</application> is capable of extracting subtitles from | |
414 a DVD into Vobsub fomat files. They consist of a pair of files ending in | |
415 <filename>.idx</filename> and <filename>.sub</filename> and are usually | |
416 packaged in a single <filename>.rar</filename> archive. | |
417 <application>MPlayer</application> can play these with the | |
418 <option>-vobsub</option> and <option>-vobsubid</option> options. | |
419 </para> | |
420 | |
421 <para> | |
422 You specify the basename (i.e without the <filename>.idx</filename> or | |
423 <filename>.sub</filename> extension) of the output files with | |
424 <option>-vobsubout</option> and the index for this subtitle in the | |
425 resulting files with <option>-vobsuboutindex</option>. | |
426 </para> | |
427 | |
428 <para> | |
429 If the input is not from a DVD you should use <option>-ifo</option> to | |
430 indicate the <filename>.ifo</filename> file needed to construct the | |
431 resulting <filename>.idx</filename> file. | |
432 </para> | |
433 | |
434 <para> | |
435 If the input is not from a DVD and you do not have the | |
436 <filename>.ifo</filename> file you will need to use the | |
437 <option>-vobsubid</option> option to let it know what language id to put in | |
438 the <filename>.idx</filename> file. | |
439 </para> | |
440 | |
441 <para> | |
442 Each run will append the running subtitle if the <filename>.idx</filename> | |
443 and <filename>.sub</filename> files already exist. So you should remove any | |
444 before starting. | |
445 </para> | |
446 | |
447 <example> | |
448 <title>Copying two subtitles from a DVD while doing 3-pass encoding</title> | |
449 <screen> | |
450 rm subtitles.idx subtitles.sub | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
451 mencoder dvd://1 -vobsubout subtitles -vobsuboutindex 0 -sid 2 -o frameno.avi -ovc frameno |
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
452 mencoder dvd://1 -oac copy -ovc divx4 -pass 1 |
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
453 mencoder dvd://1 -oac copy -ovc divx4 -pass 2 -vobsubout subtitles -vobsuboutindex 1 -sid 5<!-- |
9675 | 454 --></screen> |
455 </example> | |
456 | |
457 <example> | |
458 <title>Copying a french subtitle from an MPEG file</title> | |
459 <screen> | |
460 rm subtitles.idx subtitles.sub | |
461 mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 -vobsuboutid fr -sid 1<!-- | |
462 --></screen> | |
463 </example> | |
464 | |
465 </sect1> | |
466 | |
467 <sect1 id="aspect"> | |
468 <title>Preserving aspect ratio</title> | |
469 <para> | |
470 DVDs and SVCDs (i.e. MPEG1/2) files contain an aspect ratio value, which | |
10065
422876da049e
Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents:
9677
diff
changeset
|
471 describes how the player should scale the video stream, so humans won't |
9675 | 472 have egg heads (ex.: 480x480 + 4:3 = 640x480). However when encoding to AVI |
473 (DivX) files, you have be aware that AVI headers don't store this value. | |
10065
422876da049e
Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents:
9677
diff
changeset
|
474 Rescaling the movie is disgusting and time consuming, there has to be a better |
422876da049e
Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents:
9677
diff
changeset
|
475 way! |
9675 | 476 </para> |
477 | |
478 <para>There is</para> | |
479 | |
480 <para> | |
481 MPEG4 has an unique feature: the video stream can contain its needed aspect | |
10869 | 482 ratio. Yes, just like MPEG1/2 (DVD, SVCD) and H263 files. Regretfully, there are |
9675 | 483 <emphasis role="bold">no</emphasis> video players outside which support this |
10869 | 484 attribute of MPEG4, except <application>MPlayer</application>. |
9675 | 485 </para> |
486 | |
487 <para> | |
10869 | 488 This feature can be used only with <link linkend="ffmpeg">libavcodec</link>'s |
489 <systemitem>mpeg4</systemitem> codec. Keep in mind: although | |
490 <application>MPlayer</application> will correctly play the created file, | |
491 other players will use the wrong aspect ratio. | |
9675 | 492 </para> |
493 | |
494 <para> | |
495 You seriously should crop the black bands over and below the movie image. | |
10065
422876da049e
Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents:
9677
diff
changeset
|
496 See the man page for the usage of the <systemitem>cropdetect</systemitem> and |
9675 | 497 <systemitem>crop</systemitem> filters. |
498 </para> | |
499 | |
500 <para> | |
10869 | 501 Usage |
10065
422876da049e
Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents:
9677
diff
changeset
|
502 <screen>mencoder sample-svcd.mpg -ovc lavc -lavcopts vcodec=mpeg4:autoaspect -vf crop=714:548:0:14 -oac copy -o output.avi</screen> |
9675 | 503 </para> |
10869 | 504 </sect1> |
505 | |
506 <sect1 id="custommatrices"><title>Custom inter/intra matrices</title> | |
507 | |
508 <para> | |
509 With this feature of <link linkend="ffmpeg">libavcodec</link> you are | |
510 able to set custom inter (I-frames/key frames) and intra (P-frames/predicted | |
511 frames) matrices. It is supported by many of the codecs: | |
512 <systemitem>mpeg1video</systemitem> and <systemitem>mpeg2video</systemitem> | |
513 are reported as working. | |
514 </para> | |
515 | |
516 <para> | |
517 A typical usage of this feature is to set the matrices preferred by the | |
518 <ulink url="http://www.kvcd.net/">KVCD</ulink> specifications. | |
519 </para> | |
520 | |
521 <para> | |
522 The <emphasis role="bold">KVCD "Notch" Quantization Matrix:</emphasis> | |
523 </para> | |
524 | |
525 <para> | |
526 Intra: | |
527 <screen> | |
528 8 9 12 22 26 27 29 34 | |
529 9 10 14 26 27 29 34 37 | |
530 12 14 18 27 29 34 37 38 | |
531 22 26 27 31 36 37 38 40 | |
532 26 27 29 36 39 38 40 48 | |
533 27 29 34 37 38 40 48 58 | |
534 29 34 37 38 40 48 58 69 | |
535 34 37 38 40 48 58 69 79 | |
536 </screen> | |
537 | |
538 Inter: | |
539 <screen> | |
540 16 18 20 22 24 26 28 30 | |
541 18 20 22 24 26 28 30 32 | |
542 20 22 24 26 28 30 32 34 | |
543 22 24 26 30 32 32 34 36 | |
544 24 26 28 32 34 34 36 38 | |
545 26 28 30 32 34 36 38 40 | |
546 28 30 32 34 36 38 42 42 | |
547 30 32 34 36 38 40 42 44 | |
548 </screen> | |
549 </para> | |
550 | |
551 <para> | |
552 Usage: | |
553 <screen> | |
554 $ mencoder input.avi -o output.avi -oac copy -ovc lavc -lavcopts inter_matrix=...:intra_matrix=... | |
555 </screen> | |
556 </para> | |
557 | |
558 <para> | |
559 <screen> | |
560 $ mencoder input.avi -ovc lavc -lavcopts | |
561 vcodec=mpeg2video:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37, | |
562 12,14,18,27,29,34,37,38,22,26,27,31,36,37,38,40,26,27,29,36,39,38,40,48,27, | |
563 29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79 | |
564 :inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26, | |
565 28,30,32,34,22,24,26,30,32,32,34,36,24,26,28,32,34,34,36,38,26,28,30,32,34, | |
566 36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44 -oac copy -o svcd.mpg | |
567 </screen> | |
568 </para> | |
9675 | 569 </sect1> |
570 | |
571 </chapter> |