15219
|
1 <?xml version="1.0" encoding="iso-8859-2"?>
|
15675
|
2 <!-- Synced with: 1.70 -->
|
15219
|
3 <chapter id="mencoder">
|
|
4 <title>Enkódování s <application>MEncoder</application>em</title>
|
|
5
|
|
6 <para>
|
|
7 Úplný seznam dostupných voleb a příkladů pro <application>MEncoder</application>
|
|
8 naleznete v man stránce. Řadu užitečných příkladů a podrobných návodů pro
|
|
9 použití mnoha enkódovacích voleb naleznete v
|
|
10 <ulink url="../../tech/encoding-tips.txt">tipech pro enkódování</ulink>, které
|
|
11 byly získány z několika diskusí v konferenci MPlayer-users. Prohledejte
|
|
12 <ulink url="http://mplayerhq.hu/pipermail/mplayer-users/">archivy</ulink>,
|
|
13 chcete-li bohatost diskusí o všech aspektech a problémech vztažených
|
|
14 k enkódování <application>MEncoder</application>em.
|
|
15 </para>
|
|
16
|
|
17 <sect1 id="menc-feat-mpeg4">
|
|
18 <title>Dvouprůchodové enkódování MPEG-4 ("DivX")</title>
|
|
19
|
|
20 <para>
|
|
21 Název vychází z faktu, že soubor je enkódován <emphasis>dvakrát</emphasis>.
|
|
22 První enkódování (dubbed pass) vytvoří dočasné soubory
|
|
23 (<filename>*.log</filename>) velikosti několika megabajtů, které zatím nemažte
|
|
24 (můžete smazat AVI). Ve druhém průchodu je vytvořen dvouprůchodový výstupní
|
|
25 soubor s použitím řízení datového toku z dočasných souborů. Výsledný soubor
|
|
26 bude mít lepší kvalitu obrazu. Pokud jste o tom teď slyšeli poprvé, měli byste
|
|
27 si prostudovat některé návody dostupné na netu.
|
|
28 </para>
|
|
29
|
|
30 <example>
|
|
31 <title>kopírování zvukové stopy</title>
|
|
32 <para>
|
|
33 Dvouprůchodové enkódování DVD do MPEG-4 ("DivX") AVI zatímco se zvuk
|
|
34 pouze zkopíruje.
|
|
35 <screen>
|
|
36 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o <replaceable>film.avi</replaceable>
|
|
37 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o <replaceable>film.avi</replaceable>
|
|
38 </screen>
|
|
39 </para>
|
|
40 </example>
|
|
41
|
|
42 <example>
|
|
43 <title>enkódování zvukové stopy</title>
|
|
44 <para>
|
|
45 Dvouprůchodové enkódování DVD do MPEG-4 ("DivX") AVI a současně
|
|
46 enkódování zvukové stopy do MP3.
|
|
47 <screen>
|
|
48 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac mp3lame -lameopts vbr=3 -o <replaceable>film.avi</replaceable>
|
|
49 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac mp3lame -lameopts vbr=3 -o <replaceable>film.avi</replaceable>
|
|
50 </screen>
|
|
51 </para>
|
|
52 </example>
|
|
53 </sect1>
|
|
54
|
|
55 <sect1 id="menc-feat-mpeg">
|
|
56 <title>Enkódování do MPEG formátu</title>
|
|
57 <para>
|
|
58 <application>MEncoder</application> umí vytvořit výstupní soubor formátu
|
|
59 MPEG (MPEG-PS). To je pravděpodobně použitelné pouze s <emphasis>mpeg1video</emphasis>
|
15220
|
60 kodekem z <link linkend="ffmpeg"><systemitem class="library">libavcodec</systemitem></link>, protože
|
15219
|
61 přehrávače – s výjimkou <application>MPlayer</application>u –
|
|
62 očekávají MPEG-1 video a MPEG-1 layer 2 (MP2) audio proudy v MPEG souborech.
|
|
63 </para>
|
|
64
|
|
65 <para>
|
|
66 Tato vlastnost nyní není moc užitečná, pomiňme že má asi mnoho chyb, ale hlavně
|
|
67 proto, že <application>MEncoder</application> v současnosti neumí enkódovat
|
|
68 MPEG-1 layer 2 (MP2) zvuk, který všechny ostatní přehrávače očekávají v MPEG
|
|
69 souborech.
|
|
70 </para>
|
|
71
|
|
72 <para>
|
|
73 Výstupní souborový formát <application>MEncoder</application>u změníte použitím
|
|
74 volby <option>-of mpeg</option>.
|
|
75 </para>
|
|
76
|
|
77 <para>
|
|
78 Example:
|
|
79 <screen>
|
|
80 mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy <replaceable>další_volby</replaceable> <replaceable>media.avi</replaceable> -o <replaceable>výstup.mpg</replaceable>
|
|
81 </screen>
|
|
82 </para>
|
|
83 </sect1>
|
|
84
|
|
85
|
|
86 <sect1 id="menc-feat-rescale">
|
|
87 <title>Škálování (změna velikosti) filmů</title>
|
|
88
|
|
89 <para>
|
|
90 Často potřebujeme změnit velikost obrázků ve filmu a to z mnoha důvodů: zmenšení
|
|
91 souboru, zátěže sítě atd. Mnoho lidí dokonce mění velikost při převodu DVD nebo
|
|
92 SVCD do DivX AVI. Pokud si přejete video přeškálovat, přečtěte si sekci
|
|
93 <link linkend="aspect">Zachování poměru stran</link>.
|
|
94 </para>
|
|
95
|
|
96 <para>
|
|
97 Samotný proces škálování je prováděn video filtrem <literal>scale</literal>:
|
|
98 <option>-vf scale=<replaceable>šířka</replaceable>:<replaceable>výška</replaceable></option>.
|
|
99 Jeho kvalita může být nastavena volbou <option>-sws</option>.
|
|
100 Pokud ji neuvedete, <application>MEncoder</application> použije 2: bikubickou.
|
|
101 </para>
|
|
102
|
|
103 <para>
|
|
104 Použití:
|
|
105 <screen>
|
|
106 mencoder <replaceable>vstup.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=640:480 -o <replaceable>výstup.avi</replaceable>
|
|
107 </screen>
|
|
108 </para>
|
|
109 </sect1>
|
|
110
|
|
111
|
|
112 <sect1 id="menc-feat-streamcopy">
|
|
113 <title>Proudové kopírování</title>
|
|
114
|
|
115 <para>
|
|
116 <application>MEncoder</application> může zpracovat vstupní datové proudy dvěma
|
|
117 způsoby:
|
|
118 <emphasis role="bold">enkóduje</emphasis> je, nebo je
|
|
119 <emphasis role="bold">kopíruje</emphasis>. Tato část je o
|
|
120 <emphasis role="bold">kopírování</emphasis>.
|
|
121 </para>
|
|
122
|
|
123 <itemizedlist>
|
|
124 <listitem><para>
|
|
125 <emphasis role="bold">Video proud</emphasis> (volba <option>-ovc copy</option>):
|
|
126 můžete dělat pěkné věci :) Jako umístění (nikoli konverze!) FLI nebo VIVO nebo
|
|
127 MPEG-1 videa do AVI souboru! Samozřejmě takové soubory přehraje pouze
|
|
128 <application>MPlayer</application> :) A proto to nejspíš nemá žádnou rozumnou
|
|
129 hodnotu. A teď vážně: kopírování video proudu může být užitečné například
|
|
130 tehdy, když má být enkódován pouze zvuk (např. nekomprimovaný PCM do MP3).
|
|
131 </para></listitem>
|
|
132 <listitem><para>
|
|
133 <emphasis role="bold">Audio proud</emphasis> (volba <option>-oac copy</option>):
|
|
134 jednoduché. Je možné vzít externí zvukový soubor (MP3, WAV) a namultiplexovat
|
|
135 jej do výstupního proudu. K tomu použijte volbu
|
|
136 <option>-audiofile <replaceable>soubor</replaceable></option>.
|
|
137 </para></listitem>
|
|
138 </itemizedlist>
|
|
139 </sect1>
|
|
140
|
|
141
|
|
142 <sect1 id="menc-feat-enc-libavcodec">
|
|
143 <title>Enkódování s rodinou kodeků <systemitem class="library">libavcodec</systemitem>
|
|
144 </title>
|
|
145
|
|
146 <para>
|
|
147 <link linkend="ffmpeg"><systemitem class="library">libavcodec</systemitem></link>
|
|
148 zajišťuje jednoduché enkódování do mnoha zajímavých video a audio formátů.
|
|
149 Můžete enkódovat do následujících kodeků (více méně aktuální):
|
|
150
|
|
151 <informaltable frame="all">
|
|
152 <tgroup cols="2">
|
|
153 <thead>
|
|
154 <row><entry>Jméno kodeku</entry><entry>Popis</entry></row>
|
|
155 </thead>
|
|
156 <tbody>
|
|
157 <row><entry>mjpeg</entry><entry>
|
|
158 Motion JPEG
|
|
159 </entry></row>
|
|
160 <row><entry>ljpeg</entry><entry>
|
|
161 Lossless (bezztrátový) JPEG
|
|
162 </entry></row>
|
|
163 <row><entry>h263</entry><entry>
|
|
164 H.263
|
|
165 </entry></row>
|
|
166 <row><entry>h263p</entry><entry>
|
|
167 H.263+
|
|
168 </entry></row>
|
|
169 <row><entry>mpeg4</entry><entry>
|
|
170 standardní ISO MPEG-4 (DivX 5, XVID kompatibilní)
|
|
171 </entry></row>
|
|
172 <row><entry>msmpeg4</entry><entry>
|
|
173 prvotní MPEG-4 varianta od MS, v3 (DivX3)
|
|
174 </entry></row>
|
|
175 <row><entry>msmpeg4v2</entry><entry>
|
|
176 prvotní MPEG-4 od MS, v2 (použitý ve starých asf souborech)
|
|
177 </entry></row>
|
|
178 <row><entry>wmv1</entry><entry>
|
|
179 Windows Media Video, verze 1 (WMV7)
|
|
180 </entry></row>
|
|
181 <row><entry>wmv2</entry><entry>
|
|
182 Windows Media Video, verze 2 (WMV8)
|
|
183 </entry></row>
|
|
184 <row><entry>rv10</entry><entry>
|
|
185 starý RealVideo kodek
|
|
186 </entry></row>
|
|
187 <row><entry>mpeg1video</entry><entry>
|
|
188 MPEG-1 video
|
|
189 </entry></row>
|
|
190 <row><entry>mpeg2video</entry><entry>
|
|
191 MPEG-2 video
|
|
192 </entry></row>
|
|
193 <row><entry>huffyuv</entry><entry>
|
|
194 bezztrátová komprese
|
|
195 </entry></row>
|
|
196 <row><entry>asv1</entry><entry>
|
|
197 ASUS Video v1
|
|
198 </entry></row>
|
|
199 <row><entry>asv2</entry><entry>
|
|
200 ASUS Video v2
|
|
201 </entry></row>
|
|
202 <row><entry>ffv1</entry><entry>
|
|
203 bezztrátový video kodek z FFmpeg
|
|
204 </entry></row>
|
|
205 </tbody>
|
|
206 </tgroup>
|
|
207 </informaltable>
|
|
208
|
|
209 První pole obsahuje názvy kodeků, které můžete přiřadit konfiguračnímu parametru
|
|
210 <literal>vcodec</literal>, např: <option>-lavcopts vcodec=msmpeg4</option>
|
|
211 </para>
|
|
212
|
|
213 <informalexample>
|
|
214 <para>
|
|
215 Příklad, s MJPEG kompresí:
|
|
216 <screen>mencoder dvd://2 -o titul2.avi -ovc lavc -lavcopts vcodec=mjpeg -oac copy</screen>
|
|
217 </para>
|
|
218 </informalexample>
|
|
219 </sect1>
|
|
220
|
|
221
|
|
222 <sect1 id="menc-feat-enc-images">
|
|
223 <title>Enkódování z množství vstupních obrázkových souborů (JPEG, PNG, TGA, SGI)</title>
|
|
224
|
|
225 <para>
|
|
226 <application>MEncoder</application> je schopen vytvořit film z jednoho nebo více
|
|
227 JPEG, PNG nebo TGA souborů. Pomocí jednoduchého snímkového kopírování může
|
|
228 vytvořit MJPEG (Motion JPEG), MPNG (Motion PNG) nebo MTGA (Motion TGA) soubory.
|
|
229 </para>
|
|
230
|
|
231 <orderedlist>
|
|
232 <title>Vysvětlení procesu:</title>
|
|
233 <listitem><para>
|
|
234 <application>MEncoder</application> <emphasis>dekóduje</emphasis> vstupní
|
|
235 soubor(y) pomocí knihovny <systemitem class="library">libjpeg</systemitem>
|
|
236 (když dekóduje PNG, použije <systemitem class="library">libpng</systemitem>).
|
|
237 </para></listitem>
|
|
238 <listitem><para>
|
|
239 Potom <application>MEncoder</application> nakrmí dekódovaný snímek do
|
|
240 zvoleného video kompresoru (DivX4, XviD, FFmpeg msmpeg4, atd).
|
|
241 </para></listitem>
|
|
242 </orderedlist>
|
|
243
|
|
244 <formalpara>
|
|
245 <title>Příklady</title>
|
|
246 <para>
|
|
247 Vysvětlení volby <option>-mf</option> je v man stránce.
|
|
248
|
|
249 <informalexample>
|
|
250 <para>
|
|
251 Vytvoření MPEG-4 souboru ze všech JPEG souborů v aktuálním adresáři:
|
|
252 <screen>
|
|
253 mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o <replaceable>výstup.avi</replaceable>
|
|
254 </screen>
|
|
255 </para>
|
|
256 </informalexample>
|
|
257
|
|
258 <informalexample>
|
|
259 <para>
|
|
260 Vytvoření MPEG-4 souboru z některých JPEG souborů v aktuálním adresáři:
|
|
261 <screen>
|
|
262 mencoder mf://<replaceable>snímek001.jpg,snímek002.jpg</replaceable> -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o <replaceable>výstup.avi</replaceable>
|
|
263 </screen>
|
|
264 </para>
|
|
265 </informalexample>
|
|
266
|
|
267 <informalexample>
|
|
268 <para>
|
|
269 Vytvoření Motion JPEG (MJPEG) souboru ze všech JPEG souborů v aktuálním
|
|
270 adresáři:
|
|
271 <screen>
|
|
272 mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc copy -oac copy -o <replaceable>výstup.avi</replaceable>
|
|
273 </screen>
|
|
274 </para>
|
|
275 </informalexample>
|
|
276
|
|
277 <informalexample>
|
|
278 <para>
|
|
279 Vytvoření nekomprimovaného souboru ze všech PNG souborů v aktuálním adresáři:
|
|
280 <screen>
|
|
281 mencoder mf:// -mf w=800:h=600:fps=25:type=png -ovc raw -oac copy -o <replaceable>výstup.avi</replaceable>
|
|
282 </screen>
|
|
283 </para>
|
|
284 </informalexample>
|
|
285
|
|
286 <note><para>
|
|
287 Šířka musí být celé číslo násobek 4, to je dáno omezením RAW RGB AVI formátu.
|
|
288 </para></note>
|
|
289
|
|
290 <informalexample>
|
|
291 <para>
|
|
292 Vytvoření Motion PNG (MPNG) souboru ze všech PNG souborů v aktuálním adresáři:
|
|
293 <screen>
|
|
294 mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc copy -oac copy -o <replaceable>výstup.avi</replaceable> <!--
|
|
295 --></screen>
|
|
296 </para>
|
|
297 </informalexample>
|
|
298
|
|
299 <informalexample>
|
|
300 <para>
|
|
301 Vytvoření Motion TGA (MTGA) souboru ze všech TGA souborů v aktuálním adresáři:
|
|
302 <screen>
|
|
303 mencoder mf://*.tga -mf w=800:h=600:fps=25:type=tga -ovc copy -oac copy -o <replaceable>výstup.avi</replaceable><!--
|
|
304 --></screen>
|
|
305 </para>
|
|
306 </informalexample>
|
|
307
|
|
308 </para>
|
|
309 </formalpara>
|
|
310 </sect1>
|
|
311
|
|
312
|
|
313 <sect1 id="menc-feat-extractsub">
|
|
314 <title>Extrakce DVD titulků do VOBsub souboru</title>
|
|
315
|
|
316 <para>
|
|
317 <application>MEncoder</application> je schopen vyextrahovat titulky z DVD do
|
|
318 VOBsub formátovaných souborů. Ty sestávají ze dvou souborů zakončených
|
|
319 <filename>.idx</filename> a <filename>.sub</filename> a jsou obvykle zabaleny
|
|
320 v jediném <filename>.rar</filename> archivu.
|
|
321 <application>MPlayer</application> je umí přehrávat s pomocí voleb
|
|
322 <option>-vobsub</option> a <option>-vobsubid</option>.
|
|
323 </para>
|
|
324
|
|
325 <para>
|
|
326 Zadejte základní jméno (čili bez přípony <filename>.idx</filename> nebo
|
|
327 <filename>.sub</filename>) výstupních souborů pomocí volby
|
|
328 <option>-vobsubout</option> a index pro tyto titulky ve zbývajících souborech
|
|
329 pomocí <option>-vobsuboutindex</option>.
|
|
330 </para>
|
|
331
|
|
332 <para>
|
|
333 Pokud není vstup z DVD, měli byste použít <option>-ifo</option> pro indikaci
|
|
334 <filename>.ifo</filename> souboru nutného k vytvoření výsledného
|
|
335 <filename>.idx</filename> souboru.
|
|
336 </para>
|
|
337
|
|
338 <para>
|
|
339 Pokud vstup není z DVD a nemáte <filename>.ifo</filename> soubor, budete muset
|
|
340 použít volbu <option>-vobsubid</option> k nastavení, pro které id jazyka se má
|
|
341 vytvořit <filename>.idx</filename> soubor.
|
|
342 </para>
|
|
343
|
|
344 <para>
|
|
345 Každým spuštěním se přidají běžící titulky pokud soubory <filename>.idx</filename>
|
|
346 a <filename>.sub</filename> již existují. Takže byste je měli všechny odstranit
|
|
347 dříve než začnete.
|
|
348 </para>
|
|
349
|
|
350 <example>
|
|
351 <title>Kopírování dvojích titulků z DVD během dvouprůchodového enkódování</title>
|
|
352 <screen>
|
|
353 rm titulky.idx titulky.sub
|
|
354 mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -vobsubout titulky -vobsuboutindex 0 -sid 2
|
|
355 mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -vobsubout titulky -vobsuboutindex 1 -sid 5<!--
|
|
356 --></screen>
|
|
357 </example>
|
|
358
|
|
359 <example>
|
|
360 <title>Kopírování francouzských titulků z MPEG souboru</title>
|
|
361 <screen>
|
|
362 rm titulky.idx titulky.sub
|
15675
|
363 mencoder <replaceable>film.mpg</replaceable> -ifo <replaceable>film.ifo</replaceable> -vobsubout titulky -vobsuboutindex 0 -vobsuboutid fr -sid 1 -nosound -ovc copy
|
|
364 </screen>
|
15219
|
365 </example>
|
|
366
|
|
367 </sect1>
|
|
368
|
|
369 <sect1 id="aspect">
|
|
370 <title>Zachování poměru stran</title>
|
|
371 <para>
|
|
372 DVD a SVCD (čili MPEG-1/2) soubory obsahují hodnotu poměru stran,
|
|
373 popisující, jak by měl přehrávač škálovat video proud, takže lidé nebudou mít
|
|
374 šišaté hlavy (př.: 480x480 + 4:3 = 640x480). Pokud ovšem enkódujeme do AVI
|
|
375 (DivX) souborů, mějte na paměti, že AVI hlavičky neukládají tuto hodnotu.
|
|
376 Přeškálování videa je odporné a časově náročné, takže musí být lepší způsob!
|
|
377 </para>
|
|
378
|
|
379 <para>A zde jej máte</para>
|
|
380
|
|
381 <para>
|
|
382 MPEG-4 má unikátní vlastnost: video proud může obsahovat svůj požadovaný poměr
|
|
383 stran. Ano, přesně jako MPEG-1/2 (DVD, SVCD) a H.263 soubory. Naneštěstí,
|
|
384 <emphasis role="bold">žádný</emphasis> video přehrávač nepodporuje tento atribut
|
|
385 MPEG-4, s výjimkou <application>MPlayer</application>u.
|
|
386 </para>
|
|
387
|
|
388 <para>
|
|
389 Tato vlastnost může být použita pouze s kodekem <systemitem>mpeg4</systemitem> z
|
|
390 <link linkend="ffmpeg"><systemitem class="library">libavcodec</systemitem></link>u.
|
|
391 Mějte na paměti: ačkoli
|
|
392 <application>MPlayer</application> korektně přehraje vytvořený soubor, ostatní
|
|
393 přehrávače použijí špatný poměr stran.
|
|
394 </para>
|
|
395
|
|
396 <para>
|
|
397 Opravdu byste měli oříznout černé okraje nad a pod filmem.
|
|
398 Nastudujte si použití filtrů <systemitem>cropdetect</systemitem> a
|
|
399 <systemitem>crop</systemitem> v man stránce.
|
|
400 </para>
|
|
401
|
|
402 <para>
|
|
403 Použití
|
|
404 <screen>mencoder <replaceable>vzorové-svcd.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4:autoaspect -vf crop=714:548:0:14 -oac copy -o <replaceable>výstup.avi</replaceable></screen>
|
|
405 </para>
|
|
406 </sect1>
|
|
407
|
|
408 <sect1 id="custommatrices"><title>Uživatelské inter/intra matice</title>
|
|
409
|
|
410 <para>
|
|
411 Díky této vlastnosti
|
|
412 <link linkend="ffmpeg"><systemitem class="library">libavcodec</systemitem></link>u
|
|
413 můžete nastavit uživatelskou inter (I-snímky/klíčové snímky) a intra
|
|
414 (P-snímky/predikované (rozumějte vypočítané) snímky) matice. To je podporováno
|
|
415 mnoha kodeky:
|
|
416 <systemitem>mpeg1video</systemitem> a <systemitem>mpeg2video</systemitem>
|
|
417 jsou hlášeny jako funkční.
|
|
418 </para>
|
|
419
|
|
420 <para>
|
|
421 Typické použití této vlastnosti je nastavení matic preferovaných
|
|
422 <ulink url="http://www.kvcd.net/">KVCD</ulink> specifikacemi.
|
|
423 </para>
|
|
424
|
|
425 <para>
|
|
426 <emphasis role="bold">Kvantizační Matice KVCD "Notch":</emphasis>
|
|
427 </para>
|
|
428
|
|
429 <para>
|
|
430 Intra:
|
|
431 <screen>
|
|
432 8 9 12 22 26 27 29 34
|
|
433 9 10 14 26 27 29 34 37
|
|
434 12 14 18 27 29 34 37 38
|
|
435 22 26 27 31 36 37 38 40
|
|
436 26 27 29 36 39 38 40 48
|
|
437 27 29 34 37 38 40 48 58
|
|
438 29 34 37 38 40 48 58 69
|
|
439 34 37 38 40 48 58 69 79
|
|
440 </screen>
|
|
441
|
|
442 Inter:
|
|
443 <screen>
|
|
444 16 18 20 22 24 26 28 30
|
|
445 18 20 22 24 26 28 30 32
|
|
446 20 22 24 26 28 30 32 34
|
|
447 22 24 26 30 32 32 34 36
|
|
448 24 26 28 32 34 34 36 38
|
|
449 26 28 30 32 34 36 38 40
|
|
450 28 30 32 34 36 38 42 42
|
|
451 30 32 34 36 38 40 42 44
|
|
452 </screen>
|
|
453 </para>
|
|
454
|
|
455 <para>
|
|
456 Použití:
|
|
457 <screen>
|
|
458 $ mencoder <replaceable>vstup.avi</replaceable> -o <replaceable>výstup.avi</replaceable> -oac copy -ovc lavc -lavcopts inter_matrix=...:intra_matrix=...
|
|
459 </screen>
|
|
460 </para>
|
|
461
|
|
462 <para>
|
|
463 <screen>
|
|
464 $ mencoder <replaceable>vstup.avi</replaceable> -ovc lavc -lavcopts
|
|
465 vcodec=mpeg2video:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,
|
|
466 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,
|
|
467 29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79
|
|
468 :inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,
|
|
469 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,
|
|
470 36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44 -oac copy -o svcd.mpg
|
|
471 </screen>
|
|
472 </para>
|
|
473 </sect1>
|
|
474
|
|
475 <sect1 id="menc-feat-dvd-mpeg4">
|
|
476 <title>Vytvoření MPEG-4 ("DivX") ripu DVD filmu ve vysoké kvalitě</title>
|
|
477
|
|
478 <para>
|
|
479 Velmi častou otázkou je "Jak mohu vytvořit rip v nejvyšší možné kvalitě pro
|
|
480 danou velikost?". Další otázkou je "Jak vytvořím DVD rip v nejvyšší možné
|
|
481 kvalitě? Velikost souboru mě nezajímá, chci tu nejvyšší kvalitu."
|
|
482 </para>
|
|
483
|
|
484 <para>
|
|
485 Druhá otázka je poněkud špatně položená. Konec konců, pokud je vám lhostejná
|
|
486 velikost souboru, proč prostě nezkopírujete celý MPEG-2 video proud z DVD?
|
|
487 Jistěže vaše AVI bude mít kolem 5 GB, ale pokud chcete nejvyšší kvalitu a
|
|
488 na velikosti nezáleží, je to jistě nejlepší volba.
|
|
489 </para>
|
|
490
|
|
491 <para>
|
|
492 Ve skutečnosti, důvodem převodu DVD do MPEG-4 je právě to, že vám na velikosti
|
|
493 souboru <emphasis role="bold">záleží</emphasis>.
|
|
494 </para>
|
|
495
|
|
496 <para>
|
|
497 Je těžké nabídnout kuchařku jak vytvořit DVD rip ve velmi vysoké kvalitě. Je
|
|
498 nutné uvážit množství faktorů a měli byste rozumět těmto detailům, jinak
|
|
499 budete asi zklamáni výsledkem. Níže prozkoumáme některé z těchto věcí a
|
|
500 pak se podíváme na příklad. Předpokládáme, že použijete
|
|
501 <systemitem class="library">libavcodec</systemitem> pro enkódování videa,
|
|
502 ačkoli teorie je stejná i pro ostatní kodeky.
|
|
503 </para>
|
|
504
|
|
505 <para>
|
|
506 Pokud je toho na vás moc, asi byste měli použít některý z pěkných frontendů,
|
|
507 které jsou zmíněny v
|
|
508 <ulink url="http://mplayerhq.hu/homepage/design7/projects.html#mencoder_frontends">sekci MEncoder</ulink>
|
|
509 na naší stránce odvozených projektů.
|
|
510 Takto budete schopni dosahovat vysoce kvalitních ripů bez velkého přemýšlení,
|
|
511 protože většina těchto nástrojů je navržena tak, aby dělala vhodná rozhodnutí
|
|
512 za vás.
|
|
513 </para>
|
|
514
|
15675
|
515 <sect2 id="menc-feat-dvd-mpeg4-preparing-encode">
|
|
516 <title>Příprava na enkódování: Určení zdrojového materiálu a datového toku</title>
|
|
517 <para>
|
|
518 Předtím než i jen pomyslíte na enkódování filmu, budete muset učinit
|
|
519 několik přípravných kroků.
|
|
520 </para>
|
|
521
|
|
522 <para>
|
|
523 Prvním a nejdůležitějším krokem před enkódováním by mělo být zjištění
|
|
524 druhu obsahu se kterým máte co do činění.
|
|
525 Pokud vaše zdrojové video pochází z DVD nebo veřejné/kabelové/satelitní
|
|
526 TV, bude uložen v jednom ze dvou formátů: NTSC v Severní Americe a
|
|
527 Japonsku, PAL v Euvropě, atd.
|
|
528 Je ovšem důležité si uvědomit, že to je pouze formátování pro prezentaci
|
|
529 v televizi a často <emphasis role="bold">neodpovídá</emphasis>
|
|
530 originálnímu formátu filmu.
|
|
531 Abaste dosáhli uspokojivého výsledku, musíte znát původní formát.
|
|
532 Nevezmete-li to správně v potaz, dostanete obraz plný ošklivých kombinačních
|
|
533 (proklad) artefaktů.
|
|
534 Kromě toho, že budete mít nekvalitní obraz, artefakty rovněž snižují
|
|
535 efektivitu kódování:
|
|
536 Dosáhnete horší kvality při daném datovém toku.
|
|
537 </para>
|
|
538
|
|
539 <sect3 id="menc-feat-dvd-mpeg4-preparing-encode-fps">
|
|
540 <title>Zjištění snímkové rychlosti zdroje</title>
|
|
541 <para>
|
|
542 Zde máte seznam běžných typů zdrojového materiálu, kde na který nejspíš
|
|
543 narazíte a jejich volby:
|
|
544 </para>
|
|
545 <itemizedlist>
|
|
546 <listitem><para>
|
|
547 <emphasis role="bold">Standardní film</emphasis>: Vytvořený pro promítání
|
|
548 v kině při 24fps.
|
|
549 </para></listitem>
|
|
550 <listitem><para>
|
|
551 <emphasis role="bold">PAL video</emphasis>: Zaznamenáno PAL
|
|
552 video kamerou s rychlostí 50 půlsnímků za sekundu.
|
|
553 Půlsnímek sestává jen z lichých nebo sudých řádků daného snímku.
|
|
554 Televize je navržena pro jejich střídavé zobrazování jako laciná
|
|
555 forma analogové komprese.
|
|
556 Lidské oko to pravděpodobně vykompenzuje, ale jakmile porozumíte
|
|
557 prokládání, naučíte se jej vidět i v TV a už si ji neužijete.
|
|
558 Dva půlsnímky <emphasis role="bold">netvoří</emphasis> úplný snímek,
|
|
559 protože jsou zaznamenány s časovou odchylkou 1/50 sekundy a proto se
|
|
560 nekryjí, dokud je zde pohyb.
|
|
561 </para></listitem>
|
|
562 <listitem><para>
|
|
563 <emphasis role="bold">NTSC Video</emphasis>: Zaznamenáno
|
|
564 NTSC video kamerou s rychlostí 60000/1001 půlsnímků za sekundu, nebo 60
|
|
565 půlsnímků za sekundu v době před barevnou televizí.
|
|
566 Jinak obdobné PAL.
|
|
567 </para></listitem>
|
|
568 <listitem><para>
|
|
569 <emphasis role="bold">Animovaný film</emphasis>: Obvykle kreslený při
|
|
570 24 snímcích za sekundu, ale rovněž bývá v některé variantě prměnné snímkové
|
|
571 rychlosti.
|
|
572 </para></listitem>
|
|
573 <listitem><para>
|
|
574 <emphasis role="bold">Počítačová grafika (CG)</emphasis>: Může mít jakoukoli
|
|
575 snímkovou rychlost, ale některé jsou častější než jiné; 24 a 30 snímků za
|
|
576 sekundu jsou typické pro NTSC a 25 snímků za sekundu zase pro PAL.
|
|
577 </para></listitem>
|
|
578 <listitem><para>
|
|
579 <emphasis role="bold">Starý film</emphasis>: Různé nižší snímkové rychlosti.
|
|
580 </para></listitem>
|
|
581 </itemizedlist>
|
|
582 </sect3>
|
|
583
|
|
584 <sect3 id="menc-feat-dvd-mpeg4-preparing-encode-material">
|
|
585 <title>Určení zdrojového materiálu</title>
|
|
586 <para>
|
|
587 Filmy sestávající ze snímků jsou nazývány progresivní,
|
|
588 zatímco ty složené z nezávislých půlsnímků buď prokládané, nebo
|
|
589 jen video – ačkoli druhý termín je zavádějící.
|
|
590 </para>
|
|
591 <para>
|
|
592 Abychom to ještě zkomplikovali, některé filmy mohou být směsí
|
|
593 všeho výše uvedeného.
|
|
594 </para>
|
|
595 <para>
|
|
596 Nejdůležitějším rozdílem mezi všemi těmito formáty je to, že základem
|
|
597 některých jsou snímky a jiných půlsnímky.
|
|
598 <emphasis role="bold">Vždy</emphasis>, když je film připravován pro promítání
|
|
599 v televizi (včetně DVD), je převeden na půlsnímky.
|
|
600 Různé metody jak toho lze dosáhnout jsou souhrnně nazývány "pulldown" a
|
|
601 nechvalně známé NTSC "3:2 telecine" je jednou z variant.
|
|
602 Pokud nebyl základ vašeho filmu rovněž půlsnímkový (se stejnou půlsnímkovou
|
|
603 rychlostí), máte film v jiném formátu, než byl původně.
|
|
604 </para>
|
|
605
|
|
606 <itemizedlist>
|
|
607 <title>Zde je několik běžných typů pulldown:</title>
|
|
608 <listitem><para>
|
|
609 <emphasis role="bold">PAL 2:2 pulldown</emphasis>: Je nejhezčí z nich.
|
|
610 Každý snímek je zobrazován po dobu dvou půlsnímků tak, že se oddělí liché
|
|
611 a sudé řádky a zobrazují se střídavě.
|
|
612 Pokud měl originál 24 snímků za sekundu, zrychlí se film o 4%.
|
|
613 </para></listitem>
|
|
614 <listitem><para>
|
|
615 <emphasis role="bold">PAL 2:2:2:2:2:2:2:2:2:2:2:3 pulldown</emphasis>:
|
|
616 Každý 12 snímek je zobrazen po dobu tří půlsnímků, místo dvou.
|
|
617 To odstraní nevýhodu 4% zrychlení, ale znesnadní obrácený proces.
|
|
618 Obvykle je používán pouze u hudební produkce, jelikož zde by 4% zrychlení
|
|
619 znatelně poškodilo hudební zážitek.
|
|
620 </para></listitem>
|
|
621 <listitem><para>
|
|
622 <emphasis role="bold">NTSC 3:2 telecine</emphasis>: Snímky jsou zobrazovány
|
|
623 po dobu 2 nebo 3 půlsnímků, čímž je dosaženo 2.5 krát
|
|
624 vyšší půlsnímkové rychlosti, než je originální snímková rychlost.
|
|
625 Výsledek je dále velmi mírně spomalen ze 60 půlsnímků za sekundu na
|
|
626 60000/1001 půlsnímků za sekundu, aby se dosáhlo NTSC půlsnímkové rychlosti.
|
|
627 </para></listitem>
|
|
628 <listitem><para>
|
|
629 <emphasis role="bold">NTSC 2:2 pulldown</emphasis>: Používá se pro
|
|
630 promítání 30fps materiálu na NTSC.
|
|
631 Pěkné, stejně jako 2:2 PAL pulldown.
|
|
632 </para></listitem>
|
|
633 </itemizedlist>
|
|
634
|
|
635 <para>
|
|
636 Existují rovněž metody pro konverzi mezi NTSC a PAL vieem, ale to
|
|
637 již je nad rámec této příručky.
|
|
638 Pokud se setkáte s takovým filmem a budete jej chtít enkódovat,
|
|
639 bude pro vás nejlepší opatřit si jej v originálním formátu.
|
|
640 Konverze mezi těmito formáty je vysoce destruktivní a nelze ji
|
|
641 čistě zvrátit, takže výsledek velmi utrpí, pokud je vytvořen z
|
|
642 konvertovaného materiálu.
|
|
643 </para>
|
|
644 <para>
|
|
645 Když je video ukládáno na DVD, po sobě jdoucí páry půlsnímků jsou
|
|
646 seskupovány do snímků, dokonce i když nejsou určeny pro zobrazení
|
|
647 ve stejném okamžiku.
|
|
648 Standard MPEG-2 použitý na DVD a digitální televizi poskytuje možnost
|
|
649 jak pro enkódování originálních progresivních snímků, tak pro uložení
|
|
650 informací do hlavičky snímku o počtu půlsnímků, po jejichž dobu by měl
|
|
651 být daný snímek zobrazován.
|
|
652 Pokud je použita tato metoda, film bývá často označen jako
|
|
653 "soft-telecined", jelikož proces pouze řídí DVD přehrávač pro
|
|
654 aplikaci pulldown na film spíše než že mění samotný film.
|
|
655 Tento případ je velmi upřednostňován, jalikož může být snadno
|
|
656 zvrácen (ve skutečnosti ignorován) enkodérem a proto poskytuje maximální
|
|
657 kvalitu.
|
|
658 Mnoho DVD a televizních produkčních společností však nepoužívá vhodné
|
|
659 enkódovací techniky, ale místo toho produkují filmy s
|
|
660 "hard telecine", kdy jsou ve skutečnosti půlsnímky duplikovány
|
|
661 ve výsledném MPEG-2.
|
|
662 </para>
|
|
663 <para>
|
|
664 Postupy pro tyto případy budou uvedeny později v této příručce.
|
|
665 Prozatím si řekneme několik návodů pro identifikaci o jaký typ materiálu jde:
|
|
666 </para>
|
|
667
|
|
668 <itemizedlist>
|
|
669 <title>NTSC regiony:</title>
|
|
670 <listitem><para>
|
|
671 Pokud <application>MPlayer</application> při přehrávání vypíše, že se snímková
|
|
672 rychlost změnila na 24000/1001 a již se to nezmění, pak se nejspíš jedná
|
|
673 o progresivní obsah, který byl "soft telecinován".
|
|
674 </para></listitem>
|
|
675 <listitem><para>
|
|
676 Pokud <application>MPlayer</application> ukazuje, že se snímková rychlost
|
|
677 mění tam a zpět mezi 24000/1001 a 30000/1001 a někdy vidíte
|
|
678 "combing", pak je zde několik možností.
|
|
679 Segmenty 24000/1001 fps mají téměř jistě "soft telecinovaný" progresivní
|
|
680 obsah, ale 30000/1001 fps části mohou mít buď hard-telecined 24000/1001 fps
|
|
681 obsah, nobo se jedná o 60000/1001 půlsnímků za sekundu NTSC video.
|
|
682 Použijte stejný postup jako v následujících dvou případech pro určení
|
|
683 který z nich to je.
|
|
684 </para></listitem>
|
|
685 <listitem><para>
|
|
686 Pokud <application>MPlayer</application> neukáže změnu snímkové rychlosti
|
|
687 a všechny snímky jsou zubaté, je váš film ve formátu NTSC video s 60000/1001
|
|
688 půlsnímky za sekundu.
|
|
689 </para></listitem>
|
|
690 <listitem><para>
|
|
691 Pokud <application>MPlayer</application> neukáže změnu snímkové rychlosti
|
|
692 a dva snímky z pěti vypadají zubatě, má vaše video "hard telecinovaný"
|
|
693 24000/1001fps obsah.
|
|
694 </para></listitem>
|
|
695 </itemizedlist>
|
|
696
|
|
697 <itemizedlist>
|
|
698 <title>PAL regiony:</title>
|
|
699 <listitem><para>
|
|
700 Pokud není nikde vidět žádné zubatění, je váš film 2:2 pulldown.
|
|
701 </para></listitem>
|
|
702 <listitem><para>
|
|
703 Pokud vidíte jak se objevuje a mizí zubatění každou půlsekundu,
|
|
704 pak je váš film 2:2:2:2:2:2:2:2:2:2:2:3 pulldown.
|
|
705 </para></listitem>
|
|
706 <listitem><para>
|
|
707 Pokud je zubatění vidět stále, je to PAL video s 50 půlsnímky za sekundu.
|
|
708 </para></listitem>
|
|
709 </itemizedlist>
|
|
710
|
|
711 <note><title>Rada:</title>
|
|
712 <para>
|
|
713 <application>MPlayer</application> umí spomalit přehrávání videa
|
|
714 pomocí volby -speed.
|
|
715 Zkuste použít <option>-speed</option> 0.2 pro velmi pomalé přehrávání a
|
|
716 najděte vzor, pokud jej nevidíte při plné rychlosti.
|
|
717 </para>
|
|
718 </note>
|
|
719 </sect3>
|
|
720 </sect2>
|
|
721
|
15219
|
722 <sect2 id="menc-feat-dvd-mpeg4-2pass">
|
15675
|
723 <title>Pevný kvantizer vs. více průchodů</title>
|
|
724
|
|
725 <para>
|
|
726 Enkódování vašeho videa je možné provést v široké škále kvality.
|
|
727 S moderními video enkodéry a trochou předkodekové komprese
|
|
728 (zmenšení a odšumování) je možné dosáhnout velmi dobré kvality v 700 MB,
|
|
729 pro 90-110 minut dlouhé širokoúhlé video.
|
|
730 Jinak lze všechna videa, snad kromě těch nejdelších, enkódovat v téměř
|
|
731 perfektní kvalitě do 1400 MB.
|
|
732 </para>
|
15219
|
733
|
|
734 <para>
|
|
735 Jsou tři přístupy k enkódování videa: pevný datový tok (CBR), pevný kvantizer
|
15675
|
736 a víceprůchodový (ABR, neboli průměrovaný datový tok).
|
15219
|
737 </para>
|
|
738
|
15675
|
739 <note><title>Poznámka:</title>
|
|
740 <para>
|
|
741 Většina kodeků, které podporují ABR enkódování, podporují pouze dvouprůchodové
|
|
742 enkódování, zatímco ostatní jako <systemitem class="library">x264</systemitem>
|
|
743 a <systemitem class="library">libavcodec</systemitem> podporují víceprůchodové
|
|
744 enkódování, které s každým průchodem trochu zlepší kvalitu, ačkoli toto
|
|
745 zlepšení již není viditelné, nebo měřitelné po asi čtvrtém průchodu.
|
|
746 V této sekci budeme považovat dvouprůchodové a víceprůchodové
|
|
747 enkódování za shodné.
|
|
748 </para>
|
|
749 </note>
|
|
750
|
15219
|
751 <para>
|
|
752 V každém z těchto režimů <systemitem class="library">libavcodec</systemitem>
|
|
753 rozbije videosnímek na makrobloky 16x16 pixelů a potom na každý makroblok
|
|
754 aplikuje kvantizer. Čím je nižší kvantizer, tím je vyšší kvalita a datový tok.
|
|
755 Metoda, kterou <systemitem class="library">libavcodec</systemitem> používá pro
|
|
756 určení jaký kvantizer použít pro daný makroblok, se liší a je vysoce
|
|
757 ovlivnitelná. (Toto je extrémní zjednodušení daného procesu, ale je vhodné
|
|
758 rozumět základnímu principu.)
|
|
759 </para>
|
|
760
|
|
761 <para>
|
|
762 Pokud nastavíte konstantní datový tok, <systemitem
|
|
763 class="library">libavcodec</systemitem> bude enkódovat video tak, že zahodí
|
|
764 detaily podle potřeby a jen tolik, aby se udržel pod zadaným datovým tokem.
|
|
765 Pokud je vám opravdu lhostejná velikost souboru, můžete také použít CBR a
|
|
766 nastavit datový tok na nekonečno. (V praxi to znamená nastavit hodnotu tak
|
|
767 vysoko, aby nijak neomezovala, jako 10000 Kbitů.) Bez reálného omezení
|
|
768 datového toku použije <systemitem class="library">libavcodec</systemitem>
|
|
769 nejnižší možný kvantizer pro každý makroblok (ten je nastaven pomocí
|
|
770 <option>vqmin</option>, výchozí je 2). Jakmile nastavíte dostatečně nižší
|
|
771 datový tok, takže je <systemitem class="library">libavcodec</systemitem>
|
|
772 přinucen použít vyšší kvantizer, pak téměř jistě snížíte kvalitu svého videa.
|
|
773 Abyste se tomu vyhnuli, měli byste zvážit zmenšení videa podle postupu
|
|
774 popsaného později v této příručce.
|
|
775 </para>
|
|
776
|
|
777 <para>
|
|
778 Při konstantním kvantizeru <systemitem class="library">libavcodec</systemitem>
|
|
779 používá kvantizer nastavený volbou <option>vqscale</option> na každý makroblok.
|
|
780 Pokud chcete maximálně kvalitní rip, opět bez ohledu na datový tok, můžete
|
|
781 použít <option>vqscale=2</option>. To povede ke stejnému datovému toku a PSNR
|
|
782 (odstup signál–šum) jako CBR s <option>vbitrate</option>=infinity a
|
|
783 výchozím <option>vqmin</option> rovným 2.
|
|
784 </para>
|
|
785
|
|
786 <para>
|
|
787 Problém s konstantní kvantizací je ten, že používá zadaný kvantizer ať to daný
|
|
788 makroblok potřebuje či nikoli. Je totiž možné použít vyšší kvantizer na
|
|
789 makroblok bez obětování viditelné kvality. Proč tedy plýtvat bity s nemístně
|
|
790 nízkým kvantizerem? Váše CPU má tolik cyklů, kolik máte času, ale na harddisku
|
|
791 máte jen určitý počet bitů.
|
|
792 </para>
|
|
793
|
|
794 <para>
|
|
795 Při dvouprůchodovém enkódování se v prvním průchodu projde film jakoby měl být
|
|
796 CBR, ale vlastnosti každého snímku se zaznamenají do logu. Tato data jsou pak
|
|
797 použita při druhém průchodu pro inteligentní stanovení použitého kvantizeru.
|
|
798 V rychlých scénách nebo scénách s malým počtem detailů budou častěji používány
|
|
799 vyšší kvantizery a v pomalých nebo detailních scénách zase nižší kvantizery.
|
|
800 </para>
|
|
801
|
|
802 <para>
|
|
803 Pokud použijete <option>vqscale=2</option>, plýtváte bity. Pokud použijete
|
|
804 <option>vqscale=3</option>, pak nedostanete nejkvalitnější možný rip.
|
|
805 Dejme tomu, že ripujete DVD při <option>vqscale=3</option> a
|
|
806 výsledkem je 1800Kbit. Pokud provedete dvouprůchodové enkódování
|
|
807 s <option>vbitrate=1800</option>, výsledné video bude mít <emphasis
|
|
808 role="bold">vyšší kvalitu</emphasis> při
|
|
809 <emphasis role="bold">stejném datovém toku</emphasis>.
|
|
810 </para>
|
|
811
|
|
812 <para>
|
|
813 Jelikož jsme vás nyní přesvědčili, že dvouprůchodový režim je správná volba,
|
|
814 skutečnou otázkou je, jaký datový tok použít? Odpověď je, že není jediná
|
|
815 odpověď. Ideálně byste měli zvolit takový datový tok, který zajistí nejlepší
|
|
816 rovnováhu mezi kvalitou a velikostí souboru. Ten bude pokaždé jiný
|
|
817 v závislosti na zdrojovém videu.
|
|
818 </para>
|
|
819
|
|
820 <para>
|
|
821 Pokud na velikosti souboru nezáleží, pak je dobrý startovní můstek pro rip
|
|
822 s velmi vysokou kvalitou je kolem 2000 Kbitů plus-mínus 200 Kbitů.
|
|
823 Pro rychlé akční nebo vysoce detailní zdrojové video, nebo máte-li velmi
|
|
824 kritické oko, se budete rozhodovat mezi 2400 nebo 2600.
|
|
825 U některých DVD nepoznáte rozdíl při 1400 Kbitech. Je vhodné experimentovat
|
|
826 se scénami při různých datových tocích, abyste pro to dostali cit.
|
|
827 </para>
|
|
828
|
|
829 <para>
|
|
830 Pokud se snažíte o určitou velikost, budete muset nějak spočítat datový tok.
|
|
831 Ale ještě předtím musíte zjistit, kolik místa byste měli rezervovat pro
|
|
832 zvukové(ou) stopy(u), takže byste si
|
|
833 <link linkend="menc-feat-dvd-mpeg4-audio">je měli ripnout</link> jako první.
|
|
834 Můžete si pak spočítat datový tok pomocí následující rovnice:
|
|
835 <systemitem>datový_tok = (požadovaná_velikost_v_Mbajtech - velikost_zvuku_v_Mbajtech) *
|
|
836 1024 * 1024 / délka_v_sek * 8 / 1000</systemitem>
|
|
837 Například abyste nacpali dvouhodinový film na 702MB CD, se 60MB zvukovou
|
|
838 stopou, bude muset být datový tok videa:
|
|
839 <systemitem>(702 - 60) * 1024 * 1024 / (120*60) * 8 / 1000
|
|
840 = 740kbps (kilobitů za sekundu)</systemitem>
|
|
841 </para>
|
|
842
|
|
843 </sect2>
|
|
844
|
|
845
|
|
846 <sect2 id="menc-feat-dvd-mpeg4-constraints">
|
|
847 <title>Omezení pro efektivní enkódování</title>
|
|
848
|
|
849 <para>
|
|
850 Ze samé podstaty komprese typu MPEG vyplývají určitá omezení, která byste měli
|
|
851 ctít, pokud chcete maximální kvalitu.
|
|
852 MPEG rozdělí video na čtverce 16x16 nazývané makrobloky, které se skládají
|
|
853 ze čtyř bloků 8x8 jasové (luma) složky a dvou bloků 8x8 barevné (chroma)
|
|
854 složky v polovičním rozlišení (jeden pro osu červená-cyan (modrozelená) a druhý pro osu
|
|
855 modrá-žlutá).
|
|
856 Dokonce i když šířka a výška vašeho videa nejsou násobky 16, použije enkodér
|
|
857 dostatek 16x16 makrobloků, aby pokryl celou oblast obrazu a zabere místo
|
|
858 navíc, které přijde vniveč.
|
|
859 Takže chcete-li maximalizovat kvalitu při dané velikosti souboru, není dobrý
|
|
860 nápad používat rozměry které nejsou násobky 16.
|
|
861 </para>
|
|
862
|
|
863 <para>
|
|
864 Většina DVD má také různě velké černé okraje videa. Ponechání těchto ploch
|
|
865 může různým způsobem snížit kvalitu.
|
|
866 </para>
|
|
867
|
|
868 <orderedlist>
|
|
869 <listitem>
|
|
870 <para>
|
|
871 Komprese typu MPEG je rovněž velmi závislá na plošných frekvenčních
|
|
872 transformacích, konkrétně Diskrétní Kosinové Transformaci (DCT), která se
|
|
873 podobá Fourierově transformaci. Tento druh enkódování je efektivní na
|
|
874 reprezentaci opakujících se vzorů a pozvolné přechody, ale má potíže s ostrými
|
|
875 přechody. Chcete-li je enkódovat, musíte použít mnoho bitů, jinak se objeví
|
|
876 artefakty známé jako kroužkování.
|
|
877 </para>
|
|
878
|
|
879 <para>
|
|
880 Frekvenční transformace (DCT) je provedena zvlášť pro každý makroblok
|
|
881 (ve skutečnosti na každý blok), takže problém nastane pouze tehdy, je-li ostrý
|
|
882 přechod uvnitř bloku. Pokud vaše černé okraje začínají přesně na hranicích
|
|
883 násobků 16 pixelů, pak to není problém. Černé okraje jsou však na DVD jen
|
|
884 málokdy pěkně umístěny, takže je v praxi budete muset vždy odstranit, abyste
|
|
885 se vyhnuli tomuto problému.
|
|
886 </para>
|
|
887 </listitem>
|
|
888 </orderedlist>
|
|
889
|
|
890 <para>
|
|
891 Navíc k plošně frekvenčním transformacím používá komprese typu MPEG vektory
|
|
892 pohybu k popisu změn od jednoho snímku ke druhému. Vektory pohybu přirozeně
|
|
893 pracují méně efektivně s novým obsahem přicházejícím zpoza okrajů snímku,
|
|
894 protože ten nebyl přítomen na předchozím snímku. Dokud se obraz rozšiřuje
|
|
895 směrem k okrajům snímku, nemají s tím vektory pohybu žádný problém, ale
|
|
896 jsou-li zde černé okraje, může problém nastat:
|
|
897 </para>
|
|
898
|
|
899 <orderedlist continuation="continues">
|
|
900 <listitem>
|
|
901 <para>
|
|
902 Komprese typu MPEG ukládá pro každý makroblok vektor, identifikující která
|
|
903 část předchozího obrázku by měla být zkopírována onoho makrobloku jako základ
|
|
904 pro predikci následujícího snímku. Pouze zbývající odlišnosti musí být
|
|
905 enkódovány. Pokud makroblok přesahuje okraj obrázku a obsahuje část černého
|
|
906 okraje, vektory pohybu z ostatních částí obrázku přepíší černý okraj.
|
|
907 To znamená mnoho bitů spotřebovaných buď na znovuzačernění, nebo se (spíš)
|
|
908 vektory pohybu nepoužijí vůbec a všechny změny v tomto makrobloku se budou
|
|
909 kódovat přímo. Jinými slovy se velmi sníží efektivita enkódování.
|
|
910 </para>
|
|
911
|
|
912 <para>
|
|
913 Tento problém nastává opět jen v případě, že černé okraje nezačínají na lince
|
|
914 jejíž pozice je násobkem 16.
|
|
915 </para>
|
|
916 </listitem>
|
|
917
|
|
918 <listitem>
|
|
919 <para>
|
|
920 Nakonec zde máme makroblok uvnitř obrázku do nějž se posunuje objekt z okraje
|
|
921 obrázku. Kódování typu MPEG neumí říct "zkopíruj to co je na obrázku, ale ne
|
|
922 černý okraj." Takže se zkopíruje i černý okraj a spotřebuje se spousta bitů
|
|
923 na enkódování té části obrázku, která tu měla být.
|
|
924 </para>
|
|
925
|
|
926 <para>
|
|
927 Pokud se obrázek dostane úplně ven z enkódované oblasti, má MPEG speciální
|
|
928 optimalizace pro opakované kopírování pixelů na okraj obrázku pokud přijde
|
|
929 vektor pohybu zvenčí enkódované oblasti. Tato vlastnost bude k ničemu, pokud
|
|
930 má film černé okraje. Na rozdíl od problémů 1 a 2 zde umístění okrajů na
|
|
931 násobky 16 nepomůže.
|
|
932 </para>
|
|
933 </listitem>
|
|
934
|
|
935 <listitem>
|
|
936 <para>
|
|
937 Navzdory tomu, že okraje jsou úplně černé a nikdy se nemění, je zde vždy
|
|
938 alespoň minimální datový tok spotřebovaný na větší množství makrobloků.
|
|
939 </para>
|
|
940 </listitem>
|
|
941 </orderedlist>
|
|
942
|
|
943 <para>
|
|
944 Ze všech těchto důvodů doporučujeme zcela odstranit černé okraje. Dále, pokud
|
|
945 je na okraji obrázku oblast se šumem/zkreslením, jejím odstřižením se ještě
|
|
946 zvýší efektivita enkódování. Videofilní puristé, kteří chtějí zůstat tak
|
|
947 blízko originálu, jak je to jen možné, mohou protestovat proti tomuto ořezání,
|
|
948 ale pokud nehodláte enkódovat s konstantním kvantizerem, kvalita kterou
|
|
949 dostanete díky ořezání znatelně převýší množství ztracených informací na
|
|
950 okrajích.
|
|
951 </para>
|
|
952 </sect2>
|
|
953
|
|
954
|
|
955 <sect2 id="menc-feat-dvd-mpeg4-crop">
|
|
956 <title>Ořezávání a škálování</title>
|
|
957
|
|
958 <para>
|
15377
|
959 Připomeňme z předchozí části, že konečná velikost obrázku by měla mít
|
|
960 jak šířku, tak výšku beze zbytku dělitelnou 16, čehož můžete dosáhnout
|
|
961 pomocí ořezání, škálování, nebo kombinací obou.
|
|
962 </para>
|
|
963
|
|
964 <para>
|
|
965 Při ořezávání byste se měli držet několika zásad, abyste předešli poškození
|
|
966 svého filmu.
|
|
967 Normální YUV formát 4:2:0, ukládá barvonosnou (chroma) informaci
|
|
968 podvzorkovanou, čili hustota vzorkování barvy je poloviční oproti jasové
|
|
969 (černobílé) složce v obou směrech.
|
|
970 Prohlédněte si tento diagram, kde L označuje vzorkovací body jasu a C
|
|
971 barvy.
|
|
972 </para>
|
|
973
|
|
974 <informaltable>
|
|
975 <?dbhtml table-width="40%" ?>
|
|
976 <?dbfo table-width="40%" ?>
|
|
977 <tgroup cols="8" align="center">
|
|
978 <colspec colnum="1" colname="col1"/>
|
|
979 <colspec colnum="2" colname="col2"/>
|
|
980 <colspec colnum="3" colname="col3"/>
|
|
981 <colspec colnum="4" colname="col4"/>
|
|
982 <colspec colnum="5" colname="col5"/>
|
|
983 <colspec colnum="6" colname="col6"/>
|
|
984 <colspec colnum="7" colname="col7"/>
|
|
985 <colspec colnum="8" colname="col8"/>
|
|
986 <spanspec spanname="spa1-2" namest="col1" nameend="col2"/>
|
|
987 <spanspec spanname="spa3-4" namest="col3" nameend="col4"/>
|
|
988 <spanspec spanname="spa5-6" namest="col5" nameend="col6"/>
|
|
989 <spanspec spanname="spa7-8" namest="col7" nameend="col8"/>
|
|
990 <tbody>
|
|
991 <row>
|
|
992 <entry>L</entry>
|
|
993 <entry>L</entry>
|
|
994 <entry>L</entry>
|
|
995 <entry>L</entry>
|
|
996 <entry>L</entry>
|
|
997 <entry>L</entry>
|
|
998 <entry>L</entry>
|
|
999 <entry>L</entry>
|
|
1000 </row>
|
|
1001 <row>
|
|
1002 <entry spanname="spa1-2">C</entry>
|
|
1003 <entry spanname="spa3-4">C</entry>
|
|
1004 <entry spanname="spa5-6">C</entry>
|
|
1005 <entry spanname="spa7-8">C</entry>
|
|
1006 </row>
|
|
1007 <row>
|
|
1008 <entry>L</entry>
|
|
1009 <entry>L</entry>
|
|
1010 <entry>L</entry>
|
|
1011 <entry>L</entry>
|
|
1012 <entry>L</entry>
|
|
1013 <entry>L</entry>
|
|
1014 <entry>L</entry>
|
|
1015 <entry>L</entry>
|
|
1016 </row>
|
|
1017 <row>
|
|
1018 <entry>L</entry>
|
|
1019 <entry>L</entry>
|
|
1020 <entry>L</entry>
|
|
1021 <entry>L</entry>
|
|
1022 <entry>L</entry>
|
|
1023 <entry>L</entry>
|
|
1024 <entry>L</entry>
|
|
1025 <entry>L</entry>
|
|
1026 </row>
|
|
1027 <row>
|
|
1028 <entry spanname="spa1-2">C</entry>
|
|
1029 <entry spanname="spa3-4">C</entry>
|
|
1030 <entry spanname="spa5-6">C</entry>
|
|
1031 <entry spanname="spa7-8">C</entry>
|
|
1032 </row>
|
|
1033 <row>
|
|
1034 <entry>L</entry>
|
|
1035 <entry>L</entry>
|
|
1036 <entry>L</entry>
|
|
1037 <entry>L</entry>
|
|
1038 <entry>L</entry>
|
|
1039 <entry>L</entry>
|
|
1040 <entry>L</entry>
|
|
1041 <entry>L</entry>
|
|
1042 </row>
|
|
1043 </tbody>
|
|
1044 </tgroup>
|
|
1045 </informaltable>
|
|
1046
|
|
1047 <para>
|
|
1048 Jak vidíte, řádky i sloupce obrázku se přirozeně párují. Při ořezávání tedy
|
|
1049 <emphasis>musí</emphasis> být hodnoty odsazení i rozměrů sudá čísla.
|
|
1050 Pokud nejsou, nebude se barvonosná informace zprávně krýt s jasovou.
|
|
1051 Teoreticky lze stříhat s lichým odsazením, ale to vyžaduje převzorkování
|
|
1052 barvy, což je potenciálně ztrátový úkon a není podporován filtrem crop.
|
|
1053 </para>
|
|
1054
|
|
1055 <para>
|
|
1056 Dále, prokládané video je vzorkováno takto:
|
|
1057 </para>
|
|
1058
|
|
1059 <informaltable>
|
|
1060 <?dbhtml table-width="80%" ?>
|
|
1061 <?dbfo table-width="80%" ?>
|
|
1062 <tgroup cols="16" align="center">
|
|
1063 <colspec colnum="1" colname="col1"/>
|
|
1064 <colspec colnum="2" colname="col2"/>
|
|
1065 <colspec colnum="3" colname="col3"/>
|
|
1066 <colspec colnum="4" colname="col4"/>
|
|
1067 <colspec colnum="5" colname="col5"/>
|
|
1068 <colspec colnum="6" colname="col6"/>
|
|
1069 <colspec colnum="7" colname="col7"/>
|
|
1070 <colspec colnum="8" colname="col8"/>
|
|
1071 <colspec colnum="9" colname="col9"/>
|
|
1072 <colspec colnum="10" colname="col10"/>
|
|
1073 <colspec colnum="11" colname="col11"/>
|
|
1074 <colspec colnum="12" colname="col12"/>
|
|
1075 <colspec colnum="13" colname="col13"/>
|
|
1076 <colspec colnum="14" colname="col14"/>
|
|
1077 <colspec colnum="15" colname="col15"/>
|
|
1078 <colspec colnum="16" colname="col16"/>
|
|
1079 <spanspec spanname="spa1-2" namest="col1" nameend="col2"/>
|
|
1080 <spanspec spanname="spa3-4" namest="col3" nameend="col4"/>
|
|
1081 <spanspec spanname="spa5-6" namest="col5" nameend="col6"/>
|
|
1082 <spanspec spanname="spa7-8" namest="col7" nameend="col8"/>
|
|
1083 <spanspec spanname="spa9-10" namest="col9" nameend="col10"/>
|
|
1084 <spanspec spanname="spa11-12" namest="col11" nameend="col12"/>
|
|
1085 <spanspec spanname="spa13-14" namest="col13" nameend="col14"/>
|
|
1086 <spanspec spanname="spa15-16" namest="col15" nameend="col16"/>
|
|
1087 <tbody>
|
|
1088 <row>
|
|
1089 <entry namest="col1" nameend="col8">Horní půlsnímek</entry>
|
|
1090 <entry namest="col9" nameend="col16">Spodní půlsnímek</entry>
|
|
1091 </row>
|
|
1092 <row>
|
|
1093 <entry>L</entry>
|
|
1094 <entry>L</entry>
|
|
1095 <entry>L</entry>
|
|
1096 <entry>L</entry>
|
|
1097 <entry>L</entry>
|
|
1098 <entry>L</entry>
|
|
1099 <entry>L</entry>
|
|
1100 <entry>L</entry>
|
|
1101 <entry></entry>
|
|
1102 <entry></entry>
|
|
1103 <entry></entry>
|
|
1104 <entry></entry>
|
|
1105 <entry></entry>
|
|
1106 <entry></entry>
|
|
1107 <entry></entry>
|
|
1108 <entry></entry>
|
|
1109 </row>
|
|
1110 <row>
|
|
1111 <entry spanname="spa1-2">C</entry>
|
|
1112 <entry spanname="spa3-4">C</entry>
|
|
1113 <entry spanname="spa5-6">C</entry>
|
|
1114 <entry spanname="spa7-8">C</entry>
|
|
1115 <entry></entry>
|
|
1116 <entry></entry>
|
|
1117 <entry></entry>
|
|
1118 <entry></entry>
|
|
1119 <entry></entry>
|
|
1120 <entry></entry>
|
|
1121 <entry></entry>
|
|
1122 <entry></entry>
|
|
1123 </row>
|
|
1124 <row>
|
|
1125 <entry></entry>
|
|
1126 <entry></entry>
|
|
1127 <entry></entry>
|
|
1128 <entry></entry>
|
|
1129 <entry></entry>
|
|
1130 <entry></entry>
|
|
1131 <entry></entry>
|
|
1132 <entry></entry>
|
|
1133 <entry>L</entry>
|
|
1134 <entry>L</entry>
|
|
1135 <entry>L</entry>
|
|
1136 <entry>L</entry>
|
|
1137 <entry>L</entry>
|
|
1138 <entry>L</entry>
|
|
1139 <entry>L</entry>
|
|
1140 <entry>L</entry>
|
|
1141 </row>
|
|
1142 <row>
|
|
1143 <entry>L</entry>
|
|
1144 <entry>L</entry>
|
|
1145 <entry>L</entry>
|
|
1146 <entry>L</entry>
|
|
1147 <entry>L</entry>
|
|
1148 <entry>L</entry>
|
|
1149 <entry>L</entry>
|
|
1150 <entry>L</entry>
|
|
1151 <entry></entry>
|
|
1152 <entry></entry>
|
|
1153 <entry></entry>
|
|
1154 <entry></entry>
|
|
1155 <entry></entry>
|
|
1156 <entry></entry>
|
|
1157 <entry></entry>
|
|
1158 <entry></entry>
|
|
1159 </row>
|
|
1160 <row>
|
|
1161 <entry></entry>
|
|
1162 <entry></entry>
|
|
1163 <entry></entry>
|
|
1164 <entry></entry>
|
|
1165 <entry></entry>
|
|
1166 <entry></entry>
|
|
1167 <entry></entry>
|
|
1168 <entry></entry>
|
|
1169 <entry spanname="spa9-10">C</entry>
|
|
1170 <entry spanname="spa11-12">C</entry>
|
|
1171 <entry spanname="spa13-14">C</entry>
|
|
1172 <entry spanname="spa15-16">C</entry>
|
|
1173 </row>
|
|
1174 <row>
|
|
1175 <entry></entry>
|
|
1176 <entry></entry>
|
|
1177 <entry></entry>
|
|
1178 <entry></entry>
|
|
1179 <entry></entry>
|
|
1180 <entry></entry>
|
|
1181 <entry></entry>
|
|
1182 <entry></entry>
|
|
1183 <entry>L</entry>
|
|
1184 <entry>L</entry>
|
|
1185 <entry>L</entry>
|
|
1186 <entry>L</entry>
|
|
1187 <entry>L</entry>
|
|
1188 <entry>L</entry>
|
|
1189 <entry>L</entry>
|
|
1190 <entry>L</entry>
|
|
1191 </row>
|
|
1192 <row>
|
|
1193 <entry>L</entry>
|
|
1194 <entry>L</entry>
|
|
1195 <entry>L</entry>
|
|
1196 <entry>L</entry>
|
|
1197 <entry>L</entry>
|
|
1198 <entry>L</entry>
|
|
1199 <entry>L</entry>
|
|
1200 <entry>L</entry>
|
|
1201 <entry></entry>
|
|
1202 <entry></entry>
|
|
1203 <entry></entry>
|
|
1204 <entry></entry>
|
|
1205 <entry></entry>
|
|
1206 <entry></entry>
|
|
1207 <entry></entry>
|
|
1208 <entry></entry>
|
|
1209 </row>
|
|
1210 <row>
|
|
1211 <entry spanname="spa1-2">C</entry>
|
|
1212 <entry spanname="spa3-4">C</entry>
|
|
1213 <entry spanname="spa5-6">C</entry>
|
|
1214 <entry spanname="spa7-8">C</entry>
|
|
1215 <entry></entry>
|
|
1216 <entry></entry>
|
|
1217 <entry></entry>
|
|
1218 <entry></entry>
|
|
1219 <entry></entry>
|
|
1220 <entry></entry>
|
|
1221 <entry></entry>
|
|
1222 <entry></entry>
|
|
1223 </row>
|
|
1224 <row>
|
|
1225 <entry></entry>
|
|
1226 <entry></entry>
|
|
1227 <entry></entry>
|
|
1228 <entry></entry>
|
|
1229 <entry></entry>
|
|
1230 <entry></entry>
|
|
1231 <entry></entry>
|
|
1232 <entry></entry>
|
|
1233 <entry>L</entry>
|
|
1234 <entry>L</entry>
|
|
1235 <entry>L</entry>
|
|
1236 <entry>L</entry>
|
|
1237 <entry>L</entry>
|
|
1238 <entry>L</entry>
|
|
1239 <entry>L</entry>
|
|
1240 <entry>L</entry>
|
|
1241 </row>
|
|
1242 <row>
|
|
1243 <entry>L</entry>
|
|
1244 <entry>L</entry>
|
|
1245 <entry>L</entry>
|
|
1246 <entry>L</entry>
|
|
1247 <entry>L</entry>
|
|
1248 <entry>L</entry>
|
|
1249 <entry>L</entry>
|
|
1250 <entry>L</entry>
|
|
1251 <entry></entry>
|
|
1252 <entry></entry>
|
|
1253 <entry></entry>
|
|
1254 <entry></entry>
|
|
1255 <entry></entry>
|
|
1256 <entry></entry>
|
|
1257 <entry></entry>
|
|
1258 <entry></entry>
|
|
1259 </row>
|
|
1260 <row>
|
|
1261 <entry></entry>
|
|
1262 <entry></entry>
|
|
1263 <entry></entry>
|
|
1264 <entry></entry>
|
|
1265 <entry></entry>
|
|
1266 <entry></entry>
|
|
1267 <entry></entry>
|
|
1268 <entry></entry>
|
|
1269 <entry spanname="spa9-10">C</entry>
|
|
1270 <entry spanname="spa11-12">C</entry>
|
|
1271 <entry spanname="spa13-14">C</entry>
|
|
1272 <entry spanname="spa15-16">C</entry>
|
|
1273 </row>
|
|
1274 <row>
|
|
1275 <entry></entry>
|
|
1276 <entry></entry>
|
|
1277 <entry></entry>
|
|
1278 <entry></entry>
|
|
1279 <entry></entry>
|
|
1280 <entry></entry>
|
|
1281 <entry></entry>
|
|
1282 <entry></entry>
|
|
1283 <entry>L</entry>
|
|
1284 <entry>L</entry>
|
|
1285 <entry>L</entry>
|
|
1286 <entry>L</entry>
|
|
1287 <entry>L</entry>
|
|
1288 <entry>L</entry>
|
|
1289 <entry>L</entry>
|
|
1290 <entry>L</entry>
|
|
1291 </row>
|
|
1292 </tbody>
|
|
1293 </tgroup>
|
|
1294 </informaltable>
|
|
1295
|
|
1296 <para>
|
|
1297 Jak vidíte, tak se vzor opakuje každé 4 řádky, takže při ořezu prokládaného
|
|
1298 videa musí být odsazení v ose y a výška beze zbytku delitelné 4.
|
|
1299 </para>
|
|
1300
|
|
1301 <para>
|
15219
|
1302 Nativní DVD rozlišení je 720x480 pro NTSC a 720x576 pro PAL, ale je zde ještě
|
|
1303 příznak poměru stran, který udává, zda se jedná o obrazovku (full-screen)(4:3),
|
|
1304 nebo širokoúhlý film (wide-screen)(16:9). Mnoho (jestli ne většina)
|
|
1305 širokoúhlých DVD není přesně 16:9, ale bude buď 1.85:1 anebo 2.35:1
|
|
1306 (cinescope). To znamená, že zde budou ve videu černé okraje, které bude nutné
|
|
1307 odstřihnout.
|
|
1308 </para>
|
|
1309
|
|
1310 <para>
|
|
1311 <application>MPlayer</application> poskytuje filtr pro detekci potřebného
|
|
1312 ořezu, který stanoví ořezový obdélník (<option>-vf cropdetect</option>).
|
15377
|
1313 Spusťte <application>MPlayer</application> s volbou
|
|
1314 <option>-vf cropdetect</option> a on vám vypíše nastavení filtru crop pro
|
|
1315 ořezání okrajů.
|
|
1316 Měli byste nechat běžet film tak dlouho, dokud není použita celá plocha
|
|
1317 obrázku, abyste dostali správné hodnoty crop.
|
|
1318 </para>
|
|
1319
|
|
1320 <para>
|
|
1321 Pak otestujte získané hodnoty z příkazového řádku
|
|
1322 <application>MPlayer</application>u vypisované <option>cropdetect</option>em
|
|
1323 a upravte obdélník podle potřeby.
|
|
1324 V tom vám pomůže filtr <option>rectangle</option>, který interaktivně
|
|
1325 nastavit obdélník pro váš film.
|
|
1326 Nezapomeňte zachovat výše uvedená doporučení, abyste nepoškodili barevnou
|
|
1327 mapu.
|
|
1328 </para>
|
|
1329
|
|
1330 <para>
|
|
1331 Škálování je obvykle nevhodné.
|
|
1332 Škálování prokládaného videa je obtížné a pokud chcete zachovat prokládání,
|
|
1333 měli byste se mu úplně vyhnout.
|
|
1334 Pokud mebudete škálovat, ale budete chtít používat rozměry v násobcích 16,
|
|
1335 budete muset oříznout i část obrazu.
|
|
1336 Neponechávejte ani malé černé okraje, jelikož se velmi špatně kódují!
|
|
1337 </para>
|
|
1338
|
|
1339 <para>
|
15219
|
1340 Protože MPEG-4 používá makrobloky 16x16, měli byste se ujistit, že oba rozměry
|
|
1341 videa jsou násobkem 16, jinak snížíte kvalitu, zvlášť při nízkých datových
|
|
1342 tocích. Můžete to zajistit zaokrouhlením šířky a výšky ořezového obdélníku
|
15377
|
1343 dolů na nejbližší násobek 16.
|
|
1344 Jak jsme již řekli, měli byste při ořezávání zvýšit odsazení
|
15219
|
1345 (offset) v ose y o polovinu rozdílu mezi starou a novou výškou, takže bude
|
|
1346 výsledné video bráno ze středu snímku. Z důvodu principu vzorkování DVD videa
|
|
1347 se ujistěte, že je odsazení sudé číslo. (Popravdě, přijměte jako pravidlo,
|
|
1348 nikdy nepoužívat liché hodnoty pro jakýkoli z parametrů při ořezávání a
|
|
1349 škálování videa.) Pokud nechcete zahodit těch několik pixelů navíc, můžete
|
|
1350 místo toho raději změnit velikost videa (škálovat). Na to se podíváme
|
|
1351 v příkladu níže.
|
|
1352 V praxi můžete nechat filtr <option>cropdetect</option> udělat všechnu práci
|
|
1353 zmíněnou výše, jelikož má volitelný parametr <option>round</option>
|
|
1354 (zaokrouhlení), jehož výchozí hodnota je 16.
|
|
1355 </para>
|
|
1356
|
|
1357 <para>
|
|
1358 Rovněž buďte opatrní na "napůl černé" pixely na okrajích. Vždy je rovněž
|
|
1359 odstřihněte, jinak zde budete plýtvat bity, které můžete použít jinde.
|
|
1360 </para>
|
|
1361
|
|
1362 <para>
|
|
1363 Poté co provedete vše, co jsme si doposud řekli, budete mít video, které asi
|
|
1364 nebude právě 1.85:1 nebo 2.35:1, ale někde poblíž. Můžete spočítat nový poměr
|
|
1365 stran ručně, ale <application>MEncoder</application> nabízí volbu pro
|
15220
|
1366 <systemitem class="library">libavcodec</systemitem> nazývanou <option>autoaspect</option>,
|
15219
|
1367 která to za vás udělá. Nezvětšujte video jen proto, abyste dosáhli čtvercových
|
|
1368 pixelů, pokud je vám milé místo na disku. Škálování by mělo být provedeno při
|
|
1369 přehrávání, kdy přehrávač použije poměr stran uložený v AVI pro zajištění
|
|
1370 správného rozlišení.
|
|
1371 Naneštěstí ne všechny přehrávače uplatňují tuto autoškálovací informaci,
|
|
1372 takže můžete přece jen chtít škálovat.
|
|
1373 </para>
|
|
1374
|
|
1375 <para>
|
|
1376 Nejdřív byste si měli spočítat enkódovaný poměr stran:
|
|
1377 <systemitem>PSo = (Šo x (PSa / PRdvd )) / Vo</systemitem>
|
|
1378 <itemizedlist>
|
|
1379 <title>kde:</title>
|
|
1380 <listitem><para>
|
|
1381 Šo a Vo jsou šířka a výška ořezaného videa,
|
|
1382 </para></listitem>
|
|
1383 <listitem><para>
|
15675
|
1384 PSa je zobrazovaný poměr stran, jež je obvykle 4/3 nebo 16/9,
|
|
1385 </para></listitem>
|
|
1386 <listitem><para>
|
15219
|
1387 PRdvd je poměr pixelů v DVD, který je roven 1.25=(720/576) pro DVD
|
|
1388 v PALu a 1.5=(720/480) pro DVD v NTSC,
|
|
1389 </para></listitem>
|
|
1390 </itemizedlist>
|
|
1391 </para>
|
|
1392
|
|
1393 <para>
|
|
1394 Pak si můžete spočítat rozlišení X a Y podle určitého faktoru kvality komprese
|
|
1395 (CQ):
|
|
1396 <systemitem>RozY = INT(SQRT( 1000*Datový_tok/25/PSo/CQ )/16) * 16</systemitem>
|
15675
|
1397 a
|
15219
|
1398 <systemitem>RozX = INT( RozY * PSo / 16) * 16</systemitem>
|
|
1399 </para>
|
|
1400
|
|
1401 <para>
|
|
1402 Dobře, ale co je ten CQ?
|
|
1403 CQ odpovídá počtu bitů na pixel a na snímek v zakódování. Jinými slovy, čím
|
|
1404 vyšší je CQ, tím nižší je šance uvidět enkódovací artefakty.
|
|
1405 Pokud ovšem máte cílový rozměr vašeho filmu (1 nebo 2 CD například), máte jen
|
|
1406 omezené množství bitů, které můžete spotřebovat; takže je nutné najít vhodný
|
|
1407 kompromis mezi komprimovatelností a kvalitou.
|
|
1408 </para>
|
|
1409
|
|
1410 <para>
|
|
1411 CQ závisí jak na datovém toku, tak na rozlišení filmu. Abyste zvýšili CQ,
|
|
1412 obvykle zmenšíte daný film, takže je datový tok spočítán ve funkci cílové
|
|
1413 velikosti a délky filmu, které jsou konstantní.
|
|
1414 CQ pod 0.18 obvykle vede k velmi čtverečkovanému obrazu, protože není dostatek
|
|
1415 bitů pro zakódování informací každého makrobloku (MPEG4, stejně jako mnoho
|
|
1416 jiných kodeků seskupuje pixely do bloků při komprimaci obrázku; pokud není
|
|
1417 dostatek bitů, jsou viditelné hranice těchto bloků).
|
|
1418 Proto je rozumné volit CQ v rozmezí 0.20 až 0.22 pro rip na 1 CD a
|
|
1419 0.26 až 0.28 pro 2 CD.
|
|
1420 </para>
|
|
1421
|
|
1422 <para>
|
|
1423 Prosíme berte v potaz, že CQ je jen informační pomůcka závisející na
|
|
1424 enkódovaném obsahu. CQ okolo 0.18 může být dostatečně dobrý pro Bergmana,
|
|
1425 na rozdíl od filmu jako je Matrix, který obsahuje mnoho rychlých scén.
|
|
1426 Na druhou stranu je zbytečné zvyšovat CQ výš než 0.30, jelikož budete plýtvat
|
|
1427 bity za minimální zisk kvality.
|
|
1428 </para>
|
|
1429
|
|
1430 </sect2>
|
|
1431
|
|
1432 <sect2 id="menc-feat-dvd-mpeg4-audio">
|
|
1433 <title>Zvuk</title>
|
|
1434
|
|
1435 <para>
|
|
1436 Zvuk je mnohem jednodušší problém k řešení: pokud prahnete po kvalitě, prostě
|
|
1437 jej nechte tak jak je.
|
|
1438 Dokonce i AC3 5.1 datové proudy mají nanejvýš 448Kbitů/s a stojí za každý bit.
|
|
1439 Možná jste v pokušení převést zvuk do Ogg Vorbis při vysoké kvalitě, ale jen
|
|
1440 proto, že dnes nemáte A/V receiver pro hardwarové dekódování AC3 neznamená,
|
|
1441 že jej nebudete mít zítra. Připravte své DVD ripy zachováním AC3 datových
|
|
1442 proudů.
|
|
1443 Datový proud AC3 můžete zachovat buď jeho zkopírováním přímo do video proudu
|
|
1444 <link linkend="menc-feat-mpeg4">během enkódování</link>.
|
|
1445 Také můžete extrahovat AC3 proud, abyste jej pak namixovali do nosičů jako je
|
|
1446 NUT nebo Matroska.
|
|
1447 <screen>mplayer <replaceable>zdrojový_soubor.vob</replaceable> -aid 129 -dumpaudio -dumpfile <replaceable>zvuk.ac3</replaceable></screen>
|
|
1448 vytáhne do souboru <replaceable>zvuk.ac3</replaceable> zvukovou stopu
|
|
1449 číslo 129 ze souboru <replaceable>zdrojový_soubor.vob</replaceable> (NB: DVD
|
|
1450 VOB soubory obvykle používají odlišné číslování audia,
|
|
1451 což znamená, že VOB zvuková stopa 120 je druhou zvukovou stopou v souboru).
|
|
1452 </para>
|
|
1453
|
|
1454 <para>
|
|
1455 Někdy ovšem opravdu nemáte jinou možnost než dále zkomprimovat zvuk, aby vám
|
|
1456 zbylo více bitů na video.
|
|
1457 Většina lidí volí komprimaci buď pomocí MP3 nebo Vorbis audio kodeků.
|
|
1458 Zatímco ten druhý je efektivnější z prostorového hlediska, MP3 je lépe
|
|
1459 podporován hardwarovými přehrávači, ačkoli časy se mění.
|
|
1460 </para>
|
|
1461
|
|
1462 <para>
|
|
1463 Nejdříve ze všeho budete muset převést DVD zvuk do WAV souboru, který pak
|
|
1464 použije zvukový kodek jako vstup.
|
|
1465 Například:
|
|
1466 <screen>mplayer <replaceable>zdrojový_soubor.vob</replaceable> -ao pcm:file=<replaceable>výsledný_zvuk.wav</replaceable> -vc dummy -aid 1 -vo null</screen>
|
|
1467 vylije druhou zvukovou stopu ze souboru
|
|
1468 <replaceable>zdrojový_soubor.vob</replaceable> do souboru
|
|
1469 <replaceable>výsledný_zvuk.wav</replaceable>.
|
|
1470 Měli byste normalizovat zvuk před enkódováním, protože DVD zvukové stopy jsou
|
|
1471 obvykle nahrávány při nízkých hlasitostech.
|
|
1472 Můžete například použít nástroj <application>normalize</application>, který je
|
|
1473 k dispozici ve většině distribucí.
|
|
1474 Pokud používáte Windows, stejnou práci udělá nástroj jako
|
|
1475 <application>BeSweet</application>.
|
|
1476 Komprimovat budete buď ve Vorbisu nebo MP3.
|
|
1477 Například:
|
|
1478 <screen>oggenc -q1 <replaceable>cílový_zvuk.wav</replaceable></screen>
|
|
1479 provede enkódování <replaceable>cílového_zvuku.wav</replaceable> s kvalitou 1,
|
|
1480 která přibližně odpovídá 80Kb/s a je to minimální kvalita na kterou byste měli
|
|
1481 enkódovat, pokud vám záleží na kvalitě.
|
|
1482 Poznamenejme, že <application>MEncoder</application> v současnosti neumí
|
|
1483 muxovat Vorbis zvukové stopy do výstupního souboru, protože podporuje pouze
|
|
1484 AVI a MPEG kontejnery jako výstup. Pro oba platí, že některé přehrávače mohou
|
|
1485 mít problémy s udržením audio/video synchronizace, pokud je přítomen VBR zvuk
|
|
1486 jako je Vorbis.
|
|
1487 Nemějte obavy, v tomto dokumentu vám ukážeme, jak to lze udělat pomocí
|
|
1488 programů třetích stran.
|
|
1489 </para>
|
|
1490
|
|
1491 </sect2>
|
|
1492
|
|
1493 <sect2 id="menc-feat-dvd-mpeg4-interlacing">
|
|
1494 <title>Prokládání a Telecine</title>
|
|
1495
|
|
1496 <para>
|
|
1497 Téměř veškeré filmy jsou natáčeny při 24 snímcích/s. Jelikož NTSC má
|
|
1498 snímkovou rychlost 30000/1001 snímků/s, je třeba provést úpravu těchto
|
|
1499 24 snímků/s videí, aby měly správnou NTSC snímkovou rychlost. Tato úprava se
|
|
1500 jmenuje 3:2 pulldown a obecně je známa jako telecine (protože je pulldown
|
|
1501 často prováděn během přenosu filmu na video) a, jednoduše řečeno, pracuje tak,
|
|
1502 že se film zpomalí na 24000/1001 snímků/s a každý čtvrtý snímek se zopakuje.
|
|
1503 </para>
|
|
1504
|
|
1505 <para>
|
|
1506 Naopak žádné speciální úpravy se neprovádějí videu pro PAL DVD, která běží
|
|
1507 při 25 snímcích/s. (Technicky lze na PAL provést telecine, tzv. 2:2 pulldown,
|
|
1508 ale v praxi se nepoužívá.) Film s 24 snímky/s je jednoduše přehráván rychlostí
|
|
1509 25 snímků/s. Výsledkem je, že video běží o něco rychleji, ale pokud nejste
|
|
1510 vetřelec, tak si rozdílu ani nevšimnete. Většina filmů má navíc výškově
|
|
1511 korigovaný zvuk, takže při přehrávání 25 snímků/s vše zní jak má i přesto, že
|
|
1512 zvuk (a proto i celé video) má o 4% kratší dobu přehrávání než NTSC DVD.
|
|
1513 </para>
|
|
1514
|
|
1515 <para>
|
|
1516 Jelikož video na PAL DVD nebylo upravováno, nemusíte si dělat starosti s jeho
|
|
1517 snímkovou rychlostí. Zdroj má 25 snímků/s, váš rip také. Pokud ovšem ripujete
|
|
1518 NTSC DVD film, musíte provést inverzní telecine.
|
|
1519 </para>
|
|
1520
|
|
1521 <para>
|
|
1522 Filmy točené rychlostí 24 snímků/s jsou na NTSC DVD uloženy buď jako
|
|
1523 30000/1001 po telecine, nebo jako progresivní (neprokládaný) se snímkovou
|
|
1524 24000/1001 snímků/s, na kterých by měl provést telecine DVD přehrávač za letu.
|
|
1525 Není to ale zákon: některé TV série jsou prokládané (např. Buffy Lovec upírů),
|
|
1526 zatímco jiné jsou porůznu neprokládané nebo prokládané (např. Anděl, nebo 24
|
|
1527 hodin).
|
|
1528 </para>
|
|
1529
|
|
1530 <para>
|
|
1531 Doporučujeme, abyste si přečetli sekci o tom
|
|
1532 <link linkend="menc-feat-telecine">Jak si poradit s telecine a prokladem na NTSC DVD</link>
|
|
1533 a naučili se jak využít různé možnosti.
|
|
1534 </para>
|
|
1535
|
|
1536 <para>
|
|
1537 Pokud ovšem většinou ripujete pouze filmy, nejspíš se setkáváte
|
|
1538 s neprokládaným nebo prokládaným videem 24 snímků/s. V tom případě můžete
|
|
1539 použít <option>pullup</option> filtr <option>-vf pullup,softskip</option>.
|
|
1540 </para>
|
|
1541
|
|
1542 </sect2>
|
|
1543
|
15675
|
1544 <sect2 id="menc-feat-dvd-mpeg4-encoding-interlaced">
|
|
1545 <title>Enkódování prokládaného videa</title>
|
|
1546
|
|
1547 <para>
|
|
1548 Pokud je film, který chcete enkódovat, prokládaný (NTSC video nebo
|
|
1549 PAL video), budete si muset vybrat, zda jej chcete "odproložit" nebo ne.
|
|
1550 Zatímco odstranění prokladu učiní váš film použitelným na progresivně
|
|
1551 vykreslovaných zobrazovačích jako jsou počítačové monitory a projektory.
|
|
1552 Cenou za to je, snížení rychlosti z 50 nebo 60000/1001 půlsnímků za sekundu
|
|
1553 na 25 nebo 30000/1001 snímků za sekundu a zhruba polovina informací bude
|
|
1554 z vašeho filmu ztracena ve scénách s významným množstvím pohybu.
|
|
1555 </para>
|
|
1556
|
|
1557 <para>
|
|
1558 Proto pokud enkódujete ve vysoké kvalitě pro archivační účely, doporučujeme
|
|
1559 ponechat film prokládaný.
|
|
1560 Vždy můžete provést odstranění prokladu při přehrávání pokud zobrazujete
|
|
1561 na progresivním zařízení a přehrávače v budoucnosti budou schopny odstraňovat
|
|
1562 proklad v plné půlsnímkové rychlosti, čili odvozovat 50 nebo 60000/1001
|
|
1563 úplných snímků za sekundu z prokládaného videa.
|
|
1564 </para>
|
|
1565
|
|
1566 <para>
|
|
1567 Když pracujete s prokládaným videem, musíte zvláště dbát na:
|
|
1568 </para>
|
|
1569
|
|
1570 <orderedlist>
|
|
1571 <listitem><para>
|
|
1572 Výška a svislé odsazení musí být násobkem 4.
|
|
1573 </para></listitem>
|
|
1574 <listitem><para>
|
|
1575 Jakékoli svislé škálování musí být provedeno v prokládaném režimu.
|
|
1576 </para></listitem>
|
|
1577 <listitem><para>
|
|
1578 Postprocesní a odšumovací filtry nemusí pracovat podle očekávání,
|
|
1579 dokud nezařídíte, aby zpracovávaly najednou pouze jeden půlsnímek a
|
|
1580 mohou vám poškodit video při nesprávném použití.
|
|
1581 </para></listitem>
|
|
1582 </orderedlist>
|
|
1583
|
|
1584 <para>
|
|
1585 S vědomím těchto souvislostí vám předkládáme první příklad:
|
|
1586 </para>
|
|
1587 <screen>
|
|
1588 mencoder <replaceable>capture.avi</replaceable> -mc 0 -oac lavc -ovc lavc -lavcopts \
|
|
1589 vcodec=mpeg2video:vbitrate=6000:ilmv:ildct:acodec=mp2:abitrate=224
|
|
1590 </screen>
|
|
1591 <para>
|
|
1592 Povšimněte si voleb <option>ilmv</option> a <option>ildct</option>.
|
|
1593 </para>
|
|
1594 </sect2>
|
15219
|
1595
|
|
1596 <sect2 id="menc-feat-dvd-mpeg4-filtering">
|
|
1597 <title>Filtrování</title>
|
|
1598
|
|
1599 <para>
|
|
1600 Obecně byste měli filtrovat video tak málo, jak je to jen možné, abyste
|
|
1601 zůstali co nejblíž DVD originálu. Ořezání je často nutné (jak jsme již řekli),
|
|
1602 ale neškálujte video. Ačkoli zmenšení rozlišení je občas upřednostňováno před
|
|
1603 použitím vyšších kvantizerů, musíme se vyhnout oběma případům: pamatujme, že
|
|
1604 jsme se již na začátku rozhodli obětovat bity za kvalitu.
|
|
1605 </para>
|
|
1606
|
|
1607 <para>
|
|
1608 Rovněž neupravujte gamu, kontrast, jas, atd. Co vypadá dobře na vaší
|
|
1609 obrazovce, nemusí vypadat dobře na jiných. Tato přizpůsobení by měla být
|
|
1610 prováděna pouze při přehrávání.
|
|
1611 </para>
|
|
1612
|
|
1613 <para>
|
|
1614 Jednu věc byste však udělat měli, a to protáhnout video velmi lehkým
|
|
1615 odšumovací filtr, jako je <option>-vf hqdn3d=2:1:2</option>.
|
|
1616 Opět je to proto, abychom mohli některé bity lépe využít: proč s nimi plýtvat
|
|
1617 na šum, když si jej můžete přidat při přehrávání? Zvýšení parametrů pro
|
|
1618 <option>hqdn3d</option> ještě více zvýší komprimovatelnost, ale pokud to
|
|
1619 přeženete, riskujete zhoršení viditelnosti obrazu. Doporučené hodnoty okolo
|
|
1620 (<option>2:1:2</option>) jsou dost konzervativní; měli byste volně
|
|
1621 experimentovat s vyššími hodnotami a posoudit výsledek sami.
|
|
1622 </para>
|
|
1623
|
|
1624 </sect2>
|
|
1625
|
|
1626 <sect2 id="menc-feat-dvd-mpeg4-lavc-encoding-options">
|
|
1627 <title>Enkódovací volby libavcodecu</title>
|
|
1628
|
|
1629 <para>
|
|
1630 V ideálním případě byste asi chtěli jen říct enkodéru, aby se přepnul do
|
|
1631 režimu "vysoká kvalita" a šel na to.
|
|
1632 To by bylo jistě hezké, ale naneštěstí je to těžké zavést, jelikož různé
|
|
1633 volby enkódování vedou k různé kvalitě v závislosti na zdrojovém materiálu.
|
|
1634 To proto, že komprese závisí na vizuálních vlastnostech daného videa.
|
|
1635 Například anime a živá akce mají zcela rozdílné vlastnosti a tedy vyžadují
|
|
1636 odlišné volby pro dosažení optimálního enkódování.
|
|
1637 Dobrá zpráva je, že některé volby by nikdy neměly chybět, jako
|
|
1638 <option>mbd=2</option>, <option>trell</option> a <option>v4mv</option>.
|
|
1639 Podrobný popis obvyklých enkódovacích voleb naleznete níže.
|
|
1640 </para>
|
|
1641
|
|
1642
|
|
1643 <itemizedlist>
|
|
1644 <title>Volby k nastavení:</title>
|
|
1645 <listitem><para>
|
|
1646 <emphasis role="bold">vmax_b_frames</emphasis>: 1 nebo 2 je v pořádku,
|
|
1647 v závislosti na filmu.
|
|
1648 Poznamenejme, že libavcodec zatím nepodporuje uzavřený GOP (volba
|
|
1649 <option>cgop</option> zatím nepracuje), takže DivX5 nebude schopen dekódovat
|
|
1650 nic enkódovaného s B-snímky.
|
|
1651 </para></listitem>
|
|
1652
|
|
1653 <listitem><para>
|
|
1654 <emphasis role="bold">vb_strategy=1</emphasis>: pomáhá ve scénách s rychlým
|
|
1655 pohybem.
|
|
1656 Vyžaduje vmax_b_frames >= 2.
|
|
1657 V některých videích může vmax_b_frames snížit kvalitu, ale vmax_b_frames=2
|
|
1658 spolu s vb_strategy=1 pomůže.
|
|
1659 </para></listitem>
|
|
1660
|
|
1661 <listitem><para>
|
|
1662 <emphasis role="bold">dia</emphasis>: okruh vyhledávání pohybu. Čím větší, tím
|
|
1663 lepší a pomalejší.
|
|
1664 Záporné hodnoty mají úplně jiný význam.
|
|
1665 Dobrými hodnotami jsou -1 pro rychlé enkódování, nebo 2-4 pro pomalejší.
|
|
1666 </para></listitem>
|
|
1667
|
|
1668 <listitem><para>
|
|
1669 <emphasis role="bold">predia</emphasis>: předprůchod pro vyhledávání pohybu.
|
|
1670 Není tak důležitý jako dia. Dobré hodnoty jsou 1 (výchozí) až 4. Vyžaduje
|
|
1671 preme=2, aby byla opravdu k něčemu.
|
|
1672 </para></listitem>
|
|
1673
|
|
1674 <listitem><para>
|
|
1675 <emphasis role="bold">cmp, subcmp, precmp</emphasis>: Porovnávací funkce pro
|
|
1676 odhad pohybu.
|
|
1677 Experimentujte s hodnotami 0 (výchozí), 2 (hadamard), 3 (dct) a 6 (omezení
|
|
1678 datového toku).
|
|
1679 0 je nejrychlejší a dostatečná pro precmp.
|
|
1680 Pro cmp a subcmp je 2 dobrá pro anime a 3 zase pro živou akci.
|
|
1681 6 může, ale nemusí být o něco lepší, ale je pomalá.
|
|
1682 </para></listitem>
|
|
1683
|
|
1684 <listitem><para>
|
|
1685 <emphasis role="bold">last_pred</emphasis>: Počet prediktorů pohybu
|
|
1686 přebíraných z předchozího snímku.
|
|
1687 1-3 nebo tak pomůžou za cenu menšího zdržení.
|
|
1688 Vyšší hodnoty jsou však pomalé a nepřináší žádný další užitek.
|
|
1689 </para></listitem>
|
|
1690
|
|
1691 <listitem><para>
|
|
1692 <emphasis role="bold">cbp, mv0</emphasis>: Ovládá výběr makrobloků.
|
|
1693 Malá ztráta rychlosti za malý zisk kvality.
|
|
1694 </para></listitem>
|
|
1695
|
|
1696 <listitem><para>
|
|
1697 <emphasis role="bold">qprd</emphasis>: adaptivní kvantizace založená na
|
|
1698 komplexnosti makrobloku.
|
|
1699 Může pomoci i uškodit v závislosti na videu a ostatních volbách.
|
|
1700 Toto může způsobovat artefakty, pokud nenastavíte vqmax na nějakou rozumně
|
|
1701 malou hodnotu (6 je dobrá, možná byste ale měli jít až na 4); vqmin=1 může
|
|
1702 také pomoci.
|
|
1703 </para></listitem>
|
|
1704
|
|
1705 <listitem><para>
|
|
1706 <emphasis role="bold">qns</emphasis>: velmi pomalá, zvlášť v kombinaci
|
|
1707 s qprd.
|
|
1708 Tato volba nutí enkodér minimalizovat šum díky kompresi artefaktů, místo aby
|
|
1709 se snažil striktně zachovávat věrnost videa. Nepoužívejte ji, pokud jste již
|
|
1710 nezkusili všechno ostatní kam až to šlo a výsledek přesto není dost dobrý.
|
|
1711 </para></listitem>
|
|
1712
|
|
1713 <listitem><para>
|
|
1714 <emphasis role="bold">vqcomp</emphasis>: Vylepšení ovládání datového toku.
|
|
1715 Dobré hodnoty se liší podle videa. Můžete to bezpečně ponechat jak to je,
|
|
1716 pokud chcete.
|
|
1717 Snížením vqcomp pustíte více bitů do scén s nízkou komplexností, zvýšením je
|
|
1718 pošlete do scén s vysokou komplexností (výchozí: 0.5, rozsah: 0-1. doporučený
|
|
1719 rozsah: 0.5-0.7).
|
|
1720 </para></listitem>
|
|
1721
|
|
1722 <listitem><para>
|
|
1723 <emphasis role="bold">vlelim, vcelim</emphasis>: Nastaví jediný koeficient
|
|
1724 prahu eliminace pro jasové a barevné roviny.
|
|
1725 Ty jsou enkódovány odděleně ve všech MPEGu podobných algoritmech.
|
|
1726 Myšlenka stojící za těmito volbami je použití dobré heuristiky pro určení,
|
|
1727 zda je změna v bloku menší než vámi nastavený práh a v tom případě se blok
|
|
1728 enkóduje jako "nezměněný".
|
|
1729 To šetří bity a možná i zrychlí enkódování. vlelim=-4 a vcelim=9 se zdají být
|
|
1730 dobré pro hrané filmy, ale příliš nepomohou s anime; pokud enkódujete anime,
|
|
1731 měli byste je asi nechat beze změn.
|
|
1732 </para></listitem>
|
|
1733
|
|
1734 <listitem><para>
|
|
1735 <emphasis role="bold">qpel</emphasis>: Odhad pohybu s přesností na čtvrt
|
|
1736 pixelu. MPEG-4 používá přesnost na půl pixelu jako výchozí při vyhledávání
|
|
1737 pohybu, proto je tato volba spojena s určitou režií, jelikož se do výstupního
|
|
1738 souboru ukládá více informací.
|
|
1739 Kompresní zisk/ztráta závisí na filmu, ale obvykle to není příliš efektivní
|
|
1740 na anime.
|
|
1741 qpel vždy způsobí zvýšení výpočetní náročnosti dekódování (v praxi +20% času
|
|
1742 CPU).
|
|
1743 </para></listitem>
|
|
1744
|
|
1745 <listitem><para>
|
|
1746 <emphasis role="bold">psnr</emphasis>: neovlivní aktuální enkódování, ale
|
|
1747 zaznamená typ/velikost/kvalitu každého snímku do log souboru a na konci vypíše
|
|
1748 souhrnný PSNR (odstup signálu od šumu).
|
|
1749 </para></listitem>
|
|
1750
|
|
1751 </itemizedlist>
|
|
1752
|
|
1753 <itemizedlist>
|
|
1754 <title>Volby se kterými nedoporučujeme si hrát:</title>
|
|
1755 <listitem><para>
|
|
1756 <emphasis role="bold">vme</emphasis>: Výchozí je nejlepší.
|
|
1757 </para></listitem>
|
|
1758
|
|
1759 <listitem><para>
|
|
1760 <emphasis role="bold">lumi_mask, dark_mask</emphasis>: Psychovizuálně
|
|
1761 adaptivní kvantizace.
|
|
1762 Nehrajte si s těmito volbami, pokud vám jde o kvalitu. Rozumné hodnoty mohou
|
|
1763 být efektivní ve vašem případě, ale pozor, je to velmi subjektivní.
|
|
1764 </para></listitem>
|
|
1765
|
|
1766 <listitem><para>
|
|
1767 <emphasis role="bold">scplx_mask</emphasis>: Snaží se předcházet blokovým
|
|
1768 artefaktům, ale postprocesing je lepší.
|
|
1769 </para></listitem>
|
|
1770 </itemizedlist>
|
|
1771
|
|
1772 </sect2>
|
|
1773
|
|
1774 <sect2 id="menc-feat-dvd-mpeg4-example">
|
|
1775 <title>Příklad</title>
|
|
1776
|
|
1777 <para>
|
|
1778 Takže jste si koupili zbrusu novou kopii filmu Harry Potter a Tajemná komnata
|
|
1779 (širokoúhlou verzi samozřejmě) a chcete si toto DVD ripnout, takže si jej
|
|
1780 můžete přidat do svého Domácího kino-počítače PC. Je to region 1 DVD, takže je
|
|
1781 v NTSC. Níže uvedený příklad je stále vhodný i pro PAL, jen musíte vynechat
|
|
1782 <option>-ofps 24000/1001</option> (protože výstupní snímková rychlost je
|
|
1783 shodná se vstupní) a přirozeně budou rozdílné souřadnice pro ořez.
|
|
1784 </para>
|
|
1785
|
|
1786 <para>
|
|
1787 Po spuštění <option>mplayer dvd://1</option>, postupujeme podle informací
|
|
1788 obsažených v sekci <link linkend="menc-feat-telecine">Jak naložit s telecine
|
|
1789 a prokladem v NTSC DVD</link> a zjistíme že je to 24000/1001 neprokládané
|
|
1790 video, takže nepotřebujeme použít inverzní telecine filtr, jako je
|
|
1791 <option>pullup</option> nebo <option>filmdint</option>.
|
|
1792 </para>
|
|
1793
|
|
1794 <para>
|
|
1795 Dále musíme zjistit vhodný ořezový obdélník, takže použijeme filtr cropdetect:
|
|
1796
|
|
1797 <screen>mplayer dvd://1 -vf cropdetect</screen>
|
|
1798
|
|
1799 Ujistěte se, že jste přešli přes zaplněný snímek (nějakou jasnou scénu) a
|
|
1800 v konzoli <application>MPlayer</application>u uvidíte:
|
|
1801
|
|
1802 <screen>crop area: X: 0..719 Y: 57..419 (-vf crop=720:362:0:58)</screen>
|
|
1803
|
|
1804 Potom přehrajeme film s tímto filtrem, abychom otestovali jeho správnost:
|
|
1805
|
|
1806 <screen>mplayer dvd://1 -vf crop=720:362:0:58</screen>
|
|
1807
|
|
1808 A zjistíme, že to vypadá zcela v pořádku. Dále se ujistíme, že šířka i výška
|
|
1809 jsou násobky 16. Šířka je v pořádku, výška ovšem ne. Protože jsme nepropadli
|
|
1810 v sedmé třídě z matematiky, víme, že nejbližším násobkem 16 nižším než 362 je
|
|
1811 352.
|
|
1812 </para>
|
|
1813
|
|
1814 <para>
|
|
1815 Mohli bychom použít <option>crop=720:352:0:58</option>, ale bude lepší
|
|
1816 ustřihnout kousek nahoře i dole, takže zachováme střed. Zkrátili jsme výšku
|
|
1817 o 10 pixelů, ale nechceme zvýšit odsazení y o 5 pixelů, protože je to liché
|
|
1818 číslo, což by nepříznivě ovlivnilo kvalitu. Místo toho zvýšíme odsazení y o 4
|
|
1819 pixely:
|
|
1820
|
|
1821 <screen>mplayer dvd://1 -vf crop=720:352:0:62</screen>
|
|
1822
|
|
1823 Další důvod pro odstřižení pixelů shora i zdola je to, že si můžeme být jisti
|
|
1824 odstřižením napůl černých pixelů pokud existují. Pokud je však vaše video
|
|
1825 telecinováno, ujistěte se, že máte v řetězu filtrů <option>pullup</option>
|
|
1826 filtr (nebo jiný filtr pro inverzi telecine, který hodláte použít) ještě před
|
|
1827 odstraněním prokladu a ořezem. (Pokud se rozhodnete zachovat vaše video
|
|
1828 prokládané, pak se ujistěte, že vaše vertikální odsazení (offset)
|
|
1829 je násobkem 4.)
|
|
1830 </para>
|
|
1831
|
|
1832 <para>
|
|
1833 Pokud si děláte starosti se ztrátou těch 10 pixelů, možná raději snížíte
|
|
1834 rozměry na nejbližší násobek 16. Řetězec filtrů by pak vypadal asi takto:
|
|
1835
|
|
1836 <screen>-vf crop=720:362:0:58,scale=720:352</screen>
|
|
1837
|
|
1838 Takovéto zmenšení videa bude znamenat ztrátu malého množství detailů, což bude
|
|
1839 pravděpodobně stěží postřehnutelné. Zvětšování by naopak vedlo ke snížení
|
|
1840 kvality (pokud byste nezvýšili datový tok). Ořez odstraní tyto pixely úplně.
|
|
1841 To je jedna z věcí, kterou byste si měli uvážit pro každý případ zvlášť.
|
|
1842 Například pokud bylo DVD video vyrobeno pro televizi, měli byste se vyvarovat
|
|
1843 vertikálnímu škálování, jelikož počet řádků odpovídá originální nahrávce.
|
|
1844 </para>
|
|
1845
|
|
1846 <para>
|
|
1847 Při prohlídce jsme zjistili, že video je poměrně akční, s vysokým počtem
|
|
1848 detailů, takže jsme zvolili datový tok 2400 Kbitů.
|
|
1849 </para>
|
|
1850
|
|
1851 <para>
|
|
1852 Nyní jsme připraveni provést dvouprůchodové enkódování. Průchod jedna:
|
|
1853
|
|
1854 <screen>mencoder dvd://1 -ofps 24000/1001 -oac copy -vf crop=720:352:0:62,hqdn3d=2:1:2 -ovc lavc \
|
|
1855 -lavcopts vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:mbcmp=3:autoaspect:vpass=1 \
|
|
1856 -o Harry_Potter_2.avi</screen>
|
|
1857
|
|
1858 A průchod dva je stejný, jen nastavíme <option>vpass=2</option>:
|
|
1859
|
|
1860 <screen>mencoder dvd://1 -ofps 24000/1001 -oac copy -vf crop=720:352:0:62,hqdn3d=2:1:2 -ovc lavc \
|
|
1861 -lavcopts vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:mbcmp=3:autoaspect:vpass=2 \
|
|
1862 -o Harry_Potter_2.avi</screen>
|
|
1863 </para>
|
|
1864
|
|
1865 <para>
|
|
1866 Volby <option>v4mv:mbd=2:trell</option> velmi zvýší kvalitu za cenu časové
|
|
1867 náročnosti enkódování. Vcelku není důvod tuto volbu vypustit, pokud je
|
|
1868 primárním cílem kvalita. Volby <option>cmp=3:subcmp=3:mbcmp=3</option>
|
|
1869 vyberou porovnávací funkci, která poskytuje lepší kvalitu, než výchozí.
|
|
1870 S tímto parametrem můžete zkusit experimentovat (nahlédněte do man stránky pro
|
|
1871 seznam možných hodnot), jelikož různé funkce mohou mít velký vliv na kvalitu
|
|
1872 v závislosti na zdrojovém materiálu. Například pokud zjistíte, že
|
|
1873 <systemitem class="library">libavcodec</systemitem> produkuje příliš mnoho
|
|
1874 čtverečkových artefaktů, můžete zkusit zvolit experimentální NSSE jako
|
|
1875 porovnávací funkci přes <option>*cmp=10</option>.
|
|
1876 </para>
|
|
1877
|
|
1878 <para>
|
|
1879 V případě tohoto filmu bude výsledné AVI dlouhé 138 minut a veliké kolem 3GB.
|
|
1880 A protože jste řekli, že na velikosti nezáleží, je to přijatelná velikost.
|
|
1881 Ale pokud byste jej chtěli menší, můžete zkusit nižší datový tok.
|
|
1882 Efekt zvyšování datového toku se totiž neustále snižuje, takže zatímco je
|
|
1883 zlepšení po zvýšení z 1800 Kbitů na 2000 Kbitů zjevné, nemusí být již tak
|
|
1884 velké nad 2000 Kbitů. Beze všeho s tím experimentujte, dokud nebudete
|
|
1885 spokojeni.
|
|
1886 </para>
|
|
1887
|
|
1888 <para>
|
|
1889 Jelikož jsme protáhli video odšumovacím filtrem, měli bychom jej trochu přidat
|
|
1890 během přehrávání. To, spolu s <option>spp</option> post-procesním filtrem,
|
|
1891 znatelně zvýší vnímanou kvalitu a pomůže odstranit čtverečkové artefakty ve
|
|
1892 videu. S <application>MPlayer</application>ovou volbou <option>autoq</option>
|
|
1893 může být množství postprocesingu prováděného filtrem spp přizpůsobováno
|
|
1894 vytížení CPU. V tuto chvíli rovněž můžete provést korekci gama a/nebo barevnou
|
|
1895 korekci k dosažení nejlepších výsledků. Například:
|
|
1896
|
|
1897 <screen>mplayer Harry_Potter_2.avi -vf spp,noise=9ah:5ah,eq2=1.2 -autoq 3</screen>
|
|
1898
|
|
1899 </para>
|
|
1900 </sect2>
|
|
1901
|
|
1902 <sect2 id="menc-feat-dvd-mpeg4-muxing">
|
|
1903 <title>Muxování (multiplexování)</title>
|
|
1904 <para>
|
|
1905 Nyní, když máte své video enkódované, budete jej nejspíš chtít muxovat
|
|
1906 s jedním nebo více zvukovými stopami do nosného filmového formátu, jako je
|
|
1907 AVI, MPEG, Matroska nebo NUT.
|
|
1908 <application>MEncoder</application> je zatím schopen zvuk a video zapracovat
|
|
1909 pouze do nosných formátů MPEG a AVI.
|
|
1910 Například:
|
|
1911 <screen>mencoder -oac copy -ovc copy -o <replaceable>výstupní_film.avi</replaceable> -audiofile <replaceable>vstupní_audio.mp2</replaceable> <replaceable>vstupní_video.avi</replaceable></screen>
|
|
1912 To by mělo sloučit video soubor <replaceable>vstupní_video.avi</replaceable>
|
|
1913 a zvukový soubor <replaceable>vstupní_audio.mp2</replaceable>
|
|
1914 do AVI souboru <replaceable>výstupní_film.avi</replaceable>.
|
|
1915 Tento příkaz pracuje s MPEG-1 layer I, II a III (známým jako MP3) zvukem,
|
|
1916 WAV a také několika dalšími formáty zvuku.
|
|
1917 </para>
|
|
1918
|
|
1919 <para>
|
|
1920 <application>MEncoder</application> obsahuje experimentální podporu pro
|
|
1921 <systemitem class="library">libavformat</systemitem>, což je knihovna
|
|
1922 z projektu FFmpeg, která podporuje muxování a demuxování celé řady nosných
|
|
1923 formátů.
|
|
1924 Například:
|
|
1925 <screen>mencoder -oac copy -ovc copy -o <replaceable>výstupní_film.asf</replaceable> -audiofile <replaceable>vstupní_audio.mp2</replaceable> <replaceable>vstupní_video.avi</replaceable> -of lavf -lavfopts format=asf</screen>
|
|
1926 To provede stejnou činnost jako předchozí příklad, avšak výstupním formátem
|
|
1927 bude ASF.
|
|
1928 Prosím berte na vědomí, že tato podpora je velmi experimentální (ale de ode
|
|
1929 dne lepší) a bude funkční pouze pokud jste zkompilovali
|
|
1930 <application>MPlayer</application> s podporou pro
|
|
1931 <systemitem class="library">libavformat</systemitem> (což znamená, že
|
|
1932 předkompilovaná binární verze nebude většinou fungovat).
|
|
1933 </para>
|
|
1934
|
|
1935 <sect3 id="menc-feat-dvd-mpeg4-muxing-avi-limitations">
|
|
1936 <title>Limitace nosného formátu AVI</title>
|
|
1937 <para>
|
|
1938 Ačkoli je to po MPEG-1 nejpodporovanější nosný formát, má AVI i jisté
|
|
1939 zásadní nedostatky. Snad nejviditelnější je režie.
|
|
1940 Na každý chunk AVI souboru je 24 bajtů ztraceno na hlavičky a index.
|
|
1941 To se projeví asi 5 MP na hodinu, neboli 1-2.5% prodloužení 700 MB filmu.
|
|
1942 Nevypadá to jako mnoho, ale může to znamenat rozdíl mezi možností použít
|
|
1943 video při 700 kbitech/s nebo 714 kbitech/s a tady se každý bit projeví na
|
|
1944 kvalitě.
|
|
1945 </para>
|
|
1946
|
|
1947 <para>
|
|
1948 Navíc k této neefektivitě má AVI také následující hlavní omezení:
|
|
1949 </para>
|
|
1950
|
|
1951 <orderedlist>
|
|
1952 <listitem>
|
|
1953 <para>
|
|
1954 Může být uchováván pouze obsah s konstantní snímkovou rychlostí. To je
|
|
1955 zvláště omezující, když má původní materiál, který chcete enkódovat, smíšený
|
|
1956 obsah. Například směs NTSC videa a filmového materiálu.
|
|
1957 Jistěže jsou zde cestičky, které umožní uložit obsah se smíšenou snímkovou
|
|
1958 rychlostí v AVI, ale ty zvyšují (již tak velkou) režii pětinásobně nebo víc,
|
|
1959 proto nejsou praktické.
|
|
1960 </para>
|
|
1961 </listitem>
|
|
1962 <listitem>
|
|
1963 <para>
|
|
1964 Zvuk v AVI musí mít buď konstantní datový tok (CBR) nebo konstantní velikost
|
|
1965 rámce (čili všechny rámce se dekódují na stejný počet vzorků).
|
|
1966 Naneštěstí ten nejefektivnější kodek, Vorbis, nesplňuje ani jeden z těchto
|
|
1967 požadavků.
|
|
1968 Pokud tedy plánujete uložit svůj film do AVI, budete muset použít méně
|
|
1969 efektivní kodek, jako MP3 nebo AC3.
|
|
1970 </para>
|
|
1971 </listitem>
|
|
1972 </orderedlist>
|
|
1973
|
|
1974 <para>
|
|
1975 Z výše uvedených důvodů <application>MEncoder</application> zatím
|
|
1976 nepodporuje proměnnou snímkovou rychlost ani enkódování do Vorbisu.
|
|
1977 Nemusíte to však považovat za omezení, jestliže je
|
|
1978 <application>MEncoder</application> jediným nástrojem pro vaše
|
|
1979 enkódování. Nakonec je možné použít <application>MEncoder</application> pouze
|
|
1980 pro enkódování videa a pak použít externí nástroje pro enkódování zvuku a
|
|
1981 namuxování do jiného nosného formátu.
|
|
1982 </para>
|
|
1983 </sect3>
|
|
1984
|
|
1985 <sect3 id="menc-feat-dvd-mpeg4-muxing-matroska">
|
|
1986 <title>Muxování do nosného formátu Matroska</title>
|
|
1987 <para>
|
|
1988 Matroska je svobodný a otevřený standard nosného formátu, zaměřený na
|
|
1989 nabídku mnoha pokročilých vlastností, které starší nosné formáty, jako AVI,
|
|
1990 nemohou poskytnout.
|
|
1991 Například Matroska podporuje zvuk s proměnným datovým tokem (VBR),
|
|
1992 proměnné snímkové rychlosti (VFR), kapitoly, přílohy souborů, kód pro
|
|
1993 detekci chyb (EDC) a moderní A/V kodeky jako "Advanced Audio
|
|
1994 Coding" (AAC), "Vorbis" nebo "MPEG-4 AVC" (H.264), z nichž žádný nelze
|
|
1995 použít v AVI.
|
|
1996 </para>
|
|
1997
|
|
1998 <para>
|
|
1999 Nástroje pro vytváření Matroska souborů jsou souhrnně nazvány
|
|
2000 <application>mkvtoolnix</application> a jsou dostupné pro většinu Unixových
|
|
2001 platforem a stejně tak <application>Windows</application>.
|
|
2002 Protože je Matroska otevřený standard, můžete najít jiné nástroje, které vám
|
|
2003 lépe padnou, ale protože mkvtoolnix je nejrozšířenější a je podporován
|
|
2004 přímo Matroska týmem, pokryjeme jen jejich použití.
|
|
2005 </para>
|
|
2006
|
|
2007 <para>
|
|
2008 Asi nejsnazší způsob, jak začít s Matroskou je použít
|
|
2009 <application>MMG</application>, grafickou nadstavbu dodávanou s
|
|
2010 <application>mkvtoolnix</application> a řídit se
|
|
2011 <ulink url="http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge-gui.html">návodem k mkvmerge GUI (mmg)</ulink>
|
|
2012 </para>
|
|
2013
|
|
2014 <para>
|
|
2015 Můžete rovněž muxovat zvukové a video soubory z příkazového řádku:
|
|
2016 <screen>mkvmerge -o <replaceable>výstup.mkv</replaceable> <replaceable>vstupní_video.avi</replaceable> <replaceable>vstupní_audio1.mp3</replaceable> <replaceable>vstupní_audio2.ac3</replaceable></screen>
|
|
2017 To spojí video soubor <replaceable>vstupní_video.avi</replaceable>
|
|
2018 a dva zvukové soubory <replaceable>vstupní_audio1.mp3</replaceable>
|
|
2019 a <replaceable>vstupní_audio2.ac3</replaceable> do Matroska souboru
|
|
2020 <replaceable>výstup.mkv</replaceable>.
|
|
2021 Matroska, jak jsme již řekli, umí mnohem víc než to, jako více zvukových stop
|
|
2022 (včetně doladění audio/video synchronizace), kapitoly, titulky, stříhání,
|
|
2023 atd...
|
|
2024 Detaily naleznete v dokumentaci k těmto aplikacím.
|
|
2025 </para>
|
|
2026
|
|
2027 </sect3>
|
|
2028
|
|
2029 </sect2>
|
|
2030
|
|
2031 </sect1>
|
|
2032
|
15377
|
2033 <sect1 id="menc-feat-x264">
|
|
2034 <title>Enkódování s <systemitem class="library">x264</systemitem> kodekem</title>
|
|
2035 <para>
|
|
2036 <systemitem class="library">x264</systemitem> je svobodná knihovna pro
|
15675
|
2037 enkódování H.264/AVC video proudů.
|
15377
|
2038 Pře zahájením enkódování budete muset <link linkend="codec-x264-encode">
|
|
2039 nastavit její podporu v<application>MEncoder</application>u</link>.
|
|
2040 </para>
|
|
2041
|
|
2042 <sect2 id="menc-feat-x264-intro">
|
|
2043 <title>Jaké volby bychom měli nastavit pro nejlepší výsledky?</title>
|
|
2044
|
|
2045 <para>
|
|
2046 Začněte prosím prostudováním části
|
|
2047 <systemitem class="library">x264</systemitem> v man stránce
|
|
2048 <application>MPlayer</application>u.
|
|
2049 Tato sekce je zamýšlena jako doplněk man stránky.
|
|
2050 </para>
|
|
2051
|
|
2052 <orderedlist>
|
|
2053 <title>Obecně jsou zde tři typy uvažování při volbě vhodných voleb enkodéru:
|
|
2054 </title>
|
|
2055 <listitem><para>Časová náročnost enkódování vs. kvalita</para></listitem>
|
|
2056 <listitem><para>Volby rozhodující o typu snímků</para></listitem>
|
|
2057 <listitem><para>Volby ovlivňující kontrolu datového toku a kvantizaci</para></listitem>
|
|
2058 </orderedlist>
|
|
2059
|
|
2060 <para>
|
|
2061 Tento návod se většinou zaměřuje na první skupinu voleb.
|
|
2062 Další dvě skupiny často záleží na osobních preferencích a individuálních
|
|
2063 požadavcích.
|
|
2064 </para>
|
|
2065
|
|
2066 <para>
|
|
2067 Než budeme pokračovat, poznamenejme, že tento návod používá jediné měřítko
|
|
2068 kvality: celkový PSNR.
|
|
2069 Stručné vysvětlení co je to PSNR, naleznete
|
|
2070 <ulink url="http://en.wikipedia.org/wiki/PSNR">ve Wikipedii pod heslem PSNR</ulink>.
|
|
2071 Celkové PSNR je poslední hlášené PSNR číslo při zařazení volby
|
|
2072 <option>psnr</option> v <option>x264encopts</option>.
|
15675
|
2073 Kdykoli píšeme o PSNR, je jedním z předpokladů tohoto sdělení
|
|
2074 to, že jsou použity shodné datové toky.
|
15377
|
2075 </para>
|
|
2076
|
|
2077 <para>
|
|
2078 Téměř všechny komentáře v tomto návodu předpokládají, že enkódujete
|
|
2079 dvouprůchodově.
|
|
2080 Při porovnávání voleb jsou zde dva hlavní důvody pro použití dvouprůchodového
|
|
2081 enkódování.
|
|
2082 Zaprvé, dvouprůchodové enkódování vám získá zhruba 1dB PSNR, což je
|
15675
|
2083 znatelný rozdíl.
|
15377
|
2084 Zadruhé, testování voleb pomocí přímého porovnání kvality v jednoprůchodových
|
|
2085 výsledcích je pochybné, jelikož se datový tok značně liší s každým
|
|
2086 enkódováním.
|
|
2087 Není vždy snadné určit, zda se změnila kvalita díky změně voleb, nebo
|
|
2088 z větší části odpovídají změnám datového toku.
|
|
2089 </para>
|
|
2090
|
|
2091 <para>
|
|
2092 Z voleb, které umožňují vyměnit čas za kvalitu, jsou obvykle nejdůležitější
|
|
2093 <option>subq</option> a <option>frameref</option>.
|
|
2094 Máte-li zájem ovlivnit jak rychlost, tak kvalitu, jsou to první volby,
|
|
2095 které byste měli zvážit.
|
|
2096 </para>
|
|
2097
|
|
2098 <para>
|
|
2099 Ve smyslu rychlosti se spolu volby <option>frameref</option> a
|
|
2100 <option>subq</option> velmi silně ovlivňují.
|
|
2101 Zkušenosti ukazují, že při jednom referenčním snímku si
|
|
2102 <option>subq=5</option> vezme asi o 35% více času než
|
|
2103 <option>subq=1</option>.
|
|
2104 Při 6 referenčních snímcích naroste spomalení nad 60%.
|
|
2105 Vliv <option>subq</option> na PSNR se zdá být poměrně stálý,
|
|
2106 bez ohledu na počet referenčních snímků.
|
|
2107 Typicky <option>subq=5</option> získá 0.2-0.5 dB
|
|
2108 celkového PSNR přes <option>subq=1</option>.
|
|
2109 To je obvykle již viditelné.
|
|
2110 </para>
|
|
2111
|
|
2112 </sect2>
|
|
2113
|
|
2114 <sect2 id="menc-feat-x264-encoding-options">
|
|
2115 <title>Enkódovací volby x264</title>
|
|
2116
|
|
2117 <itemizedlist>
|
|
2118 <listitem><para>
|
|
2119 <emphasis role="bold">frameref</emphasis>:
|
|
2120 Výchozí nastavení <option>frameref</option> je 1, ale nemělo by to být bráno
|
|
2121 tak, že je rozumné nastavovat jej na 1.
|
|
2122 Pouhé zvýšení <option>frameref</option> na 2 získá okolo
|
|
2123 0.15dB PSNR s 5-10% spomalením, což je zřejmě dobrý obchod.
|
|
2124 <option>frameref=3</option> získá kolem 0.25dB PSNR navíc k
|
|
2125 <option>frameref=1</option>, což již může být viditelný
|
|
2126 rozdíl.
|
|
2127 <option>frameref=3</option> je asi o 15% pomalejší než
|
|
2128 <option>frameref=1</option>.
|
|
2129 Naneštěstí se zisk rychle vytrácí.
|
|
2130 Prř <option>frameref=6</option> můžete očekávat zisk pouze
|
|
2131 0.05-0.1 dB nad <option>frameref=3</option> při dodatečném
|
|
2132 15% zpomalení.
|
|
2133 Nad <option>frameref=6</option> je zisk kvality obvykle velmi malý
|
|
2134 (ačkoli byste měli mít na paměti, že se to může výrazně lišit v závislosti
|
|
2135 na zdrojovém materiálu).
|
|
2136 V poměrně typickém případě zlepší <option>frameref=12</option>
|
|
2137 celkový PSNR o pouhé 0.02dB nad <option>frameref=6</option>,
|
|
2138 při spomalení o 15%-20%.
|
|
2139 Při tak vysokých hodnotách <option>frameref</option> lze říct pouze
|
|
2140 jedinou dobrou věc, a to že jejich další zvyšování téměř nikdy
|
|
2141 <emphasis role="bold">nesníží</emphasis> PSNR, ale další zisk kvality
|
|
2142 je stěží měřitelný, natož viditelný.
|
|
2143 </para>
|
|
2144 <note><title>Poznámka:</title>
|
|
2145 <para>
|
|
2146 Zvýšení <option>frameref</option> na nemístně vysokou hodnotu
|
|
2147 <emphasis role="bold">může</emphasis> a
|
|
2148 <emphasis role="bold">obvykle taky sníží</emphasis>
|
|
2149 efektivitu kódování, pokud vypnete CABAC.
|
|
2150 Se zapnutým CABAC (výchozí chování) se zdá být možnost nastavit
|
|
2151 <option>frameref</option> "příliš vysoko" příliš vzdálená na to,
|
|
2152 abyste se tím museli trápit a v budoucnu mohou optimalizace
|
|
2153 tuto možnost zcela vyloučit.
|
|
2154 </para>
|
|
2155 </note>
|
|
2156 <para>
|
|
2157 Pokud vám záleží na rychlosti, bývá vhodným kompromisem použít
|
|
2158 nízké hodnoty <option>subq</option> a <option>frameref</option>
|
|
2159 v prvním průchodu a zvýšit je ve druhém.
|
|
2160 Typicky to má zanedbatelný záporný vliv na konečnou kvalitu:
|
15675
|
2161 Pravděpodobně stratíte méně než 0.1dB PSNR, což by měl být až příliš
|
15377
|
2162 malý rozdíl, než aby byl vidět.
|
|
2163 Odlišné hodnoty <option>frameref</option> však mohou místy ovlivnit
|
|
2164 volbu typu snímku.
|
|
2165 Nejspíš to budou ojedinělé případy, ale chcete-li si být zcela jisti,
|
|
2166 zjistěte, jestli vaše video obsahuje buď blýskavé vzory přes celou obrazovku,
|
|
2167 nebo rozsáhlé krátkodobé změny, které by mohly vynutit I-snímek.
|
|
2168 Nastavte <option>frameref</option> pro první průchod tak, aby byl
|
|
2169 dostatečně velký pro pokrytí doby bliknutí (nebo změny).
|
|
2170 Například, pokud scéna přepíná tam a zpět mezi dvěma obrázky přes tři snímky,
|
|
2171 nastavte <option>frameref</option> pro první průchod na 3 a více.
|
|
2172 Tento případ je nejspíš zcela ojedinělý v hraných filmech, ale občas se
|
|
2173 vyskytuje v záznamech z videoher.
|
|
2174 </para></listitem>
|
|
2175
|
|
2176 <listitem><para>
|
15675
|
2177 <emphasis role="bold">me</emphasis>:
|
|
2178 Tato volba je určena pro výběr metody vyhledávání pohybu.
|
|
2179 Změnou této volby jednoduše měníte poměr kvalita-versus-rychlost.
|
|
2180 Volba <option>me=1</option> je jen o málo procent rychlejší než
|
|
2181 výchozí vyhledávání za cenu pod 0.1dB globálního PSNR.
|
|
2182 Výchozí nastavení (<option>me=2</option>) je rozumným kompromisem
|
|
2183 mezi rychlostí a kvalitou. Volba <option>me=3</option> získá o trošku méně
|
|
2184 než 0.1dB globální PSNR, při spomalení, které se liší v závislosti na
|
|
2185 <option>frameref</option>. Při vysokých hodnotách
|
|
2186 <option>frameref</option> (řekněme 12 nebo tak), je <option>me=3</option>
|
|
2187 asi o 40% pomalejší než výchozí <option> me=2</option>. Při
|
|
2188 <option>frameref=3</option>, klesne způsobené spomalení na
|
|
2189 25%-30%.
|
|
2190 </para>
|
|
2191 <para>
|
|
2192 Volba <option>me=4</option> používá tak rozsáhlé vyhledávání, že je příliš
|
|
2193 pomalá pro praktické využití.
|
|
2194 </para>
|
|
2195 </listitem>
|
|
2196
|
|
2197 <listitem><para>
|
|
2198 <emphasis role="bold">4x4mv</emphasis>:
|
|
2199 Tato volba zapíná použití podčástí 8x4, 4x8 a 4x4 v predikovaných
|
|
2200 makroblocích. Její aktivace vede k poměrně stálé
|
|
2201 10%-15% ztrátě rychlosti. Tato volba je poměrně neužitečná ve zdroji
|
|
2202 obsahujícím pouze pomalý pohyb, naproti tomu u některých zdrojů s rychlým
|
|
2203 pohybem, přesněji zdrojů s velkým množstvím malých pohyblivých objektů,
|
|
2204 můžete očekávat zisk okolo 0.1dB.
|
|
2205 </para>
|
|
2206 </listitem>
|
|
2207
|
|
2208 <listitem><para>
|
15377
|
2209 <emphasis role="bold">bframes</emphasis>:
|
|
2210 Použitelnost B-snímků je ve většině ostatních kodeků diskutabilní.
|
|
2211 V H.264 se to změnilo: jsou zde nové techniky a typy bloků pro použití
|
|
2212 v B-snímcích.
|
|
2213 Obvykle i naivní algoritmus pro výběr B-snímku může zajistit znatelný
|
|
2214 zisk PSNR.
|
|
2215 Také je zajímavé, že pokud vypnete adaptivní rozhodování o B-snímku
|
|
2216 (<option>nob_adapt</option>), zvýší obvykle enkódování s
|
|
2217 <option>bframes</option> o trochu rychlost enkódování.
|
|
2218 </para>
|
|
2219 <para>
|
|
2220 S vypnutým adaptivním rozhodováním o B-snímku
|
|
2221 (<option>x264encopts</option>'s <option>nob_adapt</option>),
|
|
2222 se optimální hodnota této volby obvykle pohybuje od
|
|
2223 <option>bframes=1</option> do <option>bframes=3</option>.
|
|
2224 Se zapnutým adaptivním rozhodováním o B-snímku (výchozí chování),
|
|
2225 je obvykle bezpečné použít vyšší hodnoty; enkodér se pokusí snížit
|
|
2226 použití B-snímků ve scénách, kde by snížily kompresi.
|
|
2227 </para>
|
|
2228 <para>
|
|
2229 Pokud vůbec použijete <option>bframes</option>, zvažte
|
|
2230 nastavení maximálního počtu B-snímků na 2 nebo více, pokud chcete
|
|
2231 těžit z vážené predikce.
|
|
2232 </para></listitem>
|
|
2233
|
|
2234 <listitem><para>
|
|
2235 <emphasis role="bold">b_adapt</emphasis>:
|
15675
|
2236 Poznámka: Výchozí je zapnuto.
|
15377
|
2237 </para>
|
|
2238 <para>
|
|
2239 Je-li tato volba zapnuta, bude enkodér používat jendoduchou
|
|
2240 heuristiku pro snížení počtu B-snímků ve scénách, kde by jejich
|
|
2241 použitím příliš nezískaly.
|
|
2242 Můžete použít <option>b_bias</option> pro nastavení jak přátelský
|
|
2243 bude enkodér k B-snímkům.
|
|
2244 Spomalení působené adaptivními B-snímky je nyní spíše malé, ale
|
|
2245 stejně tak potenciální zisk kvality.
|
|
2246 Obvykle však nijak neškodí.
|
|
2247 Poznamenejme, že ovlivňuje rychlost a rozhodování o typu snímku pouze
|
|
2248 v prvním průchodu.
|
|
2249 <option>b_adapt</option> a <option>b_bias</option> nemají žádný vliv
|
|
2250 v náslydných průchodech.
|
|
2251 </para></listitem>
|
|
2252
|
|
2253 <listitem><para>
|
|
2254 <emphasis role="bold">b_pyramid</emphasis>:
|
15675
|
2255 Pokud používáte >=2 B-snímky, můžete také zapnout tuto volbu; jak
|
15377
|
2256 říká man stránka, dostanete malé zvýšení kvality bez ztráty rychlosti.
|
|
2257 Poznamenejme, že tato videa nelze číst dekodéry založenými na libavcodec
|
|
2258 staršími než 5. března 2005.
|
|
2259 </para></listitem>
|
|
2260
|
|
2261 <listitem><para>
|
|
2262 <emphasis role="bold">weight_b</emphasis>:
|
|
2263 V typických případech tato volba nepřináší velký zisk.
|
|
2264 V prolínacích nebo stmívacích scénách však vážená predikce
|
|
2265 umožňuje poměrně velkou úsporu datového toku.
|
|
2266 V MPEG-4 ASP bývá stmívání obvykle nejlépe kódováno jako série
|
|
2267 velkých I-snímků; použití vážené predikce v B-snímcích umožňuje
|
|
2268 změnit alespoň některé z nich na rozumně menší B-snímky.
|
|
2269 Spomalení enkódování se zdá být minimální, pokud nějaké je.
|
|
2270 Rovněž, v rozporu s tím, co si někteří lidé mohou myslet,
|
|
2271 požadavky dekodéru na CPU nejsou váženou predikcí ovlivněny,
|
|
2272 ostatní možnosti jsou stejně náročné.
|
|
2273 </para>
|
|
2274 <para>
|
|
2275 Naneštěstí má aktuálně algoritmus adaptivního rozhodování o B-snímcích
|
|
2276 výraznou tendenci vyvarovat se B-snímků při stmívání.
|
|
2277 Dokud se to nezmění, bude dobré přidat
|
|
2278 <option>nob_adapt</option> do x264encopts, pokud očekáváte, že stmívání
|
|
2279 bude mít znatelný vliv ve vašem konkrétním klipu.
|
|
2280 </para></listitem>
|
|
2281
|
|
2282 <listitem><para>
|
|
2283 <emphasis role="bold">deblockalpha, deblockbeta</emphasis>:
|
|
2284 Toto bude poněkud kontroverzní.
|
|
2285 </para>
|
|
2286 <para>
|
|
2287 H.264 definuje jednoduchou deblokující proceduru na I-blocích, která
|
|
2288 používá přednastavené síly a prahy na QP daného bloku.
|
|
2289 Ve výchozím stavu jsou bloky s nízkým QP silně filtrovány a bloky s
|
|
2290 nízkým QP nejsou deblokovány vůbec.
|
|
2291 Přednastavené síly definované standardem jsou dobře voleny a
|
|
2292 odchylky jsou velmi dobré, takže jsou PSNR optimální pro jakékoli
|
|
2293 video, které zkoušíte enkódovat.
|
|
2294 Volby <option>deblockalpha</option> a <option>deblockbeta</option>
|
|
2295 vám umožní nastavit odchylky přednastavených deblokovacích prahů.
|
|
2296 </para>
|
|
2297 <para>
|
|
2298 Zdá se, že si mnoho lidí myslí, že je vhodné výrazně snížit sílu (řekněme, -3)
|
|
2299 deblokovacího filtru.
|
|
2300 To však není téměř nikdy dobrý nápad a v mnoha případech lidé, kteří
|
|
2301 tak činí, dobře nerozumí jak výchozí deblokování pracuje.
|
|
2302 </para>
|
|
2303 <para>
|
|
2304 První a nejdůležitější věc, kterou byste měli o in-loop deblokovacím
|
|
2305 filtru vědět je, že výchozí nastavení prahů je téměř vždy optimální
|
|
2306 vzhledem k PSNR.
|
|
2307 V řídkých případech kdy není, je ideální odchylka plus mínus 1.
|
|
2308 Změna deblokujících parametrů o větší hodnotu vede téměř s jistotou
|
|
2309 ke zhoršení PSNR.
|
|
2310 Zesílení filtru setře více detailů; zeslabení zvýší viditelnost čtverečkování.
|
|
2311 </para>
|
|
2312 <para>
|
|
2313 Rozhodně je nevhodné snižovat deblokovací prahy, pokud má vaše video
|
|
2314 nízkou prostorovou komplexnost (čili nemnoho detailů nebo šumu).
|
|
2315 In-loop filtr téměř perfektně kryje artefakty, které se vyskytnou.
|
|
2316 Pokud má však zdroj vysokou prostorovou komplexnost, jsou artefakty
|
|
2317 hůře rozeznatelné.
|
|
2318 To proto, že kroužkování má tendenci vypadat jako detail nebo šum.
|
|
2319 Lidská vizuální vnímavost si snadno povšimne, když je odstraněn detail,
|
|
2320 ale obtížněji si všimne, když je špatně reprezentován šum.
|
|
2321 Když příjde na subjektivní kvalitu, je šum částečně zaměnitelný s detaily.
|
|
2322 Snížením síly deblokovacího filtru nejspíše zvýšíte chybu přidáním
|
|
2323 kroužkových artefaktů, ale oko si toho nevšimne, protože si splete
|
|
2324 artefakty s detaily.
|
|
2325 </para>
|
|
2326
|
|
2327 <para>
|
|
2328 To však <emphasis role="bold">stále</emphasis> neospravedlňuje
|
|
2329 snížení síly deblokovacího filtru.
|
|
2330 Obecně dostanete kvalitnější šum z postprocesingu.
|
|
2331 Pokud vaše H.264 videa vypadají příliš rozmazané nebo flekaté, zkuste si
|
|
2332 pohrát s
|
|
2333 <option>-vf noise</option> při přehrávání.
|
|
2334 <option>-vf noise=8a:4a</option> by mělo zamaskovat většinu smazaných
|
|
2335 artefaků.
|
|
2336 Téměř jistě to bude vypadat lépe než to, co dostanete pomocí
|
|
2337 podvádění deblokovacího filtru.
|
|
2338 </para></listitem>
|
|
2339 </itemizedlist>
|
|
2340 </sect2>
|
|
2341 </sect1>
|
|
2342
|
15219
|
2343 <sect1 id="menc-feat-telecine">
|
|
2344 <title>Jak naložit s telecine a prokladem v NTSC DVD</title>
|
|
2345
|
|
2346 <sect2 id="menc-feat-telecine-intro">
|
|
2347 <title>Představení</title>
|
|
2348 <formalpara>
|
|
2349 <title>Co je to telecine?</title>
|
|
2350 <para>
|
|
2351 Pokud moc nerozumíte tomu, co je napsáno v tomto dokumentu, doporučujeme
|
|
2352 navštívit tuto stránku:
|
|
2353 <ulink url="http://www.divx.com/support/guides/guide.php?gid=10">http://www.divx.com/support/guides/guide.php?gid=10</ulink>
|
|
2354 Na této adrese je srozumitelný a rozumně vyčerpávající popis co je to
|
|
2355 telecine.
|
|
2356 </para></formalpara>
|
|
2357
|
|
2358 <formalpara>
|
|
2359 <title>Poznámka k číslům.</title>
|
|
2360 <para>
|
|
2361 Mnoho dokumentů, včetně výše odkazované příručky, udává hodnotu půlsnímků za
|
|
2362 sekundu NTSC videa jako 59.94 a odpovídající snímky za sekundu jako 29.97
|
|
2363 (pro telecinované a prokládané video) a 23.976 (pro neprokládané).
|
|
2364 Pro jednoduchost některé dokumenty zaokrouhlují tyto hodnoty na 60, 30 a 24.
|
|
2365 </para></formalpara>
|
|
2366
|
|
2367 <para>
|
|
2368 Přesně řečeno jsou všechny tyto čísla přibližná. Černobílé NTSC video mělo
|
|
2369 přesně 60 půlsnímků za sekundu, ale později byla zvolena hodnota 60000/1001,
|
|
2370 aby bylo možné přidat barevná data a zůstat kompatibilní se starými
|
|
2371 černobílými televizemi. Digitální NTSC (jak je na DVD) má rovněž rychlost
|
|
2372 60000/1001 půlsnímků za sekundu. Z toho vyplývá, že prokládané a telecinované
|
|
2373 video má 30000/1001 snímků za sekundu; neprokládané video má 24000/1001 snímků
|
|
2374 za sekundu.
|
|
2375 </para>
|
|
2376
|
|
2377 <para>
|
|
2378 Starší verze dokumentace <application>MEncoder</application>u a mnoho zpráv
|
|
2379 v archivu konference hovoří o 59.94, 29.97 a 23.976.
|
|
2380 Všechna dokumentace <application>MEncoder</application>u byla aktualizována
|
|
2381 a používá zlomkových hodnot. Vy byste je měli používat také.
|
|
2382 </para>
|
|
2383
|
|
2384 <para>
|
|
2385 <option>-ofps 23.976</option> je nesprávně.
|
|
2386 Místo toho byste měli použít <option>-ofps 24000/1001</option>.
|
|
2387 </para>
|
|
2388
|
|
2389 <formalpara>
|
|
2390 <title>Jak je používáno telecine.</title>
|
|
2391 <para>
|
|
2392 Veškeré video určené k zobrazení na NTSC televizi musí mít 60000/1001
|
|
2393 půlsnímků za sekundu. Filmy vyráběné pro televizi jsou často natáčeny přímo
|
|
2394 ve 60000/1001 půlsnímcích za sekundu, ale většina filmů do kin je natáčena při
|
|
2395 24 nebo 24000/1001 snímcích za sekundu. Když je film přepisován na DVD, je
|
|
2396 video upraveno pro televizi v procesu zvaném telecine.
|
|
2397 </para></formalpara>
|
|
2398
|
|
2399 <para>
|
|
2400 Na DVD není video ve skutečnosti nikdy uloženo v 60000/1001 půlsnímcích za
|
|
2401 sekundu. Video jež bylo původně 60000/1001, bude mít každý pár půlsnímků
|
|
2402 zkombinován do podoby snímku s rychlostí 30000/1001 snímků za sekundu.
|
|
2403 Hardwarové DVD přehrávače pak čtou příznak, zabudovaný ve video proudu, který
|
|
2404 udává jestli první půlsnímek tvoří liché nebo sudé řádky.
|
|
2405 </para>
|
|
2406
|
|
2407 <para>
|
|
2408 Obsah ve 24000/1001 snímcích za sekundu obvykle zůstává tak jak byl v době
|
|
2409 přepisu na DVD a DVD přehrávač musí provést telecine za letu. Někdy je však
|
|
2410 video telecinováno <emphasis>před</emphasis> uložením na DVD; dokonce i když
|
|
2411 mělo původně 24000/1001 snímků za sekundu, bude mít 60000/1001 půlsnímků za
|
|
2412 sekundu. Pokud je uložen na DVD, páry půlsnímků jsou zkombinovány do formy
|
|
2413 30000/1001 snímků za sekundu.
|
|
2414 </para>
|
|
2415
|
|
2416 <para>
|
|
2417 Když se podíváme na jednotlivé snímky vzniklé z videa o 60000/10001 půlsnímcích
|
|
2418 za sekundu, telecinovaného nebo ne, je zřetelně vidět toto prokládání jakmile
|
|
2419 je zde nějaký pohyb, jelikož jeden půlsnímek (řekněme liché řádky)
|
|
2420 reprezentuje časový okamžik o 1/(60000/1001) sekundy pozdější než ten druhý.
|
|
2421 Přehrávání prokládaného videa na počítači vypadá škaredě jak proto, že monitor
|
|
2422 má vyšší rozlišení, ale i protože video je zobrazováno snímek po snímku místo
|
|
2423 půlsnímek po půlsnímku.
|
|
2424 </para>
|
|
2425
|
|
2426 <itemizedlist>
|
|
2427 <title>Poznámky:</title>
|
|
2428 <listitem><para>
|
|
2429 Tento odstavec platí pouze pro NTSC DVD, nikoli PAL.
|
|
2430 </para></listitem>
|
|
2431 <listitem><para>
|
|
2432 Řádky s příklady spuštění <application>MEncoder</application>u v dokumentu
|
|
2433 <emphasis role="bold">nejsou</emphasis> určeny pro opravdové použití.
|
|
2434 Obsahují pouze nutné minimum vyžadované pro enkódování příslušné ke kategorii
|
|
2435 videa. Jak dělat dobré DVD ripy nebo doladit
|
|
2436 <systemitem class="library">libavcodec</systemitem> pro maximální kvalitu
|
|
2437 není v záběru tohoto dokumentu.
|
|
2438 </para></listitem>
|
|
2439 <listitem><para>
|
|
2440 Poznámky pod čarou příslušné pro tuto příručku jsou linkovány takto:
|
|
2441 <link linkend="menc-feat-telecine-footnotes">[1]</link>
|
|
2442 </para></listitem>
|
|
2443 </itemizedlist>
|
|
2444 </sect2>
|
|
2445
|
|
2446 <sect2 id="menc-feat-telecine-ident">
|
|
2447 <title>Jak zjistit o jaký typ videa se jedná</title>
|
|
2448
|
|
2449 <sect3 id="menc-feat-telecine-ident-progressive">
|
|
2450 <title>Progresivní (neprokládané)</title>
|
|
2451 <para>
|
|
2452 Progresivní video je původně natočeno při 24000/1001 snímcích za sekundu a
|
|
2453 uloženo na DVD beze změn.
|
|
2454 </para>
|
|
2455
|
|
2456 <para>
|
|
2457 Když přehrajete progresivní DVD v <application>MPlayer</application>u,
|
|
2458 <application>MPlayer</application> vypíše následující řádek jakmile začne
|
|
2459 přehrávat:
|
|
2460
|
|
2461 <screen> demux_mpg: 24000/1001 fps progressive NTSC content detected, switching framerate.</screen>
|
|
2462
|
|
2463 Od tohoto okamžiku by demux_mpg neměl nikdy říct že našel
|
|
2464 "30000/1001 fps NTSC obsah."
|
|
2465 </para>
|
|
2466
|
|
2467 <para>
|
|
2468 Když sledujete progresivní video, neměli byste nikdy vidět žádný proklad.
|
|
2469 Dejte si ale pozor, jelikož je občas trošku telecine namixováno tam, kde byste
|
|
2470 to vůbec nečekali. Setkal jsem se s TV show na DVD, které měly sekundu
|
|
2471 telecine při každé změně scény nebo na zcela náhodných místech. Jednou jsem se
|
|
2472 díval na DVD, které bylo do půlky progresivní a od půlky telecinováno. Pokud
|
|
2473 chcete být <emphasis>opravdu</emphasis> důkladní, můžete oskenovat celý film:
|
|
2474
|
|
2475 <screen>mplayer dvd://1 -nosound -vo null -benchmark</screen>
|
|
2476
|
|
2477 Použití volby <option>-benchmark</option> nechá
|
|
2478 <application>MPlayer</application> přehrát film tak rychle, jak je to jen
|
|
2479 možné; stejně to ale, v závislosti na vašem stroji, chvíli potrvá.
|
|
2480 Vždy, když demux_mpg ohlásí změnu snímkové rychlosti, řádek těsně nad hlášením
|
|
2481 ukáže čas ve kterém ke změně došlo.
|
|
2482 </para>
|
|
2483
|
|
2484 <para>
|
|
2485 Občas je progresivní video na DVD označeno jako
|
|
2486 "soft-telecine" protože je zamýšleno, aby telecine provedl DVD
|
|
2487 přehrávač.
|
|
2488 </para>
|
|
2489 </sect3>
|
|
2490
|
|
2491 <sect3 id="menc-feat-telecine-ident-telecined">
|
|
2492 <title>Telecinováno (přepsáno pro NTSC televizi)</title>
|
|
2493 <para>
|
|
2494 Telecinované video bylo původně natočeno při 24000/1001, ale bylo telecinováno
|
|
2495 <emphasis>před</emphasis> zápisem na DVD.
|
|
2496 </para>
|
|
2497
|
|
2498 <para>
|
|
2499 <application>MPlayer</application> (nikdy) nehlásí žádnou změnu snímkové
|
|
2500 rychlosti, když přehrává telecinované video.
|
|
2501 </para>
|
|
2502
|
|
2503 <para>
|
|
2504 Při sledování telecinovaného videa uvidíte prokladové artefakty, které jako by
|
|
2505 "blikaly": opakovaně mizí a objevují se.
|
|
2506 Blíže se na to můžete podívat:
|
|
2507 <orderedlist>
|
|
2508 <listitem>
|
|
2509 <screen>mplayer dvd://1</screen>
|
|
2510 </listitem>
|
|
2511 <listitem><para>
|
|
2512 Převiňte na část s pohybem.
|
|
2513 </para></listitem>
|
|
2514 <listitem><para>
|
|
2515 Použijte klávesu <keycap>.</keycap> pro krokování po jednom snímku.
|
|
2516 </para></listitem>
|
|
2517 <listitem><para>
|
|
2518 Sledujte vzor prokládaně vypadajících a progresivně vypadajících snímků.
|
|
2519 Pokud je vzor, který sledujete PPPII,PPPII,PPPII,..., pak je video
|
|
2520 telecinováno. Pokud vidíte jiný vzor, pak mohlo být video telecinováno
|
|
2521 použitím nějaké nestandardní metody; <application>MEncoder</application>
|
|
2522 neumí bezztrátově převést nestandardní telecine do progresivního. Pokud
|
|
2523 nevidíte žádný vzor, pak je video nejspíš prokládané.
|
|
2524 </para></listitem>
|
|
2525 </orderedlist>
|
|
2526 </para>
|
|
2527
|
|
2528 <para>
|
|
2529 Někdy je telecinované video na DVD označeno jako "hard-telecine".
|
|
2530 Jelikož hard-telecine již je ve 60000/1001 půlsnímcích za sekundu, DVD
|
|
2531 přehrávač přehraje video bez jakýchkoli manipulací.
|
|
2532 </para>
|
|
2533 </sect3>
|
|
2534
|
|
2535 <sect3 id="menc-feat-telecine-ident-interlaced">
|
|
2536 <title>Prokládané</title>
|
|
2537 <para>
|
|
2538 Prokládané video bylo od samého začátku filmováno při 60000/1001 půlsnímcích
|
|
2539 za sekundu a uloženo na DVD ve 30000/1001 snímcích za sekundu. Efekt
|
|
2540 prokládání (často označovaný jako "roztřepení") je výsledkem
|
|
2541 skládání půlsnímků do snímků. Vzdálenost mezi půlsnímky má být 1/(60000/1001)
|
|
2542 sekundy a proto když jsou zobrazeny současně, je rozdíl jasně patrný.
|
|
2543 </para>
|
|
2544
|
|
2545 <para>
|
|
2546 Stejně jako u telecinovaného videa by <application>MPlayer</application> neměl
|
|
2547 hlásit jakékoli změny snímkové rychlosti při přehrávání prokládaného obsahu.
|
|
2548 </para>
|
|
2549
|
|
2550 <para>
|
|
2551 Když si prohlédnete video blíže pomocí krokování snímků pomocí klávesy
|
|
2552 <keycap>.</keycap>, uvidíte, že každý jednotlivý snímek je prokládaný.
|
|
2553 </para>
|
|
2554 </sect3>
|
|
2555
|
|
2556 <sect3 id="menc-feat-telecine-ident-mixedpt">
|
|
2557 <title>Smíšené progresivní a telecinované</title>
|
|
2558 <para>
|
|
2559 Veškerý obsah "smíšeného progresivního a telecinovaného" videa měl
|
|
2560 původně 24000/1001 snímků za sekundu, ale některé části prošly telecine.
|
|
2561 </para>
|
|
2562
|
|
2563 <para>
|
|
2564 Když <application>MPlayer</application> přehrává tuto kategorii, bude (často
|
|
2565 i opakovaně) přepínat mezi "30000/1001 snímky/s NTSC"
|
|
2566 a "24000/1001 snímky/s progresivním NTSC". Sledujte spodek
|
|
2567 <application>MPlayer</application>ova výstupu, abyste zachytili tyto zprávy.
|
|
2568 </para>
|
|
2569
|
|
2570 <para>
|
|
2571 Měli byste prověřit části se "30000/1001 snímky/s NTSC", abyste měli
|
|
2572 jistotu, že jsou skutečně telecinovány a ne jen prokládané.
|
|
2573 </para>
|
|
2574 </sect3>
|
|
2575
|
|
2576 <sect3 id="menc-feat-telecine-ident-mixedpi">
|
|
2577 <title>Smíšené progresivní a prokládané</title>
|
|
2578 <para>
|
|
2579 Ve "smíšeném progresivním a prokládaném" obsahu bylo progresivní a
|
|
2580 prokládané video splácáno dohromady.
|
|
2581 </para>
|
|
2582
|
|
2583 <para>
|
|
2584 Tato kategorie vypadá jako "smíšené progresivní a telecine",
|
|
2585 dokud si neprohlédnete části se 30000/1001 snímky/s a neuvidíte, že nemají
|
|
2586 telecine vzor.
|
|
2587 </para>
|
|
2588 </sect3>
|
|
2589
|
|
2590 </sect2>
|
|
2591
|
|
2592 <sect2 id="menc-feat-telecine-encode">
|
|
2593 <title>Jak enkódovat jednotlivé kategorie</title>
|
|
2594 <para>
|
|
2595 Jak jsem se zmínil na začátku, příklady příkazových řádků
|
|
2596 <application>MEncoder</application>u níže <emphasis role="bold">nejsou</emphasis>
|
|
2597 určeny pro praktické použití; pouze demonstrují, minimum voleb nutných k tomu,
|
|
2598 abyste správně enkódovali každou kategorii.
|
|
2599 </para>
|
|
2600
|
|
2601 <sect3 id="menc-feat-telecine-encode-progressive">
|
15220
|
2602 <title>Progresivní</title>
|
15219
|
2603 <para>
|
|
2604 Progresivní video nevyžaduje žádné speciální filtrování pro enkódování.
|
|
2605 Jediná volba, která by určitě neměla chybět je
|
|
2606 <option>-ofps 24000/1001</option>. Jinak se <application>MEncoder</application>
|
|
2607 pokusí enkódovat při 30000/1001 snímcích/s a bude opakovat snímky.
|
|
2608 </para>
|
|
2609
|
|
2610 <para>
|
|
2611 <screen>mencoder dvd://1 -nosound -ovc lavc -ofps 24000/1001</screen>
|
|
2612 </para>
|
|
2613
|
|
2614 <para>
|
|
2615 Často se stává, že video, které vypadá progresivně, má v sobě zamíchány
|
|
2616 kratičké telecinované části. Pokud si nejste jisti, je nejbezpečnější
|
|
2617 považovat video za
|
|
2618 <link linkend="menc-feat-telecine-encode-mixedpt">smíšené progresivní a
|
|
2619 telecinované</link>. Ztráta výkonu je jen malá
|
|
2620 <link linkend="menc-feat-telecine-footnotes">[3]</link>.
|
|
2621 </para>
|
|
2622 </sect3>
|
|
2623
|
|
2624 <sect3 id="menc-feat-telecine-encode-telecined">
|
|
2625 <title>Telecinované</title>
|
|
2626 <para>
|
|
2627 Telecine lze obrátit a dostat tak původní 24000/1001 obsah, za použití metody
|
|
2628 zvané inverzní telecine.
|
|
2629 <application>MPlayer</application> má několik filtrů právě pro tuto činnost;
|
|
2630 nejlepší z těchto filtrů, <option>pullup</option>, je popsán v části
|
|
2631 <link linkend="menc-feat-telecine-encode-mixedpt">smíšené progresivní a
|
|
2632 telecinované</link>.
|
|
2633 </para>
|
|
2634 </sect3>
|
|
2635
|
|
2636 <sect3 id="menc-feat-telecine-encode-interlaced">
|
|
2637 <title>Prokládané</title>
|
|
2638 <para>
|
|
2639 V praxi není většinou možné dostat kompletní progresivní video z prokládaného
|
|
2640 obsahu. Jediný způsob jak to udělat bez ztráty poloviny svislého rozlišení je
|
|
2641 zdvojením snímkové rychlosti a zkusit "odhadnout" co mám provést
|
|
2642 s odpovídajícími linkami každého z půlsnímků (má to ovšem i nevýhody –
|
|
2643 viz metoda 3).
|
|
2644 </para>
|
|
2645
|
|
2646 <orderedlist>
|
|
2647 <listitem><para>
|
|
2648 Enkódujte video v prokládané formě. Obvykle prokládání způsobí těžkou újmu
|
|
2649 schopnosti enkodéru dobře komprimovat, ale
|
|
2650 <systemitem class="library">libavcodec</systemitem> má dvě volby určené právě
|
|
2651 pro lepší ukládání prokládaného videa: <option> ildct</option> a
|
|
2652 <option>ilme</option>. Rovněž velmi doporučujeme použití volby
|
|
2653 <option>mbd=2</option> <link linkend="menc-feat-telecine-footnotes">[2] </link>
|
|
2654 protože bude enkódovat makrobloky jako neprokládané tam, kde není žádný pohyb.
|
|
2655 Volba <option>-ofps</option> zde <emphasis role="bold">není</emphasis> nutná.
|
|
2656
|
|
2657 <screen>mencoder dvd://1 -nosound -ovc lavc -lavcopts ildct:ilme:mbd=2</screen>
|
|
2658 </para></listitem>
|
|
2659 <listitem><para>
|
|
2660 Použijte filtr odstraňující proklad před enkódováním. Je jich zde několik,
|
|
2661 můžete si vybrat. Každý z nich má svá pro i proti. Prohlédněte si výstup
|
|
2662 <option>mplayer -pphelp</option> abyste zjistili, které jsou k dispozici
|
|
2663 (grep pro "deint") a vyhledejte
|
|
2664 <ulink url="http://www.mplayerhq.hu/homepage/design6/info.html#mailing_lists">
|
|
2665 e-mailové konference MPlayeru</ulink>, kde naleznete mnoho diskusí o různých
|
|
2666 filtrech. Snímková rychlost se ani zde nemění, takže žádné
|
|
2667 <option>-ofps</option>. Odstranění proklady by rovněž mělo být provedeno po
|
|
2668 ořezání <link linkend="menc-feat-telecine-footnotes">[1]</link>, ale před
|
|
2669 škálováním.
|
|
2670
|
|
2671 <screen>mencoder dvd://1 -nosound -vf pp=lb -ovc lavc</screen>
|
|
2672 </para></listitem>
|
|
2673 <listitem><para>
|
|
2674 Naneštěstí je tato volba vadná v <application>MEncoder</application>u;
|
|
2675 měla by dobře pracovat v <application>MEncoder G2</application>, ale ten tu
|
|
2676 zatím není. Stejně je určením <option> -vf tfields</option> vytvoření
|
|
2677 kompletního snímku z každého půlsnímku, což zvýší snímkovou rychlost na
|
|
2678 60000/1001. Výhoda tohoto přístupu je v tom, že nepřijdete o žádná data;
|
|
2679 Protože však každý snímek pochází jen z jediného půlsnímku, musí být chybějící
|
|
2680 linky nějak dopočítány. Neexistuje mnoho dobrých metod, generujících chybějící
|
|
2681 data, takže výsledek bude trochu podobný tomu, když se použije některý filtr
|
|
2682 odstraňující proklad.
|
|
2683 Generováním chybějících linek vznikají další problémy tím, že se zdvojnásobí
|
|
2684 množství dat. Takže jsou potřeba vyšší datové toky pro enkódování, aby byla
|
|
2685 zachována kvalita a spotřebuje se více výkonu CPU jak pro enkódování, tak pro
|
|
2686 dekódování. tfields má několik různých voleb pro volbu způsobu generování
|
|
2687 chybějících linek. Pokud použijete tuto možnost, prostudujte si manuál a
|
|
2688 zvolte si volbu, která s vaším materiálem vypadá nejlépe.
|
|
2689 Poznamenejme, že při použití <option>tfields</option>
|
|
2690 <emphasis role="bold">musíte</emphasis> nastavit <option>-fps</option> a
|
|
2691 <option>-ofps</option> na dvojnásobek snímkové rychlosti originálu.
|
|
2692
|
|
2693 <screen>mencoder dvd://1 -nosound -vf tfields=2 -ovc lavc -fps 60000/1001 -ofps 60000/1001</screen>
|
|
2694 </para></listitem>
|
|
2695 <listitem><para>
|
|
2696 Pokud plánujete výrazné zmenšování, můžete extrahovat a enkódovat jen jeden
|
|
2697 z půlsnímků. Samozřejmě přijdete o polovinu svislého rozlišení, ale pokud
|
|
2698 plánujete zmenšení ideálně na 1/2 originální velikosti, nebude na této ztrátě
|
|
2699 vůbec záležet. Výsledek bude progresivní soubor s 30000/1001 snímky za sekundu.
|
|
2700 Celý postup spočívá v použití <option>-vf field</option> a následném ořezu
|
|
2701 <link linkend="menc-feat-telecine-footnotes">[1]</link> a příslušném
|
|
2702 škálování. Pamatujte, že musíte nastavit scale tak, aby kompenzoval
|
|
2703 zmenšení svislého rozměru na polovinu.
|
|
2704 <screen>mencoder dvd://1 -nosound -vf field=0 -ovc lavc</screen>
|
|
2705 </para></listitem>
|
|
2706 </orderedlist>
|
|
2707 </sect3>
|
|
2708
|
|
2709 <sect3 id="menc-feat-telecine-encode-mixedpt">
|
|
2710 <title>Smíšené progresivní a telecinované</title>
|
|
2711 <para>
|
|
2712 Abychom převedli smíšené progresivní a telecinované video zcela na progresivní
|
|
2713 video, musí být telecinované části inverzně telecinovány. K tomu lze dospět
|
|
2714 třemi postupy popsanými níže.Poznamenejme, že byste měli
|
|
2715 <emphasis role="bold">vždy</emphasis> provést inverzní telecine před
|
|
2716 jakýmkoliv škálováním; a v případě, že přesně nevíte co děláte, také před
|
|
2717 ořezáním <link linkend="menc-feat-telecine-footnotes">[1]</link>.
|
|
2718 Volba <option>-ofps 24000/1001</option> je vyžadována, protože výstupní video
|
|
2719 bude mít 24000/1001 snímků za sekundu.
|
|
2720 </para>
|
|
2721
|
|
2722 <itemizedlist>
|
|
2723 <listitem><para>
|
|
2724 <option>-vf pullup</option> je navržen tak, aby inverzně telecinoval, ale
|
|
2725 progresivní data nechával jak jsou. Pro správnou funkci
|
|
2726 <emphasis role="bold">musí</emphasis> být <option>pullup</option> následován
|
|
2727 filtrem <option>softskip</option>, jinak <application>MEncoder</application>
|
|
2728 zhavaruje. <option>pullup</option> je však nejčistší a nejpřesnější dostupnou
|
|
2729 metodou pro enkódování jak telecinovaného, tak "smíšeného progresivního a
|
|
2730 telecinovaného".
|
|
2731
|
|
2732 <screen>mencoder dvd://1 -nosound -vf pullup,softskip -ovc lavc -ofps 24000/1001</screen>
|
|
2733 </para>
|
|
2734
|
|
2735
|
|
2736 </listitem>
|
|
2737 <listitem><para>
|
|
2738 Starší metodou je, spíše než inverzně telecinovat telecinované části,
|
|
2739 telecinovat progresivní části a poté inverzně telecinovat celé video.
|
|
2740 Zmatení? softpulldown je filtr, který projde celé video a převede celý soubor
|
|
2741 na telecinovaný. Pokud budeme následovat softpulldown buď
|
|
2742 <option>detc</option> nebo <option>ivtc</option>, bude konečný výsledek zcela
|
|
2743 progresivní. Nutná je volba <option>-ofps 24000/1001</option>.
|
|
2744
|
|
2745 <screen>mencoder dvd://1 -nosound -vf softpulldown,ivtc=1 -ovc lavc -ofps 24000/1001</screen>
|
|
2746 </para>
|
|
2747 </listitem>
|
|
2748
|
|
2749 <listitem><para>
|
|
2750 Osobně jsem nepoužil <option>-vf filmdint</option>, ale toto o něm (přibližně)
|
|
2751 řekl D Richard Felker III:
|
|
2752
|
|
2753 <blockquote><para>Je to OK, ale IMO to zkouší až příliš často odstraňovat
|
|
2754 proklad místo provádění inverzního telecine (stejně jako settop DVD
|
|
2755 přehrávače & progresivní televize) což vede ke škaredému třepotání a
|
|
2756 dalším artefaktům. Pokud jej chcete používat, měli byste předtím alespoň
|
|
2757 trochu času věnovat ladění voleb a sledováním výstupu, abyste měli jistotu,
|
|
2758 že vám to něco nekazí.</para></blockquote>
|
|
2759 </para></listitem>
|
|
2760 </itemizedlist>
|
|
2761 </sect3>
|
|
2762
|
|
2763 <sect3 id="menc-feat-telecine-encode-mixedpi">
|
|
2764 <title>Smíšené progresivní a prokládané</title>
|
|
2765 <para>
|
|
2766 Máme dvě volby pro práci s touto kategorií, obě jsou však kompromisem. Měli
|
|
2767 byste se rozhodnout podle trvání/umístění každého typu.
|
|
2768 </para>
|
|
2769
|
|
2770 <itemizedlist>
|
|
2771 <listitem><para>
|
|
2772 Považujte to za progresivní. Prokládané části budou vypadat prokládaně a
|
|
2773 některé z prokládaných políčen bude muset být zahozeno, což povede
|
|
2774 k nestejnoměrnému poskakování. Můžete proti tomu nasadit postprocesní filtr,
|
|
2775 pokud chcete, ale tím mírně degradujete progresivní části.
|
|
2776 </para>
|
|
2777
|
|
2778 <para>
|
|
2779 Této volbě byste se měli rozhodně vyhnout, pokud chcete nakonec zobrazovat
|
|
2780 video na zobrazovači s prokládaným obrazem (přes TV kartu například).
|
|
2781 Pokud máte prokládané snímky ve videu s rychlostí 24000/1001 snímků za
|
|
2782 sekundu, budou telecinovány spolu s progresivními snímky. Polovina
|
|
2783 prokládaných "snímků" bude zobrazena po dobu trvání třech snímků
|
|
2784 (3/(60000/1001) sekund), což povede k poskakování. Efekt
|
|
2785 "cukání zpět" vypadá skutečně zle. Pokud se o to přece pokusíte,
|
|
2786 <emphasis role="bold">musíte</emphasis> použít filtr odstraňující proklad,
|
|
2787 jako je <option>lb</option> nebo <option>l5</option>.
|
|
2788 </para>
|
|
2789
|
|
2790 <para>
|
|
2791 Špatnou volbou je to i pro progresivní zobrazovač. Ten zahodí páry po sobě
|
|
2792 jdoucích snímků, což povede k přerušování, které může být více viditelné, než
|
|
2793 při druhé metodě, která zobrazuje některé progresivní snímky dvakrát.
|
|
2794 Prokládané video se 30000/1001 snímky za sekundu je totiž poněkud trhané,
|
|
2795 protože by ve skutečnosti mělo být promítáno při 60000/1001 půlsnímcích za
|
|
2796 sekundu, takže zdvojení některých snímků není tak moc vidět.
|
|
2797 </para>
|
|
2798
|
|
2799 <para>
|
|
2800 V každém případě je nejlepší posoudit obsah a způsob, jakým bude zobrazován.
|
|
2801 Pokud je vaše video z 90% progresivní a nikdy jej nebudete pouštět na
|
|
2802 televizi, měli byste volit progresivní přístup.
|
|
2803 Pokud je progresívní jen z poloviny, pravděpodobně jej bude lepší enkódovat
|
|
2804 jako ba bylo celé prokládané.
|
|
2805 </para>
|
|
2806 </listitem>
|
|
2807
|
|
2808 <listitem><para>
|
|
2809 Pokládat jej za prokládané. Některé snímky v progresivních částech budou muset
|
|
2810 být duplikovány, což povede k nepravidelnému poskakování. Opět platí, že
|
|
2811 filtry pro odstranění prokladu mohou poněkud degradovat progresivní části.
|
|
2812 </para></listitem>
|
|
2813
|
|
2814 </itemizedlist>
|
|
2815 </sect3>
|
|
2816
|
|
2817 </sect2>
|
|
2818
|
|
2819 <sect2 id="menc-feat-telecine-footnotes">
|
|
2820 <title>Poznámky pod čarou</title>
|
|
2821 <orderedlist>
|
|
2822 <listitem><formalpara>
|
|
2823 <title>K ořezu:</title>
|
|
2824 <para>
|
|
2825 Video data na DVD jsou ukládána ve formátu zvaném YUV 4:2:0. V YUV videu jsou,
|
|
2826 jasová ("černobílá"; angl. luma) a barvonosná (angl. chroma) složka
|
|
2827 ukládány odděleně. Protože je lidské oko méně citlivé na změnu barvy, než na
|
|
2828 jas, připadá v YUV 4:2:0 obrázku pouze jeden barvonosný pixel na každé čtyři
|
|
2829 jasové pixely. V progresivním obrázku má každý čtverec 2x2 jasovými pixely
|
|
2830 právě jeden barvonosný pixel. Proto musíte ořezávat progresivní YUV 4:2:0
|
|
2831 na sudé rozměry a používat sudé odsazení (offsety). Například
|
|
2832 <option>crop=716:380:2:26</option> je OK, ale
|
|
2833 <option>crop=716:380:3:26 </option> není.
|
|
2834 </para>
|
|
2835 </formalpara>
|
|
2836
|
|
2837 <para>
|
|
2838 Když máte co do činění s prokládaným YUV 4:2:0, je situace mnohem
|
|
2839 komplikovanější. Místo každých čtyřech pixelů v <emphasis>rámu</emphasis>
|
|
2840 sdílejících barvonosný pixel, každé čtyři jasové pixely v každém
|
|
2841 <emphasis>půlsnímku</emphasis> sdílejí barvonosný pixel. Když jsou půlsnímky
|
|
2842 proloženy do snímku, každá linka má výšku jeden pixel. A nyní místo aby dané
|
|
2843 čtyři pixely tvořily čtverec, jsou první dva vedle sebe a druhé dva jsou vedle
|
|
2844 sebe o dvě linky níž. Dva pixely těsně pod nimi patří do jiného půlsnímku a
|
|
2845 proto sdílí jiný barvonosný pixel se dvěma jasovými pixely o dva řádky níž.
|
|
2846 Všechno tohle nás nutí mít svislé rozměry ořezání a odsazení bezezbytku
|
|
2847 dělitelné čtyřmi. Vodorovné stačí mohou zůstat jen sudé.
|
|
2848 </para>
|
|
2849
|
|
2850 <para>
|
|
2851 Pro telecinované video doporučuji, abyste ořezání prováděli až po inverzi
|
|
2852 telecine. Jakmile je video progresivní, stačí řezat jen na sudé rozměry.
|
|
2853 Pokud si však přece jen chcete dopřát mírné zrychlení, které může poskytnout
|
|
2854 časný ořez, musíte svisle dodržet násobky čtyřech, jinak nebude mít filtr
|
|
2855 pro inverzi telecine správná data.
|
|
2856 </para>
|
|
2857
|
|
2858 <para>
|
|
2859 Prokládané (nikoli telecinované) video musíte vždy ořezávat svisle násobky
|
|
2860 čtyř, pokud před ořezáním nepoužijete <option>-vf field</option>.
|
|
2861 </para>
|
|
2862 </listitem>
|
|
2863
|
|
2864 <listitem><formalpara>
|
|
2865 <title>K volbám pro enkódování a kvalitě:</title>
|
|
2866 <para>
|
|
2867 Jen proto, že doporučuji <option>mbd=2</option> zde neznamená, že by tato
|
|
2868 volba nemohla být použita jinde. V kombinaci s <option>trell</option>, je
|
|
2869 <option>mbd=2</option> jednou ze dvou voleb
|
|
2870 <systemitem class="library">libavcodec</systemitem>u, které nejvíce zvyšují
|
|
2871 kvalitu a vy byste měli vždy použít alespoň tyto dvě, pokud není na škodu
|
|
2872 zpomalení rychlosti enkódování (např. při enkódování v reálném čase).
|
|
2873 Mnoho dalších voleb <systemitem class="library">libavcodec</systemitem>u
|
|
2874 zvyšuje kvalitu enkódování (a snižuje jeho rychlost), ale to je mimo zaměření
|
|
2875 tohoto textu.
|
|
2876 </para>
|
|
2877 </formalpara>
|
|
2878 </listitem>
|
|
2879
|
|
2880 <listitem><formalpara>
|
|
2881 <title>K výkonu filtru pullup:</title>
|
|
2882 <para>
|
|
2883 Použití <option>pullup</option> je bezpečné (spolu se <option>softskip
|
|
2884 </option>) ne progresivní video a je to obvykle dobrá volba, pokud nebyl zdroj
|
|
2885 prověřen, že je celý progresivní. Ve většině případů je ztráta výkonu malá.
|
|
2886 V ojedinělých případech enkódování způsobí <option>pullup</option>, že je
|
|
2887 <application>MEncoder</application> o 50% pomalejší. Přidání zpracování zvuku
|
|
2888 a pokročilých <option>lavcopts</option> zastíní tento rozdíl tak, že rozdíl
|
|
2889 v rychlosti působený použitím <option>pullup</option> se sníží na 2%.
|
|
2890 </para>
|
|
2891 </formalpara>
|
|
2892 </listitem>
|
|
2893
|
|
2894 <!-- Some further explanation, because of homonym problem in interlace and
|
|
2895 interleave translation. If anybody wants it in english, just ask. -->
|
|
2896
|
|
2897 <listitem><formalpara>
|
|
2898 <title>K překladu:</title>
|
|
2899 <para>
|
|
2900 Překlad slov interlace a interleave je velmi obtížný, protože vede k jedinému
|
|
2901 českému ekvivalentu – prokládání. V prvním případě (interlace) se jedná
|
|
2902 o prokládání obrázku, kdy se z lichých a sudých řádků vytvoří dva půlsnímky,
|
|
2903 což je běžné v TV.
|
|
2904 Prokládání (interleave) je naproti tomu sloučení různého obsahu (zvuk, video)
|
|
2905 do jediného souboru – kontejneru (např. AVI) tak, že se každá složka
|
|
2906 rozdělí na malé části (tzv. chunky) a ty se pak jeden za druhým ukládají podle
|
|
2907 určitého vzoru. O to se stará muxer (multiplexer). Abychom dostali zpět
|
|
2908 jednotlivé složky, musíme poskládat proházené kousky zase zpět, o což se stará
|
|
2909 demuxer (demultiplexor).
|
|
2910
|
|
2911 </para>
|
|
2912 </formalpara>
|
|
2913 </listitem>
|
|
2914
|
|
2915 </orderedlist>
|
|
2916
|
|
2917 </sect2>
|
|
2918
|
|
2919 </sect1>
|
|
2920
|
|
2921 </chapter>
|