Mercurial > mplayer.hg
annotate DOCS/xml/en/mencoder.xml @ 11732:d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
improvements made by me.
author | diego |
---|---|
date | Fri, 02 Jan 2004 23:07:07 +0000 |
parents | d37d4bc38f26 |
children | 6ed241d3db16 |
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"> |
11540 | 4 <title>Encoding with <application>MEncoder</application></title> |
9675 | 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> | |
11710 | 41 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o <replaceable>movie.avi</replaceable> |
42 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o <replaceable>movie.avi</replaceable> | |
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> | |
11732
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
65 |
9675 | 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 | |
11540 | 79 bitrate <application>MEncoder</application> printed at the end of the previous pass. |
9675 | 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 |
11710 | 102 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o <replaceable>movie.avi</replaceable> |
103 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o <replaceable>movie.avi</replaceable> | |
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> | |
11680
f2f7c22847b3
added capital letter at the beginning of the sentence
paszczi
parents:
11540
diff
changeset
|
120 This feature is not very useful right now, aside that it probably has many bugs, |
11540 | 121 but the more importantly because <application>MEncoder</application> currently |
122 cannot encode MPEG1 layer 2 (MP2) audio, which all other players expect in MPEG files. | |
9675 | 123 </para> |
124 | |
125 <para> | |
11540 | 126 To change <application>MEncoder's</application> output file format, |
127 use the <option>-of mpeg</option> option. | |
9675 | 128 </para> |
129 | |
130 <para> | |
131 Example: | |
132 <screen> | |
11710 | 133 mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy <replaceable>other_options</replaceable> <replaceable>media.avi</replaceable> -o <replaceable>output.mpg</replaceable> |
9675 | 134 </screen> |
135 </para> | |
136 </sect1> | |
137 | |
138 | |
139 <sect1 id="menc-feat-rescale"> | |
140 <title>Rescaling movies</title> | |
141 | |
142 <para> | |
143 Often the need to resize movie images' size emerges. Its reasons can be | |
144 many: decreasing file size, network bandwidth,etc. Most people even do | |
145 rescaling when converting DVDs or SVCDs to DivX AVI. This is <emphasis role="bold">bad</emphasis>. | |
146 Instead of even you doing so, read the <link linkend="aspect">Preserving aspect ratio</link> | |
147 section. | |
148 </para> | |
149 | |
150 <para> | |
151 The scaling process is handled by the <literal>scale</literal> video filter: | |
9677 | 152 <option>-vf scale=<replaceable>width</replaceable>:<replaceable>height</replaceable></option>. |
9675 | 153 Its quality can be set with the <option>-sws</option> option. |
154 If it's not specified, <application>MEncoder</application> will use 0: fast | |
155 bilinear. | |
156 </para> | |
157 | |
158 <para> | |
159 Usage: | |
160 <screen> | |
9677 | 161 mencoder <replaceable>input.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=640:480-o <replaceable>output.avi</replaceable> |
9675 | 162 </screen> |
163 </para> | |
164 </sect1> | |
165 | |
166 | |
167 <sect1 id="menc-feat-streamcopy"> | |
168 <title>Stream copying</title> | |
169 | |
170 <para> | |
171 <application>MEncoder</application> can handle input streams in two ways: | |
172 <emphasis role="bold">encode</emphasis> or <emphasis role="bold">copy</emphasis> | |
173 them. This section is about <emphasis role="bold">copying</emphasis>. | |
174 </para> | |
175 | |
176 <itemizedlist> | |
177 <listitem><para> | |
178 <emphasis role="bold">Video stream</emphasis> (option <option>-ovc copy</option>): | |
179 nice stuff can be done :) Like, putting (not converting!) FLI or VIVO or | |
180 MPEG1 video into an AVI file! Of course only | |
181 <application>MPlayer</application> can play such files :) And it probably | |
182 has no real life value at all. Rationally: video stream copying can be | |
183 useful for example when only the audio stream has to be encoded (like, | |
184 uncompressed PCM to MP3). | |
185 </para></listitem> | |
186 <listitem><para> | |
187 <emphasis role="bold">Audio stream</emphasis> (option <option>-oac copy</option>): | |
188 straightforward. It is possible to take an external audio file (MP3, | |
10429 | 189 WAV) and mux it into the output stream. Use the |
9675 | 190 <option>-audiofile <replaceable>filename</replaceable></option> option |
191 for this. | |
192 </para></listitem> | |
193 </itemizedlist> | |
194 </sect1> | |
195 | |
196 | |
197 <sect1 id="menc-feat-fix-avi"> | |
198 <title>Fixing AVIs with broken index or interleaving</title> | |
199 | |
200 <para> | |
201 Easiest thing. We simply copy the video and audio streams, and | |
202 <application>MEncoder</application> generates the index. Of course this cannot fix possible bugs in | |
203 the video and/or audio streams. It also fixes files with broken interleaving, | |
204 thus the <option>-ni</option> option won't be needed for them anymore. | |
205 </para> | |
206 | |
207 <para> | |
208 Command: | |
209 <screen> | |
210 mencoder -idx <replaceable>input.avi</replaceable> -ovc copy -oac copy -o <replaceable>output.avi</replaceable><!-- | |
211 --></screen> | |
212 </para> | |
213 | |
214 | |
215 <sect2 id="menc-feat-appending"> | |
216 <title>Appending multiple AVI files</title> | |
217 | |
218 <para> | |
11540 | 219 As a side-effect, the broken AVI fixer function enables <application>MEncoder</application> |
220 to append 2 (or more) AVI files: | |
9675 | 221 </para> |
222 | |
223 <para> | |
224 Command: | |
11710 | 225 <screen>cat 1.avi 2.avi | mencoder -noidx -ovc copy -oac copy -o <replaceable>output.avi</replaceable> -</screen> |
9675 | 226 </para> |
227 | |
228 <note><para> | |
229 This expects <filename>1.avi</filename> and <filename>2.avi</filename> to use | |
230 the same codecs, resolution, stream rate etc, and at least <filename>1.avi</filename> | |
231 must not be broken. You may need to fix your input AVI files first, as described | |
232 <link linkend="menc-feat-fix-avi">above</link>. | |
233 </para></note> | |
234 </sect2> | |
235 </sect1> | |
236 | |
237 <sect1 id="menc-feat-enc-libavcodec"> | |
238 <title>Encoding with the libavcodec codec family</title> | |
239 | |
240 <para> | |
241 <link linkend="ffmpeg">libavcodec</link> provides simple encoding to a lot | |
242 of interesting video and audio formats (currently its audio codecs are | |
10869 | 243 unsupported). You can encode to the following codecs (more or less up to date): |
9675 | 244 |
245 <informaltable frame="all"> | |
246 <tgroup cols="2"> | |
247 <thead> | |
248 <row><entry>Codec name</entry><entry>Description</entry></row> | |
249 </thead> | |
250 <tbody> | |
251 <row><entry>mjpeg</entry><entry> | |
252 Motion JPEG | |
253 </entry></row> | |
10869 | 254 <row><entry>ljpeg</entry><entry> |
255 Lossless JPEG | |
256 </entry></row> | |
9675 | 257 <row><entry>h263</entry><entry> |
258 H263 | |
259 </entry></row> | |
260 <row><entry>h263p</entry><entry> | |
261 H263 Plus | |
262 </entry></row> | |
263 <row><entry>mpeg4</entry><entry> | |
264 ISO standard MPEG-4 (DivX 5, XVID compatible) | |
265 </entry></row> | |
266 <row><entry>msmpeg4</entry><entry> | |
267 pre-standard MPEG-4 variant by MS, v3 (aka DivX3) | |
268 </entry></row> | |
269 <row><entry>msmpeg4v2</entry><entry> | |
270 pre-standard MPEG-4 by MS, v2 (used in old asf files) | |
271 </entry></row> | |
10869 | 272 <row><entry>wmv1</entry><entry> |
9675 | 273 Windows Media Video, version 1 (aka WMV7) |
274 </entry></row> | |
10869 | 275 <row><entry>wmv2</entry><entry> |
276 Windows Media Video, version 2 (aka WMV8) | |
277 </entry></row> | |
9675 | 278 <row><entry>rv10</entry><entry> |
279 an old RealVideo codec | |
280 </entry></row> | |
281 <row><entry>mpeg1video</entry><entry> | |
10869 | 282 MPEG1 video |
283 </entry></row> | |
284 <row><entry>mpeg2video</entry><entry> | |
285 MPEG2 video | |
9675 | 286 </entry></row> |
287 <row><entry>huffyuv</entry><entry> | |
288 lossless compression | |
289 </entry></row> | |
10869 | 290 <row><entry>asv1</entry><entry> |
291 ASUS Video v1 | |
292 </entry></row> | |
293 <row><entry>asv2</entry><entry> | |
294 ASUS Video v2 | |
295 </entry></row> | |
296 <row><entry>ffv1</entry><entry> | |
297 FFmpeg's lossless video codec | |
298 </entry></row> | |
9675 | 299 </tbody> |
300 </tgroup> | |
301 </informaltable> | |
302 | |
303 The first column contains the codec names that should be passed after the | |
304 <literal>vcodec</literal> config, like: <option>-lavcopts vcodec=msmpeg4</option> | |
305 </para> | |
306 | |
307 <informalexample> | |
308 <para> | |
309 An example, with MJPEG compression: | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
310 <screen>mencoder dvd://2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -oac copy</screen> |
9675 | 311 </para> |
312 </informalexample> | |
313 </sect1> | |
314 | |
315 | |
316 <sect1 id="menc-feat-enc-images"> | |
317 <title>Encoding from multiple input image files (JPEGs,PNGs or TGAs)</title> | |
318 | |
319 <para> | |
320 <application>MEncoder</application> is capable of creating movies from one | |
321 or more JPEG, PNG or TGA files. With simple framecopy it can create MJPEG | |
322 (Motion JPEG), MPNG (Motion PNG) or MTGA (Motion TGA) files. | |
323 </para> | |
324 | |
325 <orderedlist> | |
326 <title>Explanation of the process:</title> | |
327 <listitem><para> | |
328 <application>MEncoder</application> <emphasis>decodes</emphasis> the input image(s) with | |
329 <systemitem class="library">libjpeg</systemitem> (when decoding PNGs, it | |
330 will use <systemitem class="library">libpng</systemitem>). | |
331 </para></listitem> | |
332 <listitem><para> | |
333 <application>MEncoder</application> then feeds the decoded image to the | |
334 chosen video compressor (DivX4, Xvid, ffmpeg msmpeg4, etc.). | |
335 </para></listitem> | |
336 </orderedlist> | |
337 | |
338 <formalpara> | |
339 <title>Examples</title> | |
340 <para> | |
341 The explanation of the <option>-mf</option> option can be found below in | |
342 the man page. | |
343 | |
344 <informalexample> | |
345 <para> | |
346 Creating a DivX4 file from all the JPEG files in the current dir: | |
347 <screen> | |
11710 | 348 mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o <replaceable>output.avi</replaceable> \*.jpg<!-- |
9675 | 349 --></screen> |
350 </para> | |
351 </informalexample> | |
352 | |
353 <informalexample> | |
354 <para> | |
355 Creating a DivX4 file from some JPEG files in the current dir: | |
356 <screen> | |
11710 | 357 mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o <replaceable>output.avi</replaceable> <replaceable>frame001.jpg,frame002.jpg</replaceable> <!-- |
9675 | 358 --></screen> |
359 </para> | |
360 </informalexample> | |
361 | |
362 <informalexample> | |
363 <para> | |
364 Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current | |
365 dir: | |
366 <screen> | |
11710 | 367 mencoder -mf on:w=800:h=600:fps=25 -ovc copy -o <replaceable>output.avi</replaceable> \*.jpg<!-- |
9675 | 368 --></screen> |
369 </para> | |
370 </informalexample> | |
371 | |
372 <informalexample> | |
373 <para> | |
374 Creating an uncompressed file from all the PNG files in the current dir: | |
375 <screen> | |
11710 | 376 mencoder -mf on:w=800:h=600:fps=25:type=png -ovc raw -o <replaceable>output.avi</replaceable> \*.png<!-- |
9675 | 377 --></screen> |
378 </para> | |
379 </informalexample> | |
380 | |
381 <note><para> | |
382 Width must be integer multiple of 4, it's a limitation of the RAW RGB AVI format. | |
383 </para></note> | |
384 | |
385 <informalexample> | |
386 <para> | |
387 Creating a Motion PNG (MPNG) file from all the PNG files in the current | |
388 dir: | |
389 <screen> | |
11710 | 390 mencoder -mf on:w=800:h=600:fps=25:type=png -ovc copy -o <replaceable>output.avi</replaceable> \*.png<!-- |
9675 | 391 --></screen> |
392 </para> | |
393 </informalexample> | |
394 | |
395 <informalexample> | |
396 <para> | |
397 Creating a Motion TGA (MTGA) file from all the TGA files in the current | |
398 dir: | |
399 <screen> | |
11710 | 400 mencoder -mf on:w=800:h=600:fps=25:type=tga -ovc copy -o <replaceable>output.avi</replaceable> \*.tga<!-- |
9675 | 401 --></screen> |
402 </para> | |
403 </informalexample> | |
404 | |
405 </para> | |
406 </formalpara> | |
407 </sect1> | |
408 | |
409 | |
410 <sect1 id="menc-feat-extractsub"> | |
411 <title>Extracting DVD subtitles to Vobsub file</title> | |
412 | |
413 <para> | |
414 <application>MEncoder</application> is capable of extracting subtitles from | |
11271
252fb0cf331a
spelling fixes, mostly by <ismail.donmez@boun.edu.tr>
diego
parents:
10913
diff
changeset
|
415 a DVD into Vobsub formatted files. They consist of a pair of files ending in |
9675 | 416 <filename>.idx</filename> and <filename>.sub</filename> and are usually |
417 packaged in a single <filename>.rar</filename> archive. | |
418 <application>MPlayer</application> can play these with the | |
419 <option>-vobsub</option> and <option>-vobsubid</option> options. | |
420 </para> | |
421 | |
422 <para> | |
423 You specify the basename (i.e without the <filename>.idx</filename> or | |
424 <filename>.sub</filename> extension) of the output files with | |
425 <option>-vobsubout</option> and the index for this subtitle in the | |
426 resulting files with <option>-vobsuboutindex</option>. | |
427 </para> | |
428 | |
429 <para> | |
430 If the input is not from a DVD you should use <option>-ifo</option> to | |
431 indicate the <filename>.ifo</filename> file needed to construct the | |
432 resulting <filename>.idx</filename> file. | |
433 </para> | |
434 | |
435 <para> | |
436 If the input is not from a DVD and you do not have the | |
437 <filename>.ifo</filename> file you will need to use the | |
438 <option>-vobsubid</option> option to let it know what language id to put in | |
439 the <filename>.idx</filename> file. | |
440 </para> | |
441 | |
442 <para> | |
443 Each run will append the running subtitle if the <filename>.idx</filename> | |
444 and <filename>.sub</filename> files already exist. So you should remove any | |
445 before starting. | |
446 </para> | |
447 | |
448 <example> | |
449 <title>Copying two subtitles from a DVD while doing 3-pass encoding</title> | |
450 <screen> | |
451 rm subtitles.idx subtitles.sub | |
10184
b6c63ab184a4
Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents:
10065
diff
changeset
|
452 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
|
453 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
|
454 mencoder dvd://1 -oac copy -ovc divx4 -pass 2 -vobsubout subtitles -vobsuboutindex 1 -sid 5<!-- |
9675 | 455 --></screen> |
456 </example> | |
457 | |
458 <example> | |
459 <title>Copying a french subtitle from an MPEG file</title> | |
460 <screen> | |
461 rm subtitles.idx subtitles.sub | |
11710 | 462 mencoder <replaceable>movie.mpg</replaceable> -ifo <replaceable>movie.ifo</replaceable> -vobsubout subtitles -vobsuboutindex 0 -vobsuboutid fr -sid 1<!-- |
9675 | 463 --></screen> |
464 </example> | |
465 | |
466 </sect1> | |
467 | |
468 <sect1 id="aspect"> | |
469 <title>Preserving aspect ratio</title> | |
470 <para> | |
471 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
|
472 describes how the player should scale the video stream, so humans won't |
9675 | 473 have egg heads (ex.: 480x480 + 4:3 = 640x480). However when encoding to AVI |
474 (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
|
475 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
|
476 way! |
9675 | 477 </para> |
478 | |
479 <para>There is</para> | |
480 | |
481 <para> | |
482 MPEG4 has an unique feature: the video stream can contain its needed aspect | |
10869 | 483 ratio. Yes, just like MPEG1/2 (DVD, SVCD) and H263 files. Regretfully, there are |
9675 | 484 <emphasis role="bold">no</emphasis> video players outside which support this |
10869 | 485 attribute of MPEG4, except <application>MPlayer</application>. |
9675 | 486 </para> |
487 | |
488 <para> | |
10869 | 489 This feature can be used only with <link linkend="ffmpeg">libavcodec</link>'s |
490 <systemitem>mpeg4</systemitem> codec. Keep in mind: although | |
491 <application>MPlayer</application> will correctly play the created file, | |
492 other players will use the wrong aspect ratio. | |
9675 | 493 </para> |
494 | |
495 <para> | |
496 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
|
497 See the man page for the usage of the <systemitem>cropdetect</systemitem> and |
9675 | 498 <systemitem>crop</systemitem> filters. |
499 </para> | |
500 | |
501 <para> | |
10869 | 502 Usage |
11710 | 503 <screen>mencoder <replaceable>sample-svcd.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4:autoaspect -vf crop=714:548:0:14 -oac copy -o <replaceable>output.avi</replaceable></screen> |
9675 | 504 </para> |
10869 | 505 </sect1> |
506 | |
507 <sect1 id="custommatrices"><title>Custom inter/intra matrices</title> | |
508 | |
509 <para> | |
510 With this feature of <link linkend="ffmpeg">libavcodec</link> you are | |
511 able to set custom inter (I-frames/key frames) and intra (P-frames/predicted | |
512 frames) matrices. It is supported by many of the codecs: | |
513 <systemitem>mpeg1video</systemitem> and <systemitem>mpeg2video</systemitem> | |
514 are reported as working. | |
515 </para> | |
516 | |
517 <para> | |
11732
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
518 A typical usage of this feature is to set the matrices preferred by the |
10869 | 519 <ulink url="http://www.kvcd.net/">KVCD</ulink> specifications. |
520 </para> | |
521 | |
522 <para> | |
523 The <emphasis role="bold">KVCD "Notch" Quantization Matrix:</emphasis> | |
524 </para> | |
525 | |
526 <para> | |
527 Intra: | |
528 <screen> | |
529 8 9 12 22 26 27 29 34 | |
530 9 10 14 26 27 29 34 37 | |
531 12 14 18 27 29 34 37 38 | |
532 22 26 27 31 36 37 38 40 | |
533 26 27 29 36 39 38 40 48 | |
534 27 29 34 37 38 40 48 58 | |
535 29 34 37 38 40 48 58 69 | |
536 34 37 38 40 48 58 69 79 | |
537 </screen> | |
538 | |
539 Inter: | |
540 <screen> | |
541 16 18 20 22 24 26 28 30 | |
542 18 20 22 24 26 28 30 32 | |
543 20 22 24 26 28 30 32 34 | |
544 22 24 26 30 32 32 34 36 | |
545 24 26 28 32 34 34 36 38 | |
546 26 28 30 32 34 36 38 40 | |
547 28 30 32 34 36 38 42 42 | |
548 30 32 34 36 38 40 42 44 | |
549 </screen> | |
550 </para> | |
551 | |
552 <para> | |
553 Usage: | |
554 <screen> | |
11710 | 555 $ mencoder <replaceable>input.avi</replaceable> -o <replaceable>output.avi</replaceable> -oac copy -ovc lavc -lavcopts inter_matrix=...:intra_matrix=... |
10869 | 556 </screen> |
557 </para> | |
558 | |
559 <para> | |
560 <screen> | |
11710 | 561 $ mencoder <replaceable>input.avi</replaceable> -ovc lavc -lavcopts |
10869 | 562 vcodec=mpeg2video:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37, |
563 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, | |
564 29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79 | |
565 :inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26, | |
566 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, | |
567 36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44 -oac copy -o svcd.mpg | |
568 </screen> | |
569 </para> | |
9675 | 570 </sect1> |
571 | |
11732
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
572 <sect1 id="menc-feat-dvd-mpeg4"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
573 <title>Making a high quality MPEG4 ("DivX") rip of a DVD movie</title> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
574 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
575 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
576 Ripping a DVD title into a maximally high quality MPEG4 (DivX) file |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
577 involves many considerations. Below is an example of the process when |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
578 there is no file size goal (other than perhaps fitting the result into 2GB). |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
579 <systemitem class="library">libavcodec</systemitem> will be used for the video, |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
580 and the audio will be copied as is without any changes. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
581 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
582 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
583 <sect2 id="menc-feat-dvd-mpeg4-crop"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
584 <title>Cropping</title> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
585 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
586 Play the DVD and run the crop detection filter |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
587 (<option>-vf cropdetect</option>) on it. This gives you a crop rectangle |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
588 to use for encoding. The reason for cropping is that many movies are |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
589 not shot in a standard DVD aspect ratio (16/9 or 4/3), or, for whatever |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
590 reason, the picture does not properly fill the frame. So you want to crop |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
591 out the pointless black bars when you rip. It also improves the quality |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
592 of the rip since the sharp edge of the black bars wastes a lot of bits. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
593 A common aspect is 2.35, which is cinescope. Most big blockbuster |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
594 movies have this aspect ratio. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
595 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
596 </sect2> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
597 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
598 <sect2 id="menc-feat-dvd-mpeg4-quality"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
599 <title>Quality level</title> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
600 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
601 Next you need to choose the desired quality level. When there is no |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
602 need to fit the resulting file on CDs or the like, using constant |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
603 quantizing AKA constant quality is a good choice. That way each frame |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
604 is given as much bits as its needs to keep the quality at the desired |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
605 level, but multiple encoding passes are not needed. With |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
606 <systemitem class="library">libavcodec</systemitem>, you get constant |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
607 quality by using |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
608 <option>-lavcopts vqscale=<replaceable>N</replaceable></option>. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
609 <option>vqscale=3</option> should give you a file below 2GB in size, |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
610 depending mainly on the movie length and video noisiness (the more |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
611 noise, the harder it is to compress.) |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
612 </para></sect2> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
613 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
614 <sect2 id="menc-feat-dvd-mpeg4-2gb"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
615 <title>Files over 2GB</title> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
616 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
617 If the file resulting from constant quality encoding is over 2GB big, |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
618 you will have to create an index to be able to view it properly. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
619 Either |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
620 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
621 <itemizedlist> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
622 <listitem><para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
623 play the file with <option>-forceidx</option> to create an index |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
624 on the fly or |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
625 </para></listitem> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
626 <listitem><para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
627 use <option>-saveidx</option> to write an index to a file once and |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
628 <option>-loadidx</option> to use it when playing the file. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
629 </para></listitem> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
630 </itemizedlist> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
631 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
632 If this bothers you, you may want to keep the file size below 2GB. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
633 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
634 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
635 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
636 There are two ways to avoid this. You can try encoding again using |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
637 <option>vqscale=4</option> and see if both the resulting file size |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
638 and picture quality are acceptable. You can also use |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
639 <link linkend="menc-feat-divx4">2 pass encoding</link>. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
640 As you will be copying the audio track as is and hence know its |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
641 bitrate, and you know the running time of the movie, you can |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
642 compute the required bitrate to give to the |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
643 <option>-lavcopts vbitrate=<replaceable>bitrate</replaceable></option> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
644 option without using |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
645 <link linkend="menc-feat-divx4">3 pass encoding</link>. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
646 </para></sect2> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
647 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
648 <sect2 id="menc-feat-dvd-mpeg4-deinterlacing"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
649 <title>Deinterlacing</title> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
650 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
651 If the movie is interlaced, you may want to deinterlace it as part of |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
652 the ripping. It is debatable whether deinterlacing should be done at |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
653 this stage. The benefit is that deinterlacing when converting to |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
654 MPEG4 makes compression better, and viewing easier and less CPU |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
655 intensive on computer monitors as no deinterlacing is required at |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
656 that stage. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
657 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
658 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
659 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
660 If deinterlacing at the ripping stage is a good idea depends on |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
661 the DVD. If the DVD is made from film, which was shot at 24 fps, you |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
662 can as well deinterlace while ripping. If, however, the original was |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
663 50/60 fps video, converting into deinterlaced 23.976/25 fps video |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
664 will lose information. If you do decide to interlace, you can further |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
665 experiment with different deinterlacing filters. See |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
666 <ulink url="http://www.wieser-web.de/MPlayer/">http://www.wieser-web.de/MPlayer/</ulink> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
667 for examples. A good starting point is <option>-vf pp=fd</option>. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
668 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
669 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
670 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
671 If you are both cropping and deinterlacing, deinterlace |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
672 <emphasis>before</emphasis> cropping. Actually, this is not necessary |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
673 if the crop offset is vertically a multiple of 2 pixels. However with |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
674 some other filters like dering you should always crop last, so it's a |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
675 good habit to put the crop filter last. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
676 </para></sect2> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
677 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
678 <sect2 id="menc-feat-dvd-mpeg4-telecine"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
679 <title>Inverse telecine</title> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
680 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
681 If you are ripping a PAL DVD, which is 25 fps, you do not need to |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
682 think about the fps. Just use 25 fps. NTSC DVDs on the other hand are |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
683 29.97 fps (often rounded to 30 fps, but that is not what they are). |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
684 If the movie was shot for TV, you again do not need to touch the fps. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
685 But if the movie was shot on film, and hence at (exactly) 24 fps, |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
686 it has been converted to 29.97 fps when making the DVD. That |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
687 conversion where 12 fields are added to each 24 frames of film is |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
688 called telecine. For more info about telecine, see a |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
689 <ulink url="http://www.google.com/search?q=telecine+field+23.976"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
690 Google search for "telecine field 23.976"</ulink>. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
691 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
692 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
693 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
694 In case you have such a telecined DVD, you will want to do inverse |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
695 telecine, that is convert the movie to 23.976 fps (29.97*4/5). |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
696 Otherwise camera panning will look jerky and awful. You can use |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
697 <option>-ofps 23.976</option> for this. Anything that is shown in |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
698 theatres is shot on film and needs inverse telecine, TV shows do not. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
699 </para></sect2> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
700 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
701 <sect2 id="menc-feat-dvd-mpeg4-scaling"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
702 <title>Scaling and aspect ratio</title> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
703 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
704 For best quality, do not scale the movie while ripping. Scaling |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
705 causes artifacts and makes the file larger. Pixels in DVD movies |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
706 are not square, so DVD movies include info about the correct aspect |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
707 ratio. It is possible to store the aspect ratio in the MPEG4 header |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
708 of the output file. Most video players ignore this info, but |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
709 <application>MPlayer</application> honors it. So if you are only |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
710 going to use <application>MPlayer</application> for viewing the |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
711 ripped file, you do not need to scale the movie, just pass |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
712 <option>-lavcopts autoaspect</option> to |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
713 <application>MEncoder</application> and things will |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
714 automagically work right. If you must scale the movie, be |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
715 careful about getting the size right especially if you do cropping. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
716 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
717 </sect2> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
718 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
719 <sect2 id="menc-feat-dvd-mpeg4-summary"> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
720 <title>Summing it up</title> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
721 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
722 With all of the above mentioned in mind, a suitable encoding command |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
723 might be |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
724 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
725 <screen> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
726 mencoder dvd://1 -aid 128 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vqscale=3:vhq:v4mv:trell:autoaspect \ |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
727 -ofps 23.976 -vf crop=720:364:0:56 -o Harry_Potter_2.avi |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
728 </screen> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
729 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
730 Here <option>dvd://1</option> gives the DVD title to rip. Option |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
731 <option>-aid 128</option> says to use audio track 128, and |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
732 <option>-oac copy</option> to copy it as is. You'll have to use |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
733 <application>MPlayer</application> to find out the right values for |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
734 these options. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
735 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
736 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
737 <para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
738 Options <option>vhq:v4mv:trell</option> for |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
739 <option>-lavcopts</option> improve quality versus bitrate, but make |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
740 encoding take longer. Especially <option>trell</option> slows |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
741 encoding down but also increases quality visibly. If you want to |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
742 deinterlace, add a <option>pp</option> filter to |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
743 <option>-vf</option>, for example |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
744 <option>-vf pp=fd,crop=720:364:0:56</option> (in that order). If you don't need |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
745 inverse telecine, leave out the <option>-ofps 23.976</option>. |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
746 </para> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
747 </sect2> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
748 |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
749 </sect1> |
d5784b575959
DVD ripping section added courtesy of Samuli K¸«£rkk¸«£inen with some
diego
parents:
11710
diff
changeset
|
750 |
9675 | 751 </chapter> |