Mercurial > mplayer.hg
annotate DOCS/xml/it/encoding-guide.xml @ 30939:1eb76f19daae
updated table of libavcodec's audio codecs
| author | ptt |
|---|---|
| date | Thu, 01 Apr 2010 17:37:13 +0000 |
| parents | 0f1b5b68af32 |
| children | acca18850841 |
| rev | line source |
|---|---|
| 25279 | 1 <?xml version="1.0" encoding="utf-8"?> |
| 30939 | 2 <!-- 44% synced with r22753 (row 2377) --> |
| 25279 | 3 <chapter id="encoding-guide"> |
| 4 <title>La codifica con <application>MEncoder</application></title> | |
| 5 | |
| 6 <sect1 id="menc-feat-dvd-mpeg4"> | |
| 7 <title>Produrre un rip di un film da DVD in un | |
| 8 MPEG-4 ("DivX") di alta qualità</title> | |
| 9 | |
| 10 <para> | |
| 25449 | 11 Una domanda frequente è "Come posso generare il rip con la migliore qualità |
| 25279 | 12 per una dimensione data?". Un'altra domanda è "Come posso fare il rip da DVD |
| 13 migliore in assoluto? Non mi interessa la dimensione del file, voglio solo la | |
| 14 più alta qualità." | |
| 15 </para> | |
| 16 | |
| 17 <para> | |
| 18 L'ultima domanda è perlomeno forse posta malamente. Dopo tutto, se non ti | |
| 19 interessa la dimensione del file, perché non ti copi semplicemente l'intero | |
| 20 flusso video MPEG-2 dal DVD? Certo, avrai un AVI di 5GB, prendere o lasciare, | |
| 21 ma se vuoi la miglior qualità e non ti importa della dimensione, è | |
| 22 sicuramente la scelta migliore. | |
| 23 </para> | |
| 24 | |
| 25 <para> | |
| 26 Invero, la ragione per cui vuoi codificare un DVD in MPEG-4 è proprio perché | |
| 27 ti interessa <emphasis role="bold">davvero</emphasis> la dimensione del file. | |
| 28 </para> | |
| 29 | |
| 30 <para> | |
| 31 E' difficile offrire una ricetta da libro su come generare un rip da DVD in | |
| 32 qualità molto alta. Bisogna considerare vari fattori, e dovresti comprendere | |
| 33 questi dettagli, altrimenti alla fine probabilmente sarai insoddisfatto del | |
| 34 risultato. Più sotto evidenziamo alcuni di questi argomenti e poi passiamo ad | |
| 35 esaminare un esempio. Partiamo dal principio che per codificare il video tu | |
| 36 stia usando <systemitem class="library">libavcodec</systemitem> anche se la | |
| 37 teoria si applica allo stesso modo agli altri codec. | |
| 38 </para> | |
| 39 | |
| 40 <para> | |
| 41 Se questo ti sembra troppo, dovresti probabilmente usare una delle belle | |
| 42 interfacce elencate nella | |
| 43 <ulink url="http://www.mplayerhq.hu/design7/projects.html#mencoder_frontends">sezione su MEncoder</ulink> | |
| 44 nella pagina dei progetti collegati (related projects). | |
| 45 In tal modo riuscirai ad ottenere rip di alta qualità senza pensarci troppo, | |
| 46 dato che la maggior parte di questi strumenti sono progettati per prendere | |
| 47 decisioni sagge al tuo posto. | |
| 48 </para> | |
| 49 | |
| 50 <!-- ********** --> | |
| 51 | |
| 52 <sect2 id="menc-feat-dvd-mpeg4-preparing-encode"> | |
| 53 <title>Prepararsi alla codifica: identificare il materiale sorgente e la frequenza fotogrammi (framerate)</title> | |
| 54 | |
| 55 <para> | |
| 56 Prima ancora di pensare a codificare un film, devi fare alcuni passi | |
| 57 preliminari. | |
| 58 </para> | |
| 59 | |
| 60 <para> | |
| 61 Il primo e più importante passo prima della codifica dovrebbe essere | |
| 62 determinare il tipo di contenuto che stai trattando. | |
| 63 Se il tuo materiale di partenza arriva da un DVD o da TV in | |
| 64 broadcast/via cavo/satellite, sarà salvato in uno dei due formati: NTSC per | |
| 65 il Nord America e il Giappone, PAL per l'Europa, etc... | |
| 66 E' importante tuttavia comprendere che questo è solo il formato per la | |
| 67 trasmissione in televisione, e spesso <emphasis role="bold">non</emphasis> | |
| 68 corrisponde al formato originario del film. | |
| 69 L'esperienza insegna che il materiale NTSC è molto più difficile da | |
| 70 codificare, perché ci sono più elementi da identificare nel sorgente. | |
| 71 Per generare una codifica adeguata, devi sapere il formato originario. | |
| 72 Il non tenerne conto porterà a molti __flaws__ nella tua codifica, inclusi | |
| 73 artefatti orrendi __combing__ (interlacing) e fotogrammi duplicati o addirittura | |
| 74 perduti. | |
| 25449 | 75 Oltre ad essere brutti, gli artefatti influenzano negativamente l'efficienza |
| 25279 | 76 della codifica: otterrai una peggior qualità a parità di bitrate. |
| 77 </para> | |
| 78 | |
| 79 | |
| 80 <sect3 id="menc-feat-dvd-mpeg4-preparing-encode-fps"> | |
| 81 <title>Identificare la frequenza fotogrammi (framerate) del sorgente</title> | |
| 82 | |
| 83 <para> | |
| 84 C'è qui un elenco di tipi comuni di materiale sorgente, dove facilmente si | |
| 85 trovano e le loro proprietà: | |
| 86 </para> | |
| 87 | |
| 88 <itemizedlist> | |
| 89 <listitem><para> | |
| 90 <emphasis role="bold">Film standard</emphasis>: prodotti per la visione | |
| 91 su schermi da cinema a 24fps. | |
| 92 </para></listitem> | |
| 93 <listitem><para> | |
| 94 <emphasis role="bold">Video PAL</emphasis>: registrati con una videocamera | |
| 95 PAL a 50 campi al secondo. | |
| 96 Un campo è composto dalle sole linee pari o dispari di un fotogramma. | |
| 97 La televisione è stata progettata per aggiornarle alternativamente come un | |
| 98 metodo economico di compressione analogica. | |
| 99 L'occhio umano teoricamente compensa la cosa, ma una volta che capisci come | |
| 100 funziona l'interlacciatura imparerai a vederla anche in TV e non ti piacerà | |
| 101 più la TV. | |
| 102 Due campi <emphasis role="bold">non</emphasis> fanno un fotogramma intero, | |
| 103 poiché sono registrati a 1/50 di secondo di distanza nel tempo e quindi non | |
| 104 si allineano a meno che non ci sia movimento alcuno. | |
| 105 </para></listitem> | |
| 106 <listitem><para> | |
| 107 <emphasis role="bold">Video NTSC</emphasis>: registrati con una videocamera | |
| 108 NTSC a 60000/1001 campi al secondi, o 60 campi al secondo nell'era precedente | |
| 109 al colore. | |
| 110 Per il resto sono simili ai PAL. | |
| 111 </para></listitem> | |
| 112 <listitem><para> | |
| 113 <emphasis role="bold">Animazione</emphasis>: solitamente disegnati a 24fps, | |
| 114 ma se ne trovano anche in tipologie con frequenza di fotogrammi mista. | |
| 115 </para></listitem> | |
| 116 <listitem><para> | |
| 117 <emphasis role="bold">Computer Graphics (CG)</emphasis>: possono essere con | |
| 118 qualsiasi frequenza di fotogrammi, ma alcuni sono più comuni di altri; | |
| 119 sono tipici 24 e 30 fotogrammi al secondo per NTSC e 25fps per PAL. | |
| 120 </para></listitem> | |
| 121 <listitem><para> | |
| 122 <emphasis role="bold">Vecchi Film</emphasis>: varie e più basse frequenze di | |
| 123 fotogrammi. | |
| 124 </para></listitem> | |
| 125 </itemizedlist> | |
| 126 </sect3> | |
| 127 | |
| 128 | |
| 129 <sect3 id="menc-feat-dvd-mpeg4-preparing-encode-material"> | |
| 130 <title>Identificare il materiale sorgente</title> | |
| 131 | |
| 132 <para> | |
| 133 I film composti da fotogrammi sono indicati come "progressivi", mentre quelli | |
| 134 composti da campi indipendenti sono chiamati "interlacciati" o video - anche se | |
| 135 quest'ultimo termine è ambiguo. | |
| 136 </para> | |
| 137 | |
| 138 <para> | |
| 139 Per complicare ulteriormente le cose, alcuni film possono essere un misto di | |
| 140 molti dei suddetti. | |
| 141 </para> | |
| 142 | |
| 143 <para> | |
| 144 La più importante distinzione da farsi tra tutti questi formati è che alcuni | |
| 145 sono basati su fotogrammi mentre gli altri sono basati su campi. | |
| 146 <emphasis role="bold">Ogniqualvolta</emphasis> un film viene preparato per la | |
| 147 visualizzazione in televisione (DVD inclusi), viene convertito in un formato | |
| 148 basato su campi. | |
| 149 I vari metodi con cui si può fare sono conosciuti nel loro insieme come | |
| 150 "telecine", di cui il tristemente famoso "3:2 pulldown" NTSC è una tipologia. | |
| 151 A meno che il materiale originale sia anch'esso basato su campi (e con la stessa | |
| 152 frequenza di campi) otterrai un filmato in un formato diverso da quello che è | |
| 153 in origine. | |
| 154 </para> | |
| 155 | |
| 156 <itemizedlist> | |
| 157 <title>Ci sono vari tipi usuali di "pulldown":</title> | |
| 158 <listitem><para> | |
| 159 <emphasis role="bold">Pulldown PAL 2:2</emphasis>: il più bello di tutti. | |
| 160 Ciascun fotogramma viene mostrato per la durata di due campi, estraendo le | |
| 161 linee pari e dispari e mostrandole alternativamente. | |
| 162 Se il materiale di origine è a 24fps questo processo velocizza il filmato | |
| 163 del 4%. | |
| 164 </para></listitem> | |
| 165 <listitem><para> | |
| 166 <emphasis role="bold">Pulldown PAL 2:2:2:2:2:2:2:2:2:2:2:3</emphasis>: | |
| 167 Ogni dodicesimo fotogramma viene mostrato per la durata di tre campi, invece | |
| 168 che solamente per due. | |
| 169 Questo evita il problema dell'aumento del 4% di velocità, ma rende il | |
| 170 processo molto più difficile da __reversare__. | |
| 171 Solitamente viene usato nelle produzioni musicali, dove modificare del 4% la | |
| 172 velocità rovinerebbe pesantemente la colonna sonora. | |
| 173 </para></listitem> | |
| 174 <listitem><para> | |
| 175 <emphasis role="bold">Telecine NTSC 3:2</emphasis>: i fotogrammi vengono | |
| 176 mostrati alternativamente per la durata di 3 o 2 campi. | |
| 177 Questo porta ad una frequenza di campi di 2.5 volte la frequenza orginaria. | |
| 178 Il risultato viene anche leggermente rallentato da 60 campi al secondo fino a | |
| 179 60000/1001 campi al secondo, per mantenere la frequenza dei campi di NTSC. | |
| 180 </para></listitem> | |
| 181 <listitem><para> | |
| 182 <emphasis role="bold">Pulldown NTSC 2:2</emphasis>: utilizzato per mostrare | |
| 183 materiale a 30fps su NTSC. | |
| 184 Carino, proprio come il pulldown PAL 2:2. | |
| 185 </para></listitem> | |
| 186 </itemizedlist> | |
| 187 | |
| 188 <para> | |
| 189 Ci sono anche alcuni metodi per convertire tra video NTSC e PAL, ma gli | |
| 190 arogmenti relativi non sono obiettivo di questa guida. | |
| 191 Se ti trovi di fronte a un film di questo genere e lo vuoi codificare, la tua | |
| 192 scelta migliore è cercarne una copia nel formato originale. | |
| 193 La conversione tra questi due formati è altamente distruttiva e non può | |
| 194 essere __reversed__ in maniera pulita, perciò la tua codifica __soffrirà__ | |
| 195 molto se eseguita da una sorgente convertita. | |
| 196 </para> | |
| 197 | |
| 198 <para> | |
| 199 Quando il video viene salvato du un DVD, coppie consecutive di campi sono | |
| 200 raggruppati in un fotogramma, anche se non sono pensati per esser mostrati | |
| 201 nello stesso momento. | |
| 202 Lo standard MPEG-2 usato sui DVD e per la TV digitale fornisce un modo sia per | |
| 203 codificare i fotogrammi progressivi originali, che uno per memorizzare | |
| 204 nell'intestazione del fotogramma il numero dei campi per cui il fotogramma | |
| 205 stesso debba essere mostrato. | |
| 206 Se viene usato questo metodo il filmato verrà spesso indicato come | |
| 207 "soft telecine", visto che il procedimento indica semplicemente al lettore DVD | |
| 208 di applicare il pulldown al film, invece che modificare il film stesso. | |
| 209 Questa situazione è decisamente preferibile, dato che può essere facilmente | |
| 210 __reversed__ (__actually ignored__) dal condificatore, e dato che mantiene la | |
| 211 massima qualità. | |
| 212 Tuttavia, molti studi di produzione DVD e di trasmissione non usano tecniche di | |
| 213 codifica appropriate, ma al contrario producono filmati con "hard telecine", in | |
| 214 cui i campi sono sotanzialmente duplicati nell'MPEG-2 codificato. | |
| 215 </para> | |
| 216 | |
| 217 <para> | |
| 218 Le modalità per gestire questi casi verranno descritte | |
| 219 <link linkend="menc-feat-telecine">più avanti in questa guida</link>. | |
| 220 Per adesso ti lasciamo alcune indicazioni su come identificare il tipo di | |
| 221 materiale che stai trattando: | |
| 222 </para> | |
| 223 | |
| 224 <itemizedlist> | |
| 225 <title>Regioni NTSC:</title> | |
| 226 <listitem><para> | |
| 227 Se <application>MPlayer</application> dice che la frequenza fotogrammi passa | |
| 228 a 24000/1001 durante la visione del film e non ritorna come prima, è quasi | |
| 229 sicuramente un qualche contenuto progressivo che è stato modificato in | |
| 230 "soft telecine". | |
| 231 </para></listitem> | |
| 232 <listitem><para> | |
| 233 Se <application>MPlayer</application> dice che la frequenza fotogrammi va | |
| 234 avanti e indietro tra 24000/1001 e 30000/1001 e ogni tanto vedi delle "righe", | |
| 235 allora ci sono varie possibilità. | |
| 236 Le parti a 24000/1001 fps sono quasi certamente contenuto progressivo, in | |
| 237 "soft telecine", ma le parti a 30000/1001 fps possono essere sia contenuto in | |
| 238 "hard telecine" a 24000/1001 fps che video NTSC a 60000/1001 campi al secondo. | |
| 239 Usa le stesse linee guida dei due casi seguenti per determinare quale. | |
| 240 </para></listitem> | |
| 241 <listitem><para> | |
| 242 Se <application>MPlayer</application> non mostra mai una modifica alla | |
| 243 frequenza dei fotogrammi e ogni singolo fotogramma con del movimento appare | |
| 244 "rigato", il tuo filmato è video NTSC a 60000/1001 campi al secondo. | |
| 245 </para></listitem> | |
| 246 <listitem><para> | |
| 247 Se <application>MPlayer</application> non mostra mai una modifica alla | |
| 248 frequenza dei fotogrammi e due fotogrammi ogni cinque sono "rigati", il tuo | |
| 249 film è contenuto a 24000/1001fps in "hard telecine". | |
| 250 </para></listitem> | |
| 251 </itemizedlist> | |
| 252 | |
| 253 <itemizedlist> | |
| 254 <title>Regioni PAL:</title> | |
| 255 <listitem><para> | |
| 256 Se non vedi mai alcuna "riga", il tuo film è pulldown 2:2. | |
| 257 </para></listitem> | |
| 258 <listitem><para> | |
| 259 Se vedi delle "righe" che vanno e vengono ogni mezzo secondo, | |
| 260 allora il tuo film è pulldown 2:2:2:2:2:2:2:2:2:2:2:3. | |
| 261 </para></listitem> | |
| 262 <listitem><para> | |
| 263 Se vedi sempre "righe" durante il movimento, allora il tuo film è video | |
| 264 PAL a 50 campi al secondo. | |
| 265 </para></listitem> | |
| 266 </itemizedlist> | |
| 267 | |
| 268 <note><title>Consiglio:</title> | |
| 269 <para> | |
| 270 <application>MPlayer</application> può rallentare la riproduzione del film | |
| 271 con l'opzione -speed o riprodurlo fotogramma per fotogramma. | |
| 272 Prova ad usare <option>-speed</option> 0.2 per guardare molto lentamente il | |
| 273 film o premi ripetutamente il tasto "<keycap>.</keycap>" per riprodurre un | |
| 274 fotogramma per volta ed identificare la sequenza, se non riesci a vederla a | |
| 275 velocità normale. | |
| 276 </para> | |
| 277 </note> | |
| 278 </sect3> | |
| 279 </sect2> | |
| 280 | |
| 281 <!-- ********** --> | |
| 282 | |
| 283 <sect2 id="menc-feat-dvd-mpeg4-2pass"> | |
| 284 <title>Quantizzatore costante vs. multipassaggio</title> | |
| 285 | |
| 286 <para> | |
| 287 E' possibile codificare il filmato in un'ampia gamma di qualità. | |
| 288 Con i codificatori video moderni e un pelo di compressione pre-codec | |
| 289 (ridimensionando e ripulendo), è possibile raggiungere una qualità molto | |
| 290 buona in 700 MB, per un film di 90-110 minuti in widescreen. | |
| 291 Inoltre tutti i film tranne i più lunghi possono essere codificati con una | |
| 292 qualità pressoché perfetta in 1400 MB. | |
| 293 </para> | |
| 294 | |
| 295 <para> | |
| 296 Ci sono tre approcci per codificare il video: bitrate costante (CBR), | |
| 297 quantizzatore costante, e multipassaggio (ABR, o bitrate medio). | |
| 298 </para> | |
| 299 | |
| 300 <para> | |
| 301 La complessità dei fotogrammi di un filmato, e di conseguenza il numero di | |
| 302 bit necessari per comprimerli, può variare molto da una scena ad un'altra. | |
| 303 I codificatori video moderni possono adattarsi via via a queste necessità | |
| 304 e cambiare il bitrate. | |
| 305 In modalità semplici come CBR, tuttavia, i codificatori non sanno il bitrate | |
| 306 necessario alle scene venture e perciò non possono stare sopra al bitrate | |
| 307 richiesto per lunghi periodi di tempo. | |
| 308 Modalità più avanzate, come la codifica in multipassaggio, possono tener | |
| 309 conto delle statistiche del passo precedente; questo corregge il problema | |
| 310 suddetto. | |
| 311 </para> | |
| 312 | |
| 313 <note><title>Nota:</title> | |
| 314 <para> | |
| 315 La maggior parte dei codec che gestisce la codifica in ABR può usare solo la | |
| 316 codifica a due passaggi mentre altri come | |
| 317 <systemitem class="library">x264</systemitem>, | |
| 318 <systemitem class="library">Xvid</systemitem> e | |
| 319 <systemitem class="library">libavcodec</systemitem> gestiscono il | |
| 320 multipassaggio, che migliora leggermente la qualità ad ogni passo, anche se | |
| 321 tale moglioramento non è più misurabile né visibile veramente oltre il | |
| 322 quarto passo o giù di lì. | |
| 323 Perciò in questa sezione due passaggi e multipassaggio avranno lo stesso | |
| 324 significato. | |
| 325 </para> | |
| 326 </note> | |
| 327 | |
| 328 <para> | |
| 329 In ambedue i modi, il codec video (come | |
| 330 <systemitem class="library">libavcodec</systemitem>) spezza il fotogramma video | |
| 331 in macroblocchi da 16x16 pixel e poi applica un quantizzatore a ciascun | |
| 332 macroblocco. Più basso è il quantizzatore, migliore sarà la qualità e | |
| 333 più alto il bitrate. | |
| 334 Il metodo usato dal codificatore del filmato per determinare quale quantizzatore | |
| 335 utilizzare per un dato macroblocco varia ed è altamente configurabile. | |
| 336 (Questa è una semplificazione estrema del vero processo, ma il concetto di base | |
| 337 è comodo per capire.) | |
| 338 </para> | |
| 339 | |
| 340 <para> | |
| 341 Quando specifichi un bitrate constante, il codec video codificherà il video, | |
| 342 scartando dettagli tanto quanto è necessario e il meno possibile, in modo da | |
| 343 rimanere al di sotto del bitrate voluto. Se non ti interessa davvero la | |
| 344 dimensione del file, potresti anche usare CBR e specificare un bitrate | |
| 345 infinito. (In pratica, questo significa un valore abbastanza alto da non porre | |
| 346 limiti, come 10000Kbit.) Con nessun limite sul bitrate, il risultato è che il | |
| 347 codec userà il quantizzatore più basso possibile per ciascun macroblocco | |
| 348 (come specificato da <option>vqmin</option> per | |
| 349 <systemitem class="library">libavcodec</systemitem>, che è 2 di default). | |
| 350 Appena specifichi un bitrate abbastanza basso tale che il codec venga forzato | |
| 351 ad utilizzare un quantizzatore più alto, allora stai sicuramente diminuendo la | |
| 352 qualità del tuo video. | |
| 353 Per evitarlo, dovresti probabilmente ridurre la dimensione del tuo video, | |
| 354 seguendo il metodo descritto più avanti in questa guida. | |
| 355 In generale dovresti evitare del tutto CBR se ti interessa la qualità. | |
| 356 </para> | |
| 357 | |
| 358 <para> | |
| 359 Con il quantizzatore costante, il codec utilizza lo stesso quantizzatore per | |
| 360 ogni macroblocco, come specificato dall'opzione <option>vqscale</option> (per | |
| 361 <systemitem class="library">libavcodec</systemitem>). | |
| 362 Se vuoi la più alta qualità possibile di rip, sempre ignorantdo il bitrate, | |
| 363 puoi usare <option>vqscale=2</option>. | |
| 364 Ciò porterà gli stessi bitrate e PSNR (peak signal-to-noise ratio) come CBR | |
| 365 con <option>vbitrate</option>=infinito e <option>vqmin</option> di default a 2. | |
| 366 </para> | |
| 367 | |
| 368 <para> | |
| 369 Il problema con la quantizzazione costante è che usa il quantizzatore indicato | |
| 370 sia che il macroblocco ne abbia bisogno o no. Perciò è possibile che venga | |
| 371 usato un quantizzatore più alto su un macroblocco senza sacrificare la | |
| 372 qualità visiva. Perché sprecare i bit di un quantizzatore basso che non | |
| 373 serve? La tua CPU ha tanti cicli fin quando c'è tempo, ma c'è solo un certo | |
| 374 numero di bit sul tuo disco rigido. | |
| 375 </para> | |
| 376 | |
| 377 <para> | |
| 378 Con una codifica a due passi, il primo codificherà il filmato come se fosse | |
| 379 CBR, ma manterrà una registrazione delle caratteristiche di ogni fotogramma. | |
| 380 Questi dati sono poi utilizzati durante il secondo passo in modo da effettuare | |
| 381 scelte intelligenti su quale quantizzatore usare. Durante le scene con azione | |
| 382 veloce o molti dettagliate, verrano usati più probabilmente quantizzatori più | |
| 383 alti, e durante scene lente o con pochi dettagli, verranno usati quantizzatori | |
| 384 più bassi. Solitamente è molto più importante la quantità di movimento | |
| 385 che la quantità di dettagli. | |
| 386 </para> | |
| 387 | |
| 388 <para> | |
| 389 Se usi <option>vqscale=2</option>, allora stai sprecando dei bit. Se usi | |
| 390 <option>vqscale=3</option>, allora non stai ottenendo la miglior qualità. | |
| 391 Supponi di rippare un DVD a <option>vqscale=3</option> e che il risultato sia | |
| 392 1800Kbit. Se fai una codifica a due passi con <option>vbitrate=1800</option> il | |
| 393 video risultante avrà una <emphasis role="bold">qualità superiore</emphasis> | |
| 394 a <emphasis role="bold">parità di bitrate</emphasis>. | |
| 395 </para> | |
| 396 | |
| 397 <para> | |
| 398 Dato che ora sei convinto che i due passaggi siano la strada da percorrere, la | |
| 399 vera domanda adesso è quale bitrate usare? La risposta à che non c'è una | |
| 400 risposta definitiva. Idealmente vuoi scegliere un bitrate che porti al miglior | |
| 401 equilibrio tra qualità e dimensione del file. Tutto ciò varia in dipendenza | |
| 402 del video di origine. | |
| 403 </para> | |
| 404 | |
| 405 <para> | |
| 406 Se la dimensione non è importante, un buon punto di partenza per un rip di | |
| 407 qualità molto elevata è intorno a 2000Kbit più o meno 200Kbit. | |
| 408 Per video con scene di azione veloce o con molti dettagli, oppure se | |
| 409 semplicemente hai l'occhio critico, potresti scegliere 2400 o 2600. | |
| 410 Per alcuni DVD potresti non notare alcuna differenza a 1400Kbit. Sperimentare | |
| 411 con alcune scene a vari bitrate è una buona idea per farsi un'opinione. | |
| 412 </para> | |
| 413 | |
| 414 <para> | |
| 415 Se punti a una data dimensione, dovrai calcolare il bitrate in un qualche modo. | |
| 416 Prima di farlo, però, devi sapere quanto spazio devi riservare per la traccia | |
| 417 (le tracce) audio, per cui devi dapprima fare il | |
| 418 <link linkend="menc-feat-dvd-mpeg4-audio">rip di queste</link>. | |
| 419 Puoi calcolare il bitrate con l'equazione che segue: | |
| 420 <systemitem>bitrate = (dimensione_voluta_in_Mbytes - dimensione_audio_in_Mbytes) | |
| 421 * 1024 * 1024 / lunghezza_in_secondi * 8 / 1000</systemitem> | |
| 422 Per esempio, per far stare un film di due ore su un CD da 702MB, con 60MB di | |
| 423 traccia audio, il bitrate video diventerà: | |
| 424 <systemitem>(702 - 60) * 1024 * 1024 / (120*60) * 8 / 1000 | |
| 425 = 740kbps</systemitem> | |
| 426 </para> | |
| 427 </sect2> | |
| 428 | |
| 429 <!-- ********** --> | |
| 430 | |
| 431 <sect2 id="menc-feat-dvd-mpeg4-constraints"> | |
| 432 <title>Vincoli per una codifica efficiente</title> | |
| 433 | |
| 434 <para> | |
| 435 A causa della natura del tipo di compressione MPEG, ci sono alcuni vincoli da | |
| 436 seguire per avere la massima qualità. | |
| 437 L'MPEG divide il video in quadrati da 16x16 chiamati macroblocchi, ciascuno di | |
| 438 essi composto da blocchi 4x4 con informazioni sulla luminanza (intensità) e | |
| 439 due blocchi da 8x8 a metà risoluzione per la crominanza (colore) (uno per | |
| 440 l'asse rosso-ciano e l'altro per l'asse blu-giallo). | |
| 441 Anche se la larghezza e l'altezza del tuo filmato non sono multipli di 16 il | |
| 442 codificatore userà tanti macroblocchi 16x16 in modo da coprire tutta la | |
| 443 superficie dell'immagine, e lo spazio in esubero sarà sprecato. | |
| 444 Indi, per migliorare la qualità a una dimensione prefissata è una brutta | |
| 445 idea utilizzare dimensioni che non siano multiple di 16. | |
| 446 </para> | |
| 447 | |
| 448 <para> | |
| 449 La maggior parte dei DVD ha anche alcune con bordi neri sui lati. Lasciarli lì | |
| 450 avrà un'influenza <emphasis role="bold">molto</emphasis> negativa sulla | |
| 451 qualità in svariati modi. | |
| 452 </para> | |
| 453 | |
| 454 <orderedlist> | |
| 455 <listitem> | |
| 456 <para> | |
| 457 Il tipo di compressione MPEG è pesantemente dipendente dalle trasformazioni | |
| 458 di dominio frequenti, in particolare la "trasformazione discreta del coseno" | |
| 459 (Discrete Cosine Transform (DCT)), che xxièe' simile alla trasformazione di | |
| 460 Fourier. Quest'approccio di codifica è efficiente nella rappresentazione di | |
| 461 motivi e transizioni delicate, ma trova difficoltà con spigoli più | |
| 462 definiti. Per codificarli deve usare molti più bit oppure apparirà un | |
| 463 artefatto conosciuto come 'ringing'. | |
| 464 </para> | |
| 465 | |
| 466 <para> | |
| 467 La trasformazione di frequenza (DCT) prende luogo separatemente in ogni | |
| 468 macroblocco (praticamente in ogni blocco) perciò questo problema si applica | |
| 469 solo quando lo spigolo definito è dentro a un blocco. Se il bordo nero inizia | |
| 470 esattamente sul lato di un multiplo di 16, questo non e' un problema. | |
| 471 Tuttavia i bordi neri sui DVD difficilmente sono ben allineati, perciò | |
| 472 nella realtà dovrai sempre tagliarli via per evitare questi problemi. | |
| 473 </para> | |
| 474 </listitem> | |
| 475 </orderedlist> | |
| 476 | |
| 477 <para> | |
| 478 Oltre alle trasformazioni del dominio di frequenza, il tipo di compressione | |
| 479 MPEG usa dei vettori di movimento per rappresetare le variazioni da un | |
| 480 fotogramma al successivo. Naturalmente i vettori di movimento funzionano molto | |
| 481 meno bene per i nuovi contenuti che arrivano dai bordi dell'immagine, dato che | |
| 482 non erano presenti nel fotogramma precedente. Fintanto che l'immagine arriva | |
| 483 fino al bordo dell'area codificata, i vettori di movimento non incontrano | |
| 484 alcun problema con li contenuto che esce dall'immagine. Tuttavia ci possono | |
| 485 esser problemi quando ci sono dei bordi neri: | |
| 486 </para> | |
| 487 | |
| 488 <orderedlist continuation="continues"> | |
| 489 <listitem> | |
| 490 <para> | |
| 491 Per ogni macroblocco il tipo di compressione MPEG memorizza un vettore, che | |
| 492 identifica quale parte del fotogramma precedente debba essere copiata nel | |
| 493 macroblocco stesso, come base per predire il fotogramma successivo. Serve | |
| 494 codificare solo le differenze restanti. Se un macroblocco oltrepassa il | |
| 495 bordo dell'immagine e contiene parte del bordo nero, allora i vettori di | |
| 496 movimento provenienti da altre zone dell'immagine ricopriranno il bordo | |
| 497 nero. Questo significa che si devono utilizzare molti bit o per riannerire il | |
| 498 bordo che è stato ricoperto, oppure (più verosimilmente) un vettore di | |
| 499 movimento non sarà proprio usato e tutti i cambiamenti in questo | |
| 500 macroblocco dovranno venir esplicitamente codificate. In un modo o nell'altro | |
| 501 si ricuce di gran lunga l'efficienza della codifica. | |
| 502 </para> | |
| 503 | |
| 504 <para> | |
| 505 Inoltre questo problema si applica solo se i bordi neri non sono allinati | |
| 506 su limiti di multipli di 16. | |
| 507 </para> | |
| 508 </listitem> | |
| 509 | |
| 510 <listitem> | |
| 511 <para> | |
| 512 Immagina infine di avere un macroblocco all'interno dell'immagine, ed un | |
| 513 oggetto che passa da questo blocco verso il bordo dell'immagine. La | |
| 514 codifica MPEG non può dire "copia la parte che è dentro all'immagine, ma | |
| 515 non il bordo nero". Perciò anche il bordo nero vi verrà copiato | |
| 516 all'interno, e molti bit saranno sprecati codificando l'immagine che si | |
| 517 suppone stia lì. | |
| 518 </para> | |
| 519 | |
| 520 <para> | |
| 521 Se l'immagine arriva al limite della superficie codificata, l'MPEG ha una | |
| 522 particolare ottimizzazione che consta nel copiare ripetutamente i pixel sul | |
| 523 bordo dell'immagine quando un vettore di movimento arriva dall'esterno della | |
| 524 superficie codificata. Questa funzionalità diventa inutile quando il film | |
| 525 ha dei bordi neri. Diversamente dai problemi 1 e 2, allineare i bordi a | |
| 526 multipli di 16 in questo caso non aiuta. | |
| 527 </para> | |
| 528 </listitem> | |
| 529 | |
| 530 <listitem><para> | |
| 531 A dispetto del fatto che i bordi siano completamente neri e non cambino mai, | |
| 532 c'è perlomeno un piccolo spreco nell'avere più macroblocchi. | |
| 533 </para></listitem> | |
| 534 </orderedlist> | |
| 535 | |
| 536 <para> | |
| 537 Per tutte queste ragioni si consiglia di tagliar via completamente i bordi neri. | |
| 538 Inoltre, se c'è una zona di rumore/distorsione sui bordi dell'immagine, | |
| 539 tagliarla migliorerà ancora l'efficienza di codifica. I puristi videofili che | |
| 540 vogliono mantenere il più possibile l'originale potrebbero obiettare su questo | |
| 541 taglio, ma a meno di non codificare a una quantizzazione costante, la qualità | |
| 542 guadagnata tagliando sorpasserà di gran lunga la quantità di informazioni | |
| 543 perse sui bordi. | |
| 544 </para> | |
| 545 </sect2> | |
| 546 | |
| 547 <!-- ********** --> | |
| 548 | |
| 549 <sect2 id="menc-feat-dvd-mpeg4-crop"> | |
| 550 <title>Tagliare e Ridimensionare</title> | |
| 551 | |
| 552 <para> | |
| 553 Ricorda dalla sezione precedente che la dimensione finale dell'immagine che | |
| 554 codifichi dovrebbe essere un multiplo di 16 (sia in larghezza che altezza). | |
| 555 Si può ottenere ciò tagliando, ridimensionando o combinando le due cose. | |
| 556 </para> | |
| 557 | |
| 558 <para> | |
| 559 Quando tagli, ci sono alcune linee guida che si devono seguire per evitare di | |
| 560 rovinare il tuo filmato. | |
| 561 Il formato YUV abituale, 4:2:0, memorizza le informazioni sulla crominanza | |
| 562 (colore) sottocampionate, per es. la crominanza viene campionata in ogni | |
| 563 direzione solo la metà di quanto venga la luminanza (intensità). | |
| 564 Osserva questo diagramma, dove L indica i punti di campionamente della | |
| 565 luminanza e C quelli della crominanza. | |
| 566 </para> | |
| 567 | |
| 568 <informaltable> | |
| 569 <?dbhtml table-width="40%" ?> | |
| 570 <?dbfo table-width="40%" ?> | |
| 571 <tgroup cols="8" align="center"> | |
| 572 <colspec colnum="1" colname="col1"/> | |
| 573 <colspec colnum="2" colname="col2"/> | |
| 574 <colspec colnum="3" colname="col3"/> | |
| 575 <colspec colnum="4" colname="col4"/> | |
| 576 <colspec colnum="5" colname="col5"/> | |
| 577 <colspec colnum="6" colname="col6"/> | |
| 578 <colspec colnum="7" colname="col7"/> | |
| 579 <colspec colnum="8" colname="col8"/> | |
| 580 <spanspec spanname="spa1-2" namest="col1" nameend="col2"/> | |
| 581 <spanspec spanname="spa3-4" namest="col3" nameend="col4"/> | |
| 582 <spanspec spanname="spa5-6" namest="col5" nameend="col6"/> | |
| 583 <spanspec spanname="spa7-8" namest="col7" nameend="col8"/> | |
| 584 <tbody> | |
| 585 <row> | |
| 586 <entry>L</entry> | |
| 587 <entry>L</entry> | |
| 588 <entry>L</entry> | |
| 589 <entry>L</entry> | |
| 590 <entry>L</entry> | |
| 591 <entry>L</entry> | |
| 592 <entry>L</entry> | |
| 593 <entry>L</entry> | |
| 594 </row> | |
| 595 <row> | |
| 596 <entry spanname="spa1-2">C</entry> | |
| 597 <entry spanname="spa3-4">C</entry> | |
| 598 <entry spanname="spa5-6">C</entry> | |
| 599 <entry spanname="spa7-8">C</entry> | |
| 600 </row> | |
| 601 <row> | |
| 602 <entry>L</entry> | |
| 603 <entry>L</entry> | |
| 604 <entry>L</entry> | |
| 605 <entry>L</entry> | |
| 606 <entry>L</entry> | |
| 607 <entry>L</entry> | |
| 608 <entry>L</entry> | |
| 609 <entry>L</entry> | |
| 610 </row> | |
| 611 <row> | |
| 612 <entry>L</entry> | |
| 613 <entry>L</entry> | |
| 614 <entry>L</entry> | |
| 615 <entry>L</entry> | |
| 616 <entry>L</entry> | |
| 617 <entry>L</entry> | |
| 618 <entry>L</entry> | |
| 619 <entry>L</entry> | |
| 620 </row> | |
| 621 <row> | |
| 622 <entry spanname="spa1-2">C</entry> | |
| 623 <entry spanname="spa3-4">C</entry> | |
| 624 <entry spanname="spa5-6">C</entry> | |
| 625 <entry spanname="spa7-8">C</entry> | |
| 626 </row> | |
| 627 <row> | |
| 628 <entry>L</entry> | |
| 629 <entry>L</entry> | |
| 630 <entry>L</entry> | |
| 631 <entry>L</entry> | |
| 632 <entry>L</entry> | |
| 633 <entry>L</entry> | |
| 634 <entry>L</entry> | |
| 635 <entry>L</entry> | |
| 636 </row> | |
| 637 </tbody> | |
| 638 </tgroup> | |
| 639 </informaltable> | |
| 640 | |
| 641 <para> | |
| 642 Come puoi vedere, le righe e le colonne dell'immagine vengono sempre a coppie. | |
| 643 Quindi i tuoi valori di spostamento e dimensione <emphasis>devono</emphasis> | |
| 644 essere numeri pari. | |
| 645 Se non lo sono la crominanza non sarà più allineata correttamente con la | |
| 646 luminanza. | |
| 647 In teoria è possibile tagliare con uno spostamento dispari, ma richiede che la | |
| 648 crominanza venga ricampionata, il che potenzialmente è un'operazione in perdita | |
| 649 e non è gestita dal filtro crop. | |
| 650 </para> | |
| 651 | |
| 652 <para> | |
| 653 Inoltre, il video interlacciato viene campionato come segue: | |
| 654 </para> | |
| 655 | |
| 656 <informaltable> | |
| 657 <?dbhtml table-width="80%" ?> | |
| 658 <?dbfo table-width="80%" ?> | |
| 659 <tgroup cols="16" align="center"> | |
| 660 <colspec colnum="1" colname="col1"/> | |
| 661 <colspec colnum="2" colname="col2"/> | |
| 662 <colspec colnum="3" colname="col3"/> | |
| 663 <colspec colnum="4" colname="col4"/> | |
| 664 <colspec colnum="5" colname="col5"/> | |
| 665 <colspec colnum="6" colname="col6"/> | |
| 666 <colspec colnum="7" colname="col7"/> | |
| 667 <colspec colnum="8" colname="col8"/> | |
| 668 <colspec colnum="9" colname="col9"/> | |
| 669 <colspec colnum="10" colname="col10"/> | |
| 670 <colspec colnum="11" colname="col11"/> | |
| 671 <colspec colnum="12" colname="col12"/> | |
| 672 <colspec colnum="13" colname="col13"/> | |
| 673 <colspec colnum="14" colname="col14"/> | |
| 674 <colspec colnum="15" colname="col15"/> | |
| 675 <colspec colnum="16" colname="col16"/> | |
| 676 <spanspec spanname="spa1-2" namest="col1" nameend="col2"/> | |
| 677 <spanspec spanname="spa3-4" namest="col3" nameend="col4"/> | |
| 678 <spanspec spanname="spa5-6" namest="col5" nameend="col6"/> | |
| 679 <spanspec spanname="spa7-8" namest="col7" nameend="col8"/> | |
| 680 <spanspec spanname="spa9-10" namest="col9" nameend="col10"/> | |
| 681 <spanspec spanname="spa11-12" namest="col11" nameend="col12"/> | |
| 682 <spanspec spanname="spa13-14" namest="col13" nameend="col14"/> | |
| 683 <spanspec spanname="spa15-16" namest="col15" nameend="col16"/> | |
| 684 <tbody> | |
| 685 <row> | |
| 686 <entry namest="col1" nameend="col8">Campo superiore</entry> | |
| 687 <entry namest="col9" nameend="col16">Campo inferiore</entry> | |
| 688 </row> | |
| 689 <row> | |
| 690 <entry>L</entry> | |
| 691 <entry>L</entry> | |
| 692 <entry>L</entry> | |
| 693 <entry>L</entry> | |
| 694 <entry>L</entry> | |
| 695 <entry>L</entry> | |
| 696 <entry>L</entry> | |
| 697 <entry>L</entry> | |
| 698 <entry></entry> | |
| 699 <entry></entry> | |
| 700 <entry></entry> | |
| 701 <entry></entry> | |
| 702 <entry></entry> | |
| 703 <entry></entry> | |
| 704 <entry></entry> | |
| 705 <entry></entry> | |
| 706 </row> | |
| 707 <row> | |
| 708 <entry spanname="spa1-2">C</entry> | |
| 709 <entry spanname="spa3-4">C</entry> | |
| 710 <entry spanname="spa5-6">C</entry> | |
| 711 <entry spanname="spa7-8">C</entry> | |
| 712 <entry></entry> | |
| 713 <entry></entry> | |
| 714 <entry></entry> | |
| 715 <entry></entry> | |
| 716 <entry></entry> | |
| 717 <entry></entry> | |
| 718 <entry></entry> | |
| 719 <entry></entry> | |
| 720 </row> | |
| 721 <row> | |
| 722 <entry></entry> | |
| 723 <entry></entry> | |
| 724 <entry></entry> | |
| 725 <entry></entry> | |
| 726 <entry></entry> | |
| 727 <entry></entry> | |
| 728 <entry></entry> | |
| 729 <entry></entry> | |
| 730 <entry>L</entry> | |
| 731 <entry>L</entry> | |
| 732 <entry>L</entry> | |
| 733 <entry>L</entry> | |
| 734 <entry>L</entry> | |
| 735 <entry>L</entry> | |
| 736 <entry>L</entry> | |
| 737 <entry>L</entry> | |
| 738 </row> | |
| 739 <row> | |
| 740 <entry>L</entry> | |
| 741 <entry>L</entry> | |
| 742 <entry>L</entry> | |
| 743 <entry>L</entry> | |
| 744 <entry>L</entry> | |
| 745 <entry>L</entry> | |
| 746 <entry>L</entry> | |
| 747 <entry>L</entry> | |
| 748 <entry></entry> | |
| 749 <entry></entry> | |
| 750 <entry></entry> | |
| 751 <entry></entry> | |
| 752 <entry></entry> | |
| 753 <entry></entry> | |
| 754 <entry></entry> | |
| 755 <entry></entry> | |
| 756 </row> | |
| 757 <row> | |
| 758 <entry></entry> | |
| 759 <entry></entry> | |
| 760 <entry></entry> | |
| 761 <entry></entry> | |
| 762 <entry></entry> | |
| 763 <entry></entry> | |
| 764 <entry></entry> | |
| 765 <entry></entry> | |
| 766 <entry spanname="spa9-10">C</entry> | |
| 767 <entry spanname="spa11-12">C</entry> | |
| 768 <entry spanname="spa13-14">C</entry> | |
| 769 <entry spanname="spa15-16">C</entry> | |
| 770 </row> | |
| 771 <row> | |
| 772 <entry></entry> | |
| 773 <entry></entry> | |
| 774 <entry></entry> | |
| 775 <entry></entry> | |
| 776 <entry></entry> | |
| 777 <entry></entry> | |
| 778 <entry></entry> | |
| 779 <entry></entry> | |
| 780 <entry>L</entry> | |
| 781 <entry>L</entry> | |
| 782 <entry>L</entry> | |
| 783 <entry>L</entry> | |
| 784 <entry>L</entry> | |
| 785 <entry>L</entry> | |
| 786 <entry>L</entry> | |
| 787 <entry>L</entry> | |
| 788 </row> | |
| 789 <row> | |
| 790 <entry>L</entry> | |
| 791 <entry>L</entry> | |
| 792 <entry>L</entry> | |
| 793 <entry>L</entry> | |
| 794 <entry>L</entry> | |
| 795 <entry>L</entry> | |
| 796 <entry>L</entry> | |
| 797 <entry>L</entry> | |
| 798 <entry></entry> | |
| 799 <entry></entry> | |
| 800 <entry></entry> | |
| 801 <entry></entry> | |
| 802 <entry></entry> | |
| 803 <entry></entry> | |
| 804 <entry></entry> | |
| 805 <entry></entry> | |
| 806 </row> | |
| 807 <row> | |
| 808 <entry spanname="spa1-2">C</entry> | |
| 809 <entry spanname="spa3-4">C</entry> | |
| 810 <entry spanname="spa5-6">C</entry> | |
| 811 <entry spanname="spa7-8">C</entry> | |
| 812 <entry></entry> | |
| 813 <entry></entry> | |
| 814 <entry></entry> | |
| 815 <entry></entry> | |
| 816 <entry></entry> | |
| 817 <entry></entry> | |
| 818 <entry></entry> | |
| 819 <entry></entry> | |
| 820 </row> | |
| 821 <row> | |
| 822 <entry></entry> | |
| 823 <entry></entry> | |
| 824 <entry></entry> | |
| 825 <entry></entry> | |
| 826 <entry></entry> | |
| 827 <entry></entry> | |
| 828 <entry></entry> | |
| 829 <entry></entry> | |
| 830 <entry>L</entry> | |
| 831 <entry>L</entry> | |
| 832 <entry>L</entry> | |
| 833 <entry>L</entry> | |
| 834 <entry>L</entry> | |
| 835 <entry>L</entry> | |
| 836 <entry>L</entry> | |
| 837 <entry>L</entry> | |
| 838 </row> | |
| 839 <row> | |
| 840 <entry>L</entry> | |
| 841 <entry>L</entry> | |
| 842 <entry>L</entry> | |
| 843 <entry>L</entry> | |
| 844 <entry>L</entry> | |
| 845 <entry>L</entry> | |
| 846 <entry>L</entry> | |
| 847 <entry>L</entry> | |
| 848 <entry></entry> | |
| 849 <entry></entry> | |
| 850 <entry></entry> | |
| 851 <entry></entry> | |
| 852 <entry></entry> | |
| 853 <entry></entry> | |
| 854 <entry></entry> | |
| 855 <entry></entry> | |
| 856 </row> | |
| 857 <row> | |
| 858 <entry></entry> | |
| 859 <entry></entry> | |
| 860 <entry></entry> | |
| 861 <entry></entry> | |
| 862 <entry></entry> | |
| 863 <entry></entry> | |
| 864 <entry></entry> | |
| 865 <entry></entry> | |
| 866 <entry spanname="spa9-10">C</entry> | |
| 867 <entry spanname="spa11-12">C</entry> | |
| 868 <entry spanname="spa13-14">C</entry> | |
| 869 <entry spanname="spa15-16">C</entry> | |
| 870 </row> | |
| 871 <row> | |
| 872 <entry></entry> | |
| 873 <entry></entry> | |
| 874 <entry></entry> | |
| 875 <entry></entry> | |
| 876 <entry></entry> | |
| 877 <entry></entry> | |
| 878 <entry></entry> | |
| 879 <entry></entry> | |
| 880 <entry>L</entry> | |
| 881 <entry>L</entry> | |
| 882 <entry>L</entry> | |
| 883 <entry>L</entry> | |
| 884 <entry>L</entry> | |
| 885 <entry>L</entry> | |
| 886 <entry>L</entry> | |
| 887 <entry>L</entry> | |
| 888 </row> | |
| 889 </tbody> | |
| 890 </tgroup> | |
| 891 </informaltable> | |
| 892 | |
| 893 <para> | |
| 894 Come puoi notare, il motivo non si ripete fino a dopo 4 linee. | |
| 895 Quindi per il video interlacciato, il tuo spostamento sull'asse y e l'altezza | |
| 896 devono essere multipli di 4. | |
| 897 </para> | |
| 898 | |
| 899 <para> | |
| 900 La risoluzione nativa DVD è 720x480 per NTSC e 720x576 per PAL, ma c'è un | |
| 901 flag per l'aspetto che indica se è full-screen (4:3) o wide-screen (16:9). | |
| 902 Molti (se non quasi tutti) i DVD in widescreen non sono esattamente 16:9 e | |
| 903 possono essere sia 1.85:1 o 2.35:1 (cinescope). Questo significa che nel video | |
| 904 ci saranno bordi neri che bisogna tagliare via. | |
| 905 </para> | |
| 906 | |
| 907 <para> | |
| 908 <application>MPlayer</application> fornisce un filtro che rileva i valori di | |
| 909 taglio e fornisce il rettangolo per crop (<option>-vf cropdetect</option>). | |
| 910 Esegui <application>MPlayer</application> con <option>-vf cropdetect</option> ed | |
| 911 emetterà le impostazioni di taglio per crop al fine di rimuovere i bordi. | |
| 912 Dovresti lasciare andare avanti il film abbastanza da ottenere valori di taglio | |
| 913 precisi. | |
| 914 </para> | |
| 915 | |
| 916 <para> | |
| 917 Dopodiché prova con <application>MPlayer</application> i valori ottenuti usando | |
| 918 la linea comando emessa da <option>cropdetect</option>, e correggi il | |
| 919 rettangolo se e come serve. | |
| 920 Il filtro <option>rectangle</option> può esserti di aiuto, dato che ti | |
| 921 permette di impostare interattivamente la posizione del rettangolo di taglio | |
| 922 sopra al filmato. | |
| 923 Ricordati di seguire le linee guida sui multipli in modo da non disallineare | |
| 924 i piani di crominanza. | |
| 925 </para> | |
| 926 | |
| 927 <para> | |
| 928 In talune occasioni, il ridimensionamento può essere indesiderabile. | |
| 929 Il ridimensionamento sulla direzione verticale è difficoltoso con video | |
| 930 interlacciato e se vuoi mantenere l'interlacciamento, dovresti evitare il | |
| 931 ridimensionamento. | |
| 932 Se non ridimensionerai, ma vuoi comunque usare dimensioni multiple di 16, | |
| 933 dovrai tagliare di più. | |
| 934 Evita di tagliare di meno, dato che i bordi neri sono un male per la codifica! | |
| 935 </para> | |
| 936 | |
| 937 <para> | |
| 938 Dato che MPEG-4 usa macroblocchi 16x16 vorrai esser sicuro che ambedue le | |
| 939 dimensioni del video che stai per codificare siano multiple di 16, altrimenti | |
| 940 perderai in qualità, soprattutto a bitrate più bassi. Puoi farlo abbassando | |
| 941 la larghezza e l'altezza del rettangolo di taglio al multiplo di 16 più vicino. | |
| 942 Come detto precedentemente, quando tagli, vorrai aumentare lo scostamento Y | |
| 943 della metà della differenza tra la nuova e la vecchia altezza, in modo che il | |
| 944 video risultante sia preso dal centro del fotogramma. Inoltre, a causa del modo | |
| 945 in cui il video DVD viene campionato, assicurati che lo scostamento sia un | |
| 946 numero pari. (Infatti, come regola, non utilizzare mai valori dispari per alcun | |
| 947 parametro quando tagli e ridimensioni un video.) Se non ti va di scartare dei | |
| 948 pixel in più, potresti piuttosto preferire il ridimensionamento del video. | |
| 949 Prenderemo in esame questa situazione più avanti. | |
| 950 Puoi in verità lasciare che tutte le considerazioni suddette vengano fatte | |
| 951 dal filtro <option>cropdetect</option>, visto che ha un parametro | |
| 952 <option>round</option> facoltativo, che è impostato a 16 di default. | |
| 953 </para> | |
| 954 | |
| 955 <para> | |
| 956 Fai anche attenzione ai pixel "mezzi neri" sui bordi. Assicurati di tagliare | |
| 957 anch'essi, altrimenti sprecherai bit più utili altrove. | |
| 958 </para> | |
| 959 | |
| 960 <para> | |
| 961 Dopo aver detto e fatto tutto ciò, probabilmente avrei un vide i cui pixel | |
| 962 non saranno proprio 1.85:1 o 2.35:1, ma piuttosto un valore vicino. Potresti | |
| 963 calcolare a mano il nuovo rapporto di aspetto, ma | |
| 964 <application>MEncoder</application> ha un'opzione per <systemitem | |
| 965 class="library">libavcodec</systemitem> chiamata <option>autoaspect</option> | |
| 966 che lo farà per te. Non aumentare assolutamente le dimensioni del video per | |
| 967 avere i pixel quadrati, a meno che tu non voglia sprecare il tuo spazio disco. | |
| 968 Il ridimensionamento dovrebbe essere eseguito in riproduzione, e per definire | |
| 969 la risoluzione giusta il riproduttore userà l'aspetto memorizzato nell'AVI. | |
| 970 Sfortunatamente non tutti i riproduttori verificano l'informazione sul rapporto | |
| 971 perciò potresti voler comunque effettuare il ridimensionamento. | |
| 972 </para> | |
| 973 </sect2> | |
| 974 | |
| 975 <!-- ********** --> | |
| 976 | |
| 977 <sect2 id="menc-feat-dvd-mpeg4-resolution-bitrate"> | |
| 978 <title>Scegliere la risoluzione e il bitrate</title> | |
| 979 | |
| 980 <para> | |
| 981 A meno che tu non stia per codificare con quantizzazione costante devi | |
| 982 impostare un bitrate. | |
| 983 La logica del bitrate è abbastanza semplice. | |
| 984 Normalmente il bitrate viene misurato in kilobit (1000 bit) al secondo. | |
| 985 La dimensione del filmato sul disco è il bitrate moltiplicato per la durata | |
| 986 del filmato, più un piccolo quantitativo in "surplus" (vedi per esempio la | |
| 987 sezione sul | |
| 988 <link linkend="menc-feat-dvd-mpeg4-muxing-avi-limitations">contenitore AVI</link>). | |
| 989 Altri parametri come ridimensionamento, taglio, etc... | |
| 990 <emphasis role="bold">non</emphasis> influiscono sulla dimensione del file a | |
| 991 meno che tu non cambi anche il bitrate! | |
| 992 </para> | |
| 993 | |
| 994 <para> | |
| 995 Il bitrate <emphasis role="bold">non</emphasis> è direttamente proporzionale | |
| 996 alla risoluzione. | |
| 997 Tanto per capirci, un file 320x240 a 200 kbit/sec non avrà la stessa qualità | |
| 998 dello stesso filmato a 640x480 e 800 kbit/sec! | |
| 999 Ci sono due ragioni per ciò: | |
| 1000 <orderedlist> | |
| 1001 <listitem><para> | |
| 1002 <emphasis role="bold">Percettiva</emphasis>: noti di più gli artefatti MPEG | |
| 1003 quando sono più grandi! | |
| 1004 Gli artefatti appaiono a livello dei blocchi (8x8). | |
| 1005 Il tuo occhio non noterà errori in 4800 piccoli blocchi tanti quanti ne | |
| 1006 vedrà in 1200 grossi blocchi (assumendo che tu li stia ridimensionando tutti | |
| 1007 e due a schermo intero). | |
| 1008 </para></listitem> | |
| 1009 <listitem><para> | |
| 1010 <emphasis role="bold">Teorica</emphasis> : quando rimpicciolisci un immagine | |
| 1011 ma usi la stessa dimensione dei blocchi (8x8) per la trasformazione spaziale | |
| 1012 della frequenza, hai più dati nelle bande ad alta frequenza. In parole | |
| 1013 povere, ogni pixel contiene più dettagli di quanti ne contenesse prima. | |
| 1014 Quindi anche se la tua immagine rimpicciolita contiene 1/4 delle informazioni | |
| 1015 sulle direzioni spaziali, potrebbe ancora contenere una gran parte delle | |
| 1016 informazioni nel dominio delal frequenza (assumendo che le alte frequenze | |
| 1017 siano sotto-utilizzate nell'immagine di origine a 640x480). | |
| 1018 </para></listitem> | |
| 1019 </orderedlist> | |
| 1020 </para> | |
| 1021 | |
| 1022 <para> | |
| 1023 Guide precendenti hanno consigliato di scegliere un bitrate e una risoluzione | |
| 1024 in base ad un approccio "bit al secondo", ma di solito ciò non è valido a | |
| 1025 causa delle ragioni suddette. | |
| 1026 Una stima migliore pare essere che il bitrate è proporzionale alla radice | |
| 1027 quadrata della risoluzione, per cui 320x240 e 400 kbit/sec sarà | |
| 1028 paragonabile a 640x480 a 800 kbit/sec. | |
| 1029 Tuttavia ciò non è stato verificato con certezza empirica o teorica. | |
| 1030 Inoltre, dato che i filmati hanno diversi livelli di disturbo, dettaglio, angoli | |
| 1031 di movimento, etc..., è vano dare consigli generici su bit per lunghezza della | |
| 1032 diagonale (analogamente a bit per pixel, usando la radice quadrata). | |
| 1033 </para> | |
| 1034 <para> | |
| 1035 Finora abbiamo parlato della difficoltà nel scegliere un bitrate e una | |
| 1036 risoluzione. | |
| 1037 </para> | |
| 1038 | |
| 1039 | |
| 1040 <sect3 id="menc-feat-dvd-mpeg4-resolution-bitrate-compute"> | |
| 1041 <title>Calcolare la risoluzione</title> | |
| 1042 | |
| 1043 <para> | |
| 1044 I passaggi seguenti ti guideranno nel calcolo della risoluzione per la tua | |
| 1045 codifica senza distorcere troppo il video, tenendo in considerazione vari tipo | |
| 1046 di informazioni riguardo la sorgente video. | |
| 1047 Per prima cosa dovresti calcolare il rapporto di aspetto codificato: | |
| 1048 <systemitem>ARc = (Wc x (ARa / PRdvd )) / Hc</systemitem> | |
| 1049 | |
| 1050 <itemizedlist> | |
| 1051 <title>dove:</title> | |
| 1052 <listitem><para> | |
| 1053 Wc e Hc sono la larghezza e l'altezza del video tagliato, | |
| 1054 </para></listitem> | |
| 1055 <listitem><para> | |
| 1056 ARa è il rapporto di aspetto mostrato, che di solito è 4/3 o 16/9, | |
| 1057 </para></listitem> | |
| 1058 <listitem><para> | |
| 1059 PRdvd à il rapporto del pixel del DVD che è uguale a 1.25=(720/576) per DVD | |
| 1060 PAL e 1.5=(720/480) per DVD NTSC. | |
| 1061 </para></listitem> | |
| 1062 </itemizedlist> | |
| 1063 </para> | |
| 1064 | |
| 1065 <para> | |
| 1066 Dopo puoi calcolare la risoluzione X e Y, basandoti su un dato fattore | |
| 1067 di qualità di compressione (Compression Quality, CQ): | |
| 1068 <systemitem>ResY = INT(SQRT( 1000*Bitrate/25/ARc/CQ )/16) * 16</systemitem> | |
| 1069 and | |
| 1070 <systemitem>ResX = INT( ResY * ARc / 16) * 16</systemitem> | |
| 1071 </para> | |
| 1072 | |
| 1073 <para> | |
| 1074 Okay, ma cos'è la CQ? | |
| 1075 Il CQ rappresenta il numero di bit per pixel e per fotogramma in codifica. | |
| 1076 Parlando più semplicemente, più alto è la CQ, più difficilmente si vedranno | |
| 1077 codificati degli artefatti. | |
| 25449 | 1078 Tuttavia, se desideri una particolare dimensione per il tuo film (per esempio |
| 1079 1 o 2 CD), hai un numero limitato di bit da utilizzare; devi quindi trovare un | |
| 1080 buon compromesso tra compressione e qualità. | |
| 25279 | 1081 </para> |
| 1082 | |
| 1083 <para> | |
| 1084 La CQ dipende dal bitrate, dall'efficienza del codec video e dalla risoluzione | |
| 1085 del filmato. | |
| 1086 Per alzare la CQ, di solito dovrai rimpicciolire il filmato visto che il bitrate | |
| 1087 viene calcolato in funzione della dimensione voluta e della lunghezza del | |
| 1088 filmato, che sono delle costanti. | |
| 1089 Con codec MPEG-4 ASP come <systemitem class="library">Xvid</systemitem> e | |
| 1090 <systemitem class="library">libavcodec</systemitem>, una CQ inferiore a 0.18 | |
| 1091 solitamente genera un'immagine abbastanza squadrettata, perché non ci sono | |
| 1092 abbastanza bit per codificare l'informazione di ogni macroblocco. (MPEG4, come | |
| 1093 molti altri codec, ragruppa i pixel in blocchi di pixel per comprimere | |
| 1094 l'immagine; se non ci sono abbastanza bit, si vedono i bordi dei blocchi.) | |
| 1095 E' saggio anche prendere una CQ compresa tra 0.20 e 0.22 per un rip a 1 CD, | |
| 1096 e 0.26-0.28 per un rip a 2 CD con impostazioni standard di codifica. | |
| 1097 Opzioni più evolute di codifica come quelle qui indicate per | |
| 1098 <link linkend="menc-feat-mpeg4-lavc-example-settings"><systemitem class="library">libavcodec</systemitem></link> | |
| 1099 e | |
| 1100 <link linkend="menc-feat-xvid-example-settings"><systemitem class="library">Xvid</systemitem></link> | |
| 1101 dovrebbero permetterti di ottenere la stessa qualità con CQ compresa tra | |
| 1102 0.18 e 0.20 per un rip da 1 CD, e da 0.24 a 0.26 per 2 CD. | |
| 1103 Con codec MPEG-4 AVC come <systemitem class="library">x264</systemitem>, | |
| 1104 puoi usare una CQ che varia da 0.14 a 0.16 con opzioni standard di codifica, e | |
| 1105 dovresti riuscire a scendere tra 0.10 e 0.12 con <link linkend="menc-feat-x264-example-settings">impostazioni avanzate di codifica | |
| 1106 <systemitem class="library">x264</systemitem></link>. | |
| 1107 </para> | |
| 1108 | |
| 1109 <para> | |
| 1110 Prendi per favore nota che CQ è solo un valore indicativo, dato che dipende dal | |
| 1111 contenuto che viene codificato, una CQ di 0.18 può andar bene per un Bergman, | |
| 1112 mentre per un film come Matrix, che contiene molte scene ad alta velocità, no. | |
| 1113 D'altro canto è inutile portare la CQ oltre 0.30 dato che sprecherai dei bit | |
| 1114 senza avere alcun guadagno visibile in qualità. | |
| 1115 Nota anche che come detto precedentemente in questa guida, per video a bassa | |
| 1116 risoluzione serve una CQ più alta (in rapporto, per esempio, alla risoluzione | |
| 1117 DVD) perché si vedano bene. | |
| 1118 </para> | |
| 1119 </sect3> | |
| 1120 </sect2> | |
| 1121 | |
| 1122 <!-- ********** --> | |
| 1123 | |
| 1124 <sect2 id="menc-feat-dvd-mpeg4-filtering"> | |
| 1125 <title>Filtraggio</title> | |
| 1126 | |
| 1127 <para> | |
| 1128 Imparare come usare i filtri video di <application>MEncoder</application> è | |
| 1129 essenziale per produrre delle buone codfiche. | |
| 1130 Tutta l'elaborazione video è eseguita attraverso i filtri -- taglio, | |
| 1131 ridimensionamento, aggiustamento del colore, rimozione del disturbo, rilevamento | |
| 1132 margini, deinterlacciatura, telecine, telecine inverso, e deblocco, solo per | |
| 1133 nominarne qualcuno. | |
| 1134 Insieme con la vasta gamma di formati di entrata gestiti, la varietà dei | |
| 1135 filtri disponibili in <application>MEncoder</application> è uno dei suoi | |
| 1136 più grandi vantaggi sugli altri programmi similari. | |
| 1137 </para> | |
| 1138 | |
| 1139 <para> | |
| 1140 I filtri vengono caricati in catena usando l'opzione -vf: | |
| 1141 | |
| 1142 <screen>-vf filtro1=opzioni,filtro2=opzioni,...</screen> | |
| 1143 | |
| 1144 La maggior parte dei filtri riceve alcune opzioni numeriche separate da due | |
| 1145 punti, ma la sintassi per le opzioni cambia da filtro a filtro, indi leggiti la | |
| 1146 pagina man per i dettagli sul filtro che desideri usare. | |
| 1147 </para> | |
| 1148 | |
| 1149 <para> | |
| 1150 I filtri lavorano sul video nell'ordine in cui vengono caricati. | |
| 1151 Per esempio la catena seguente: | |
| 1152 | |
| 1153 <screen>-vf crop=688:464:12:4,scale=640:464</screen> | |
| 1154 | |
| 1155 dapprima taglia la zona 688x464 dell'immagine con uno scostamento dall'alto a | |
| 1156 sinistra di (12,4), e poi ridimensiona il risultato a 640x464. | |
| 1157 </para> | |
| 1158 | |
| 1159 <para> | |
| 1160 Taluni filtri devono essere caricati all'inizio o vicino all'inizio della | |
| 1161 catena di filtri, in modo da trarre vantaggio dalle informazioni che arrivano | |
| 1162 dal decoder video, che potrebbero essere perse o invalidate da altri filtri. | |
| 1163 Gli esempi principali sono <option>pp</option> (post elaborazione | |
| 1164 (postprocessing), solo quando esegue operazioni di deblock o dering), | |
| 1165 <option>spp</option> (un altra post elaborazione per eliminare artefatti MPEG), | |
| 1166 <option>pullup</option> (telecine inverso), e <option>softpulldown</option> | |
| 1167 (per passare da telecine soft a hard). | |
| 1168 </para> | |
| 1169 | |
| 1170 <para> | |
| 1171 In generale vorrai filtrare il meno possibile in modo da rimaner fedele alla | |
| 1172 sorgente DVD originale. Il taglio è spesso necessario (com detto sopra), ma | |
| 1173 evita di ridimensionare il video. Anche se alcune volte si preferisce | |
| 1174 rimpicciolire per poter usare quantizzatori più alti, vogliamo evitare ciò: | |
| 1175 ricorda che abbiamo sin dall'inizio deciso di investire bit in qualità. | |
| 1176 </para> | |
| 1177 | |
| 1178 <para> | |
| 1179 In più, non reimpostare la gamma, il contrasto, la luminosità, etc... | |
| 1180 Quello che si vede bene sul tuo schermo potrebbe non vedersi bene su altro. | |
| 1181 Queste modifiche dovrebbero esser fatte solo durante la riproduzione. | |
| 1182 </para> | |
| 1183 | |
| 1184 <para> | |
| 1185 Una cosa che voresti però fare è tuttavia far passare il video attraverso un | |
| 1186 leggero filtro di rimozione disturbo, come <option>-vf hqdn3d=2:1:2</option>. | |
| 1187 Ancora, è una questione di poter meglio utilizzare quei bit: perché sprecarli | |
| 1188 codificando disturbo mentre puoi semplicemente aggiungerlo di nuovo durante la | |
| 1189 riproduzione? Alzando i parametri per <option>hqdn3d</option> aumenterà | |
| 1190 ancora la compressione, ma se aumenti troppo i valori, rischi un degrado pesante | |
| 1191 dell'immagine. I valori sopra consigliati (<option>2:1:2</option>) sono | |
| 1192 abbastanza conservativi; sentiti libero di sperimentare con valori più alti e | |
| 1193 verificare da solo il risultato. | |
| 1194 </para> | |
| 1195 </sect2> | |
| 1196 | |
| 1197 <!-- ********** --> | |
| 1198 | |
| 1199 <sect2 id="menc-feat-dvd-mpeg4-interlacing"> | |
| 1200 <title>Interlacciamento e Telecine</title> | |
| 1201 | |
| 1202 <para> | |
| 1203 Quasi tutti i film vengono ripresi a 24 fps. Dato che NTSC è 30000/1001 fps, | |
| 1204 si devono eseguire alcune elaborazioni affinché questo video a 24 fps sia | |
| 1205 letto al giusto framerate NTSC. Il processo è chiamato "3:2 pulldown", meglio | |
| 1206 conosciuto come "telecine" (poiché pulldown viene spesso applicato durante il | |
| 1207 processo di telecine), e descritto rozzamente, agisce rallentando il film a | |
| 1208 24000/1001 fps, e ripetendo ogni quarto fotogramma. | |
| 1209 </para> | |
| 1210 | |
| 1211 <para> | |
| 1212 Non viene invece eseguita alcuna elaborazione sul video per i DVD PAL, che | |
| 1213 girano a 25 fps. (Tecnicamente, PAL può subire il telecine, chiamato | |
| 1214 "2:2 pulldown", ma non è usanza abituale.) Il film a 24 fps viene | |
| 1215 semplicemente riprodotto a 25 fps. Il risultato è che il filmato è leggermente | |
| 1216 più veloce, ma a meno che tu non sia un alieno, probabilmente non noterai la | |
| 1217 differenza. | |
| 1218 La maggior parte dei DVD PAL hanno audio corretto ai picchi, in modo che quando | |
| 1219 siano riprodotti a 25 fps le cose suonino giuste, anche se la traccia audio | |
| 1220 (e quindi tutto il filmato) ha un tempo di riproduzione che è il 4% inferiore | |
| 1221 ai DVD NTSC. | |
| 1222 </para> | |
| 1223 | |
| 1224 <para> | |
| 1225 A causa del fatto che il video nei DVD PAL non è stato alterato, non dovrai | |
| 1226 preoccuperti molto della frequenza fotogrammi. La sorgente è 25 fps, e il tuo | |
| 1227 rip sarà a 25 fps. Tuttavia, se stai codificando un film da DVD NTSC, | |
| 1228 potresti dover applicare il telecine inverso. | |
| 1229 </para> | |
| 1230 | |
| 1231 <para> | |
| 1232 Per film ripresi a 24 fps, il video sul DVD NTSC è o con telecine a 30000/1001, | |
| 1233 oppure è progressivo a 24000/1001 fps e destinato a subire il telecine al volo | |
| 1234 da un lettore DVD. D'altro canto le serie TV sono solitamente solo | |
| 1235 interlacciate, senza telecine. Questa non è una regola ferrea: alcune serie TV | |
| 1236 sono interlacciate (come Buffy the Vampire Slayer) mentre alcune sono un misto | |
| 1237 di progressivo e interlacciato (come Angel, o 24). | |
| 1238 </para> | |
| 1239 | |
| 1240 <para> | |
| 1241 Si consiglia vivamente di leggere la sezione su | |
| 1242 <link linkend="menc-feat-telecine">Come trattare il telecine e l'interlacciamento nei DVD NTSC</link> | |
| 1243 per imparare come gestire le varie possibilità. | |
| 1244 </para> | |
| 1245 | |
| 1246 <para> | |
| 1247 Ciononostante, se stai principalmente rippando solo film, solitamente ti | |
| 1248 troverai di fronte a video a 24 fps progressivo o con telecine, nel qual caso | |
| 1249 puoi usare il filtro <option>pullup</option> <option>-vf | |
| 1250 pullup,softskip</option>. | |
| 1251 </para> | |
| 1252 </sect2> | |
| 1253 | |
| 1254 <!-- ********** --> | |
| 1255 | |
| 1256 <sect2 id="menc-feat-dvd-mpeg4-encoding-interlaced"> | |
| 1257 <title>Codificare video interlacciato</title> | |
| 1258 | |
| 1259 <para> | |
| 1260 Se il film che vuoi codificare è interlacciato (video NTSC o PAL) dovrai | |
| 1261 scegliere se vuoi de-interlacciare o no. | |
| 1262 Se da un lato de-interlacciare renderà il tuo filmato utilizzabile su | |
| 1263 schermi a scansione progressiva come monitor di computer o proiettori, porta | |
| 1264 con sé un costo: la frequenza dei campi di 50 o 60000/1001 campi al secondo | |
| 1265 viene dimezzata a 25 o 30000/1001 fotogrammi al secondo, e circa la metà delle | |
| 1266 informazioni nel tuo film saranno perdute, in scene con movimento significativo. | |
| 1267 </para> | |
| 1268 | |
| 1269 <para> | |
| 1270 Per di più, se stai codificando puntando ad alta qualità di archiviazione. | |
| 1271 si consiglia di non de-interlacciare. | |
| 1272 Puoi sempre de-interlacciare il film durante la riproduzione attraverso | |
| 1273 dispositivi a scansione progressiva. | |
| 1274 La potenza dei computer attuali forza per i riproduttori l'utilizzo di un filtro | |
| 1275 di de-interlacciamento, che porta un leggero degrado dell'immagine. | |
| 1276 Ma i lettori del futuro saranno in grado di simulare lo schermo di una TV, | |
| 1277 de-interlacciando a piena frequenza di campi e interpolando 50 o 60000/1001 | |
| 1278 fotogrammi interi al secondo dal video interlacciato | |
| 1279 </para> | |
| 1280 | |
| 1281 <para> | |
| 1282 Bisogna porre speciale attenzione quando si lavora con video interlacciato: | |
| 1283 </para> | |
| 1284 | |
| 1285 <orderedlist> | |
| 1286 <listitem><para> | |
| 1287 Altezza e scostamento del taglio devono essere multipli di 4. | |
| 1288 </para></listitem> | |
| 1289 <listitem><para> | |
| 1290 Qualsiasi ridimensionamento verticale va fatto in modalità interlacciata. | |
| 1291 </para></listitem> | |
| 1292 <listitem><para> | |
| 1293 I filtri di post elaborazione e di rimozione disturbo potrebbero non | |
| 1294 funzionare come ci si aspetta a meno che tu non ponga particolare attenzione | |
| 1295 per farli lavorare su un campo per volta, e possono rovinare il video quando | |
| 1296 usati in modo non corretto. | |
| 1297 </para></listitem> | |
| 1298 </orderedlist> | |
| 1299 | |
| 1300 <para> | |
| 1301 Tenendo a mente queste cose, ecco il nostro primo esempio: | |
| 1302 <screen> | |
| 1303 mencoder <replaceable>capture.avi</replaceable> -mc 0 -oac lavc -ovc lavc -lavcopts \ | |
| 1304 vcodec=mpeg2video:vbitrate=6000:ilme:ildct:acodec=mp2:abitrate=224 | |
| 1305 </screen> | |
| 1306 Nota le opzioni <option>ilme</option> e <option>ildct</option>. | |
| 1307 </para> | |
| 1308 </sect2> | |
| 1309 | |
| 1310 <!-- ********** --> | |
| 1311 | |
| 1312 <sect2 id="menc-feat-dvd-mpeg4-av-sync"> | |
| 25449 | 1313 <title>Note sulla sincronizzazione Audio/Video</title> |
| 1314 | |
| 1315 <para> | |
| 1316 Gli algoritmi di sincronizzazione audio/video di | |
| 1317 <application>MEncoder</application> sono stati progettati con l'intento di | |
| 1318 recuperare file con sincronia danneggiata. | |
| 1319 In alcuni casi tuttavia, possono generare inutili duplicazioni o scarti di | |
| 1320 fotogrammi, e possibilmente leggera desincronia A/V quando vengono usati con | |
| 1321 sorgenti buone (i problemi di sincronizzazione A/V accadono solo se elabori o | |
| 1322 copi la traccia audio mentre transcodifichi il video, il che è decisamente | |
| 1323 consigliato). | |
| 1324 Perciò potresti dover passare ad una sincronizzazione di base con l'opzione | |
| 1325 <option>-mc 0</option>, o metterla nel tuo file di configurazione | |
| 1326 <systemitem>~/.mplayer/mencoder</systemitem>, sempre che tu stia lavorando con | |
| 1327 buone sorgenti (DVD, acquisizione TV, rip MPEG-4 ad alta qualità, etc) e non | |
| 1328 con file ASF/RM/MOV rovinati. | |
| 1329 </para> | |
| 1330 | |
| 1331 <para> | |
| 1332 Se vuoi proteggerti ulteriormente da strani salti e duplicazioni di fotogrammi, | |
| 1333 puoi usare sia <option>-mc 0</option> che <option>-noskip</option>. | |
| 1334 Questo disabiliterà <emphasis>tutte</emphasis> le sincronizzazioni A/V, e | |
| 1335 copierà i fotogrammi uno ad uno, perciò è inutilizzabile se stai usando dei | |
| 1336 filtri che aggiungono o rimuovono arbitrariamente fotogrammi, ovvero se il | |
| 1337 tuo file sorgente ha una frequenza fotogrammi non costante! | |
| 1338 Quindi l'utilizzo di <option>-noskip</option> in linea di massima si sconsiglia. | |
| 1339 </para> | |
| 1340 | |
| 1341 <para> | |
| 1342 Si sa che la cosiddetta codifica audio in "tre passi", che | |
| 1343 <application>MEncoder</application> gestisce, può causare desincronizzazione | |
| 1344 A/V. | |
| 1345 Il che capiterà prontamente se viene usata insieme con alcuni filtri, per cui | |
| 1346 si consiglia di <emphasis>non</emphasis> usare la modalità audio a tre passi. | |
| 1347 Questa caratteristica viene lasciata solo per finalità di compatibilità e | |
| 1348 per utenti esperti che sanno quando sia adeguato usarla e quando no. | |
| 1349 Se non hai mai sentito parlar prima della modalità a tre passi, dimenticati | |
| 1350 di averla anche solo sentita nominare! | |
| 1351 </para> | |
| 1352 | |
| 1353 <para> | |
| 1354 Ci sono anche stati rapporti di desincronia A/V codificando con | |
| 1355 <application>MEncoder</application> da stdin. | |
| 1356 Non farlo! Usa sempre come ingresso un file o un dispositivo CD/DVD/etc. | |
| 25279 | 1357 </para> |
| 1358 </sect2> | |
| 1359 | |
| 1360 <!-- ********** --> | |
| 1361 | |
| 1362 <sect2 id="menc-feat-dvd-mpeg4-codec"> | |
| 25449 | 1363 <title>Scegliere il codec video</title> |
| 1364 | |
| 1365 <para> | |
| 1366 Quale possa esere il miglior codec video dipende da molti fattori, come | |
| 1367 dimensione, qualità, possibilita di farne lo streaming, usabilit, diffusione, | |
| 1368 alcuni dei quali dipendono fortemente dai gusti personali e dalle variabili | |
| 1369 tecniche in gioco. | |
| 25279 | 1370 </para> |
| 1371 <itemizedlist> | |
| 1372 <listitem> | |
| 1373 <para> | |
| 25449 | 1374 E' abbastanza facile da capire che i codec più recenti sono fatti per |
| 1375 aumentare qualità e compressione. | |
| 1376 Quindi gli autori di questa guida e moltra altra gente suggeriscono che non | |
| 1377 potete sbagliare | |
| 25279 | 1378 <footnote id='fn-menc-feat-dvd-mpeg4-codec-cpu'><para> |
| 25449 | 1379 Fai comunque attenzione: la decodifica di video MPEG-4 AVC a risoluzione DVD |
| 1380 richiede una macchina veloce (per es. un Pentium 4 oltre 1.5GHz o un Pentium | |
| 1381 M superiore a 1GHz). | |
| 25279 | 1382 </para></footnote> |
| 25449 | 1383 quando scegliete un qualche codec MPEG-4 AVC come |
| 1384 <systemitem class="library">x264</systemitem> piuttosto che un codec MPEG-4 | |
| 1385 ASP come l'MPEG-4 di <systemitem class="library">libavcodec</systemitem> o | |
| 25279 | 1386 <systemitem class="library">Xvid</systemitem>. |
| 25449 | 1387 (Per sviluppatori avenzati di codec potrebbe essere interessante leggere |
| 1388 l'opinione di Michael Niedermayer sul | |
| 1389 "<ulink url="http://guru.multimedia.cx/?p=10">perché MPEG-4 ASP faccia schifo</ulink>" | |
| 1390 (in inglese).) | |
| 1391 Analogamente dovresti ottenere una miglior qualità usando MPEG-4 ASP rispetto | |
| 1392 a quella ottenuta con codec MPEG-2. | |
| 25279 | 1393 </para> |
| 1394 | |
| 1395 <para> | |
| 25449 | 1396 Tuttavia, i codec più recenti che sono sotto pesante sviluppo possono avere |
| 1397 problemi che non sono ancora stati scoperti, e che possono rovinare una | |
| 1398 codifica. | |
| 1399 Questo è semplicemente il contrappasso per usare la tecnologia di punta. | |
| 25279 | 1400 </para> |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
1401 |
| 25279 | 1402 <para> |
| 25449 | 1403 Inoltre iniziare ad utilizzare un codec nuovo richiede l'utilizzo di un po' |
| 1404 di tempo per familiarizzare con le sue opzioni, affinché tu sappia cosa | |
| 1405 impostare per ottenere la qualità dell'immagine voluta. | |
| 25279 | 1406 </para> |
| 1407 </listitem> | |
| 1408 | |
| 1409 <listitem><para> | |
| 25449 | 1410 <emphasis role="bold">Compatibilità Hardware</emphasis>: |
| 1411 Solitamente ci va un po' di tempo prima che i lettori da tavolo incomincino ad | |
| 1412 includere il supporto per il video codec più recente. | |
| 1413 Il risultato è che la maggior parte legge MPEG-1 (come i VCD, XVCD e KVCD), | |
| 1414 MPEG-2 (come DVD, SVCD e KVCD) e MPEG-4 ASP (come DivX, | |
| 1415 LMP4 di <systemitem class="library">libavcodec</systemitem> e | |
| 25279 | 1416 <systemitem class="library">Xvid</systemitem>) |
| 25449 | 1417 (attenzione: solitamente non sono gestite tutte le caratteristiche |
| 1418 MPEG-4 ASP). | |
| 1419 Fai per favore riferimento alle specifiche tecniche del tuo lettore (ove | |
| 1420 disponibili) o cerca su internet per ulteriori informazioni. | |
| 25279 | 1421 </para></listitem> |
| 1422 | |
| 1423 <listitem> | |
| 1424 <para> | |
| 25449 | 1425 <emphasis role="bold">Miglior qualità per tempo di codifica</emphasis>: |
| 1426 Codec che sono in giro da parecchio tempo (come MPEG-4 di | |
| 1427 <systemitem class="library">libavcodec</systemitem> e | |
| 1428 <systemitem class="library">Xvid</systemitem>) sono spesso molto ottimizzati | |
| 1429 con ogni tipo di algoritmo furbo e codice SIMD in assembly. | |
| 1430 Per questo tendono a fornire il miglior rapporto tra qualità e tempo di | |
| 1431 codifica. Tuttavia, possono avere delle opzioni avanzate che, quando | |
| 1432 abilitate, rendono la codifica molto lenta fornendo poco guadagno. | |
| 25279 | 1433 </para> |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
1434 |
| 25279 | 1435 <para> |
| 25449 | 1436 Se stai cercando di incrementare la velocità dovresti cercare di non |
| 1437 modificare troppo le impostazioni di default del codec video (anche se | |
| 1438 dovresti comunque provare le altre opzioni che sono citate in altre sezioni | |
| 1439 di questa guida). | |
| 25279 | 1440 </para> |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
1441 |
| 25279 | 1442 <para> |
| 25449 | 1443 Puoi tenere in considerazione anche la scelta di un codec che possa eseguire |
| 1444 elaborazioni multi-thread, anche se ciò è utile solo per utenti di macchine | |
| 1445 con più di una CPU. | |
| 1446 MPEG-4 di <systemitem class="library">libavcodec</systemitem> lo permette, | |
| 1447 ma il guadagno in velocità è limitato, e c'è un leggere effetto negativo | |
| 1448 sulla qualità dell'immagine. | |
| 1449 La codifica multi-thread di <systemitem class="library">Xvid</systemitem>, | |
| 1450 attivata dall'opzione <option>threads</option>, può essere usata per | |
| 1451 accelerare la velocità di codifica — tipicamente di circa il 40-60% | |
| 1452 — con poco se non nessun degrado dell'immagine. | |
| 1453 Anche <systemitem class="library">x264</systemitem> permette la codifica in | |
| 1454 multi-thread, la quale attualmente velocizza la codifica del 94% per core di | |
| 1455 CPU mentre abbassa il PSNR tra 0.005dB e 0.01dB, con impostazioni tipiche. | |
| 25279 | 1456 </para> |
| 1457 </listitem> | |
| 1458 | |
| 1459 <listitem> | |
| 1460 <para> | |
| 25449 | 1461 <emphasis role="bold">Gusto personale</emphasis>: |
| 1462 Qui è dove capita l'irrazionale: per la stessa ragione per cui alcuni | |
| 1463 restano attaccati a DivX 3 per anni, mentre nuovi codec stanno | |
| 1464 facendo meraviglie, alcuni personaggi preferiranno | |
| 1465 <systemitem class="library">Xvid</systemitem> o MPEG-4 di | |
| 1466 <systemitem class="library">libavcodec</systemitem> a | |
| 25279 | 1467 <systemitem class="library">x264</systemitem>. |
| 1468 </para> | |
| 1469 <para> | |
| 25449 | 1470 Dovresti prendere le tue decisioni; non prendere consigli da gente che |
| 1471 fanno giuramenti su un codec. | |
| 1472 Prendi alcuni pezzi di esempio da sorgenti grezze e compara le diverse | |
| 1473 opzioni di codifica e di codec per trovare quello che ti garba di più. | |
| 1474 Il miglior codec è quello che riesci a gestire al meglio, e quello che ai | |
| 1475 tuoi occhi e sul tuo schermo si vede meglio. | |
| 25279 | 1476 <footnote id='fn-menc-feat-dvd-mpeg4-codec-playback'><para> |
| 25449 | 1477 La stessa codifica potrebbe non apparire uguale sullo schermo di qualcun |
| 1478 altro o se riprodotta con un decodificatore differente, perciò controlla | |
| 1479 i tuoi risultati riproducendoli in diverse condizioni. | |
| 25279 | 1480 </para></footnote>! |
| 1481 </para> | |
| 1482 </listitem> | |
| 1483 </itemizedlist> | |
| 1484 | |
| 1485 <para> | |
| 25449 | 1486 Fai per favore riferimento alla sezione |
| 1487 <link linkend="menc-feat-selecting-codec">selezionare codec e formati contenitore</link> | |
| 1488 per avere un elenco dei codec usabili. | |
| 25279 | 1489 </para> |
| 1490 </sect2> | |
| 1491 | |
| 1492 <!-- ********** --> | |
| 1493 | |
| 1494 <sect2 id="menc-feat-dvd-mpeg4-audio"> | |
| 1495 <title>Audio</title> | |
| 1496 | |
| 1497 <para> | |
| 25449 | 1498 L'audio è un problema di decisamente più facile soluzione: se ti interessa la |
| 1499 qualità, lascialo semplicemente com'è. | |
| 1500 Anche i flussi AC-3 5.1 sono al massimo a 448Kbit/s, e ne valgono ogni bit. | |
| 1501 Potresti esser tentato di trascodificare l'audio in Vorbis ad alta qualità, ma | |
| 1502 solo perché a tutt'oggi non hai un decodificatore AC-3 pass-through ciò non | |
| 1503 significa che non ne avrai uno in futuro. Assicura un futuro ai tuoi rip da DVD | |
| 1504 preservando il flusso in AC-3. | |
| 1505 Puoi mantenere il flusso AC-3 anche copiandolo direttamente nel flusso video | |
| 1506 <link linkend="menc-feat-mpeg4">durante la codifica</link>. | |
| 1507 Puoi anche estrarre il flusso AC-3 al fine di farne il mux in contenitori come | |
| 1508 NUT o Matroska. | |
| 25279 | 1509 <screen> |
| 25449 | 1510 mplayer <replaceable>file_sorgente.vob</replaceable> -aid 129 -dumpaudio -dumpfile <replaceable>suono.ac3</replaceable> |
| 25279 | 1511 </screen> |
| 25449 | 1512 effettuerà il dump della traccia audio numero 129 dal file |
| 1513 <replaceable>file_sorgente.vob</replaceable> nel file | |
| 1514 <replaceable>suono.ac3</replaceable> (NB: i file VOB da DVD spesso usano una | |
| 1515 numerazione dell'audio diversa, il che significa che la traccia audio 129 è la | |
| 1516 seconda traccia del file). | |
| 1517 </para> | |
| 1518 | |
| 1519 <para> | |
| 1520 Alcune volte invece, non hai davvero altra scelta se non comprimere | |
| 1521 ulteriormente il suono per poter usare più bit per il video. | |
| 1522 La maggior parte delle persone sceglie di comprimere l'audio con i codec MP3 | |
| 1523 ovvero Vorbis. | |
| 1524 Mentre quest'ultimo è un codec decisamente efficiente per lo spazio, MP3 è | |
| 1525 meglio supportato dai lettori da tavolo, anche se la situazione sta cambiando. | |
| 1526 </para> | |
| 1527 | |
| 1528 <para> | |
| 1529 <emphasis>Non</emphasis> usare <option>-nosound</option> mentre codifichi un | |
| 1530 file con dell'audio, anche se farai la codifica e il mux dell'audio | |
| 1531 separatamente in seguito. | |
| 1532 Anche se potesse andar bene in casi ideali, facilmente usare | |
| 1533 <option>-nosound</option> nasconderà alcuni problemi nelle tue impostazioni di | |
| 1534 codifica sulla riga comando. | |
| 1535 In altre parole mantenere la colonna sonora durante la codifica ti assicura, | |
| 1536 a patto che tu non veda messaggi del tipo | |
| 1537 <quote>Troppi pacchetti audio nel buffer</quote>, di ottenere un'adeguata | |
| 1538 sincronizzazione. | |
| 1539 </para> | |
| 1540 | |
| 1541 <para> | |
| 1542 Devi fare in modo che <application>MEncoder</application> processi il suono. | |
| 1543 Puoi per esempio copiare la colonna sonora originaria durante la codifica con | |
| 1544 <option>-oac copy</option>, o convertirla in un "leggero" PCM WAV mono a 4 kHz | |
| 1545 con <option>-oac pcm -channels 1 -srate 4000</option>. | |
| 1546 In caso contrario in alcuni casi verrà generato un file video che sarà | |
| 1547 desincronizzato con l'audio. | |
| 1548 Casi del genere sono quelli in cui il numero dei fotogrammi video nel file di | |
| 1549 origine non corrisponde alla lunghezza totale dei fotogrammi audio oppure | |
| 1550 ogniqualvolta vi siano delle discontinuità/splice in cui mancano o ci sono | |
| 1551 fotogrammi audio in più. | |
| 1552 Il modo giusto di gestire questo tipo di problemi è inserire del silenzio o | |
| 1553 tagliare l'audio in quei punti. | |
| 1554 Tuttavia <application>MPlayer</application> non è in grado di farlo, per cui se | |
| 1555 fai il demux dell'audio AC-3 e lo codifichi con un'altro programma (o ne fai il | |
| 1556 dump in PCM con <application>MPlayer</application>), gli splice rimarranno | |
| 1557 sbagliati e l'unico modo per correggerli è scartare/duplicare fotogrammi video | |
| 1558 nel punto di splice. | |
| 1559 Fintantochè <application>MEncoder</application> vede l'audio mentre codifica il | |
| 1560 video, può eseguire questo scarto/duplicazione (che solitamente è OK, dato che | |
| 1561 capita con scene nere o cambi scena), ma se <application>MEncoder</application> | |
| 1562 non vede l'audio, processerà i fotogrammi così come sono e alla fine non | |
| 1563 corrisponderanno al flusso audio finale quando per esempio inserirai i flussi | |
| 1564 audio e video dentro a un file Matroska. | |
| 1565 </para> | |
| 1566 | |
| 1567 <para> | |
| 1568 Prima di tutto dovrai convertire l'audio DVD in un file WAV che il codec audio | |
| 1569 possa usare come ingresso. | |
| 1570 Per esempio: | |
| 25279 | 1571 <screen> |
| 25449 | 1572 mplayer <replaceable>file_sorgente.vob</replaceable> -ao pcm:file=<replaceable>suono_destinazione.wav</replaceable> \ |
| 25279 | 1573 -vc dummy -aid 1 -vo null |
| 1574 </screen> | |
| 25449 | 1575 eseguirà il dump della seconda traccia audio dal file |
| 1576 <replaceable>file_sorgente.vob</replaceable> sul file | |
| 1577 <replaceable>suono_destinazione.wav</replaceable>. | |
| 1578 Potresti voler normalizzare il suono prima della codifica, visto che le tracce | |
| 1579 audio dei DVD spesso sono registrate a volumi bassi. | |
| 1580 Puoi usare per esempio lo strumento <application>normalize</application>, che | |
| 1581 è disponibile nella maggior parte delle distribuzioni. | |
| 1582 Se stai usando Windows, lo stesso mestiere lo può fare uno strumento tipo | |
| 1583 <application>BeSweet</application>. | |
| 1584 Effettuerai la compressione in Vorbis ovvero in MP3. | |
| 1585 | |
| 1586 Per esempio: | |
| 1587 <screen>oggenc -q1 <replaceable>suono_destinazione.wav</replaceable></screen> | |
| 1588 codificherà <replaceable>suono_destinazione.wav</replaceable> con qualità | |
| 1589 di codifica 1, che equivale circa a 80Kb/s, ed è la qualità minima in cui | |
| 1590 dovresti codificare se ti interessa la qualità. | |
| 1591 Fai per favore attenzione che attualmente <application>MEncoder</application> | |
| 1592 non è in grado di fare il mux di tracce audio Vorbis nel file di uscita, | |
| 1593 perché gestisce solo contenitori AVI e MPEG in uscita, ognuno dei quali può | |
| 1594 portare a problemi di sincronizzazione audio/video durante la riproduzione con | |
| 1595 alcuni lettori quando il file AVI contiene flussi audio VBR come Vorbis. | |
| 1596 Non preoccuparti, questa documentazione ti mostrerà come tu possa farlo | |
| 1597 comunque con programmi di terze parti. | |
| 25279 | 1598 </para> |
| 1599 </sect2> | |
| 1600 | |
| 1601 <!-- ********** --> | |
| 1602 | |
| 1603 <sect2 id="menc-feat-dvd-mpeg4-muxing"> | |
| 1604 <title>Muxing</title> | |
| 1605 | |
| 1606 <para> | |
| 26192 | 1607 Ora che hai codificato il tuo video, vorrai verosimilmente farne il mux in un |
| 1608 contenitore di filmati con una o più tracce audio, come AVI, MPEG, Matroska o | |
| 1609 NUT. | |
| 1610 <application>MEncoder</application> è attualmente in grado di generare in modo | |
| 1611 nativo solo video in formati contenitore MPEG o AVI. | |
| 1612 Per esempio: | |
| 25279 | 1613 <screen> |
| 26192 | 1614 mencoder -oac copy -ovc copy -o <replaceable>film_in_uscita.avi</replaceable> \ |
| 1615 -audiofile <replaceable>audio_in_ingresso.mp2</replaceable> <replaceable>video_in_ingresso.avi</replaceable> | |
| 25279 | 1616 </screen> |
| 26192 | 1617 Questo miscelerà i file video <replaceable>video_in_ingresso.avi</replaceable> |
| 1618 e audio <replaceable>audio_in_ingresso.mp2</replaceable> nel file AVI | |
| 1619 <replaceable>film_in_uscita.avi</replaceable>. | |
| 1620 Questo comando funziona con audio MPEG-1 layer I, II e III (più comunemente | |
| 1621 conosciuto come MP3), WAV e qualche altro formato audio. | |
| 1622 </para> | |
| 1623 | |
| 1624 <para> | |
| 1625 <application>MEncoder</application> vanta un supporto sperimentale per | |
| 1626 <systemitem class="library">libavformat</systemitem>, che è una libreria del | |
| 1627 progetto FFmpeg che può fare il mux e il demux di svariati contenitori. | |
| 1628 Per esempio: | |
| 25279 | 1629 <screen> |
| 26192 | 1630 mencoder -oac copy -ovc copy -o <replaceable>film_di_uscita.asf</replaceable> -audiofile <replaceable>audio_in_ingresso.mp2</replaceable> \ |
| 1631 <replaceable>video_in_ingresso.avi</replaceable> -of lavf -lavfopts format=asf | |
| 25279 | 1632 </screen> |
| 26192 | 1633 Questo farà la stessa cosa dell'esempio precedente, trannce che il contenitore |
| 1634 di uscita sarà ASF. | |
| 1635 Per favore nota che questo supporto è altamente sperimentale (ma migliora di | |
| 1636 giorno in giorno), e funzionerà solo se hai compilato | |
| 1637 <application>MPlayer</application> con il supporto per | |
| 1638 <systemitem class="library">libavformat</systemitem> abilitato (il che | |
| 1639 significa che una versione precompilata nella maggior parte dei casi non | |
| 1640 funzionerà). | |
| 25279 | 1641 </para> |
| 1642 | |
| 1643 | |
| 1644 <sect3 id="menc-feat-dvd-mpeg4-muxing-filter-issues"> | |
| 26192 | 1645 <title>Migliorare il mux e l'affidabilità di sincronizzazione A/V</title> |
| 1646 | |
| 1647 <para> | |
| 1648 Potresti avere dei seri problemi di sincronizzazione cercando di fare il mux | |
| 1649 del tuo video con alcune tracce audio, indipendentemente da come tu corregga il | |
| 1650 ritardo audio, non otterrai mai una sincronia corretta. | |
| 1651 Ciò potrebbe succedere quando usi un qualche filtro video che scarti o duplichi | |
| 1652 alcuni fotogrammi, come il filtro di telecine inverso. | |
| 1653 Si consiglia vivamente di appendere il filtro video <option>harddup</option> | |
| 1654 alla fine della catena dei filtri, per evitare questo tipo di problema. | |
| 1655 </para> | |
| 1656 | |
| 1657 <para> | |
| 1658 Senza <option>harddup</option>, se <application>MEncoder</application> vuole | |
| 1659 duplicare un fotogramma, chiede al muxer di mettere un segno sul contenitore | |
| 1660 affinché l'ultimo fotogramma venga mostrato di nuovo per mantenere la | |
| 1661 sincronia, senza scriverne effettivamente alcuno. | |
| 1662 Con <option>harddup</option>, <application>MEncoder</application> farà | |
| 1663 semplicemente passare di nuovo l'ultimo fotogramma nella catena di filtri. | |
| 1664 Questo significa che il codificatore riceve <emphasis>esattamente</emphasis> lo | |
| 1665 stesso fotogramma due volte, e lo comprime. | |
| 1666 Ciò genera un file leggermente più grosso, ma non causerà problemi | |
| 1667 effettuando il demux o il remux in altri formati contenitore. | |
| 1668 </para> | |
| 1669 | |
| 1670 <para> | |
| 1671 Potresti non avere altra scelta che usare <option>harddup</option> con formati | |
| 1672 contenitore che non siano così legati a <application>MEncoder</application> | |
| 1673 come quelli gestiti attraverso | |
| 1674 <systemitem class="library">libavformat</systemitem>, e che possano non gestire | |
| 1675 la duplicazione fotogrammi a livello contenitore. | |
| 25279 | 1676 </para> |
| 1677 </sect3> | |
| 1678 | |
| 1679 | |
| 1680 <sect3 id="menc-feat-dvd-mpeg4-muxing-avi-limitations"> | |
| 26192 | 1681 <title>Limitazioni del contenitore AVI</title> |
| 1682 | |
| 1683 <para> | |
| 1684 Anche se AVI è il formato contenitore più ampiamente gestito dopo MPEG-1, ha | |
| 1685 anche molti gravi inconvenienti. | |
| 1686 Forse il più ovvio è lo spreco di banda. | |
| 1687 Per ogni blocco del file AVI, 24 byte sono sprecati per intestazione e indice. | |
| 1688 Questo porta a poco più di 5 MB per ora, o 1-2.5% di dimensione supplementare | |
| 1689 per un film da 700 MB. Potrebbe non sembrare poi così tanto, ma potrebbe far | |
| 1690 la differenza tra poter utilizzare 700 oppure 714 kbit/sec per il video, e ogni | |
| 1691 bit è importante per la qualità. | |
| 1692 </para> | |
| 1693 | |
| 1694 <para> | |
| 1695 Oltre a questa grave inefficenza, AVI ha anche le grandi limitazioni che | |
| 1696 seguono: | |
| 25279 | 1697 </para> |
| 1698 | |
| 1699 <orderedlist> | |
| 1700 <listitem><para> | |
| 26192 | 1701 Può essere immagazzinato solo contenuto a fps costanti. Questo è decisamente |
| 1702 limitante se il materiale di origine che vuoi codificare è contenuto misto, | |
| 1703 per esempio un misto di video NTSC e film. | |
| 1704 Ci sono invero alcuni trucchi che possono essere usati per salvare negli AVI | |
| 1705 contenuto a frequenza di fotogrammi mista, ma aumentano il (già immenso) | |
| 1706 spreco di banda di cinque volte o giù di lì e quindi non sono pratici. | |
| 25279 | 1707 </para></listitem> |
| 1708 <listitem><para> | |
| 26192 | 1709 L'audio nei file AVI deve essere a bitrate costante (CBR) o a dimensione di |
| 1710 fotogramma fissa (per es. tutti i fotogrammi decodificano lo stesso numero di | |
| 1711 campioni). | |
| 1712 Sfortunatamente, il codec più efficente, Vorbis, non ha alcuna delle suddette | |
| 1713 caratteristiche. | |
| 1714 Se decidi di salvare il tuo film in AVI, dovrai perciò usare un codec meno | |
| 1715 efficente, come MP3 o AC-3. | |
| 25279 | 1716 </para></listitem> |
| 1717 </orderedlist> | |
| 1718 | |
| 1719 <para> | |
| 26192 | 1720 Detto tutto ciò, <application>MEncoder</application> non gestisce attualmente |
| 1721 la codifica in uscita a fps variabile o la codifica in Vorbis. | |
| 1722 Quindi non noterai le limitazioni su citate se | |
| 1723 <application>MEncoder</application> è l'unico strumento che userai per produrre | |
| 1724 le tue codifiche. | |
| 1725 Tuttavia è possibile usare <application>MEncoder</application> solo per la | |
| 1726 codifica del video, e poi utilizzare strumenti di terze parti per codificare | |
| 1727 l'audio e farne il mux in un altro formato contenitore. | |
| 25279 | 1728 </para> |
| 1729 </sect3> | |
| 1730 | |
| 1731 | |
| 1732 <sect3 id="menc-feat-dvd-mpeg4-muxing-matroska"> | |
| 26192 | 1733 <title>Mux nel contenitore Matroska</title> |
| 1734 | |
| 1735 <para> | |
| 1736 Matroska è un formato contenitore libero, a standard aperti, che punta ad | |
| 1737 offrire molte caratteristiche avanzate, che contenitori più vecchi come AVI non | |
| 1738 sono in grado di manipolare. | |
| 1739 Per esempio Matroska supporta contenuto audio a bitrate variabile (VBR), | |
| 1740 frequenza fotogrammi variabile (VFR), capitoli, file allegati, codice di | |
| 1741 gestione errori (EDC) e Codec A/V moderni come "Advanced Audio Coding" (AAC), | |
| 1742 "Vorbis" or "MPEG-4 AVC" (H.264), comparato al nulla gestito da AVI. | |
| 1743 </para> | |
| 1744 | |
| 1745 <para> | |
| 1746 Gli strumenti necessari per creare file Matroska sono chiamati nel loro insieme | |
| 1747 <application>mkvtoolnix</application> e sono disponibili per la maggior parte | |
| 1748 delle piattaforme Unix, così come per <application>Windows</application>. | |
| 1749 Dato che Matroska è uno standard aperto, potresti trovare altri strumenti che | |
| 1750 ti tornino più utili, ma dato che mkvtoolnix è il più diffuso, ed è | |
| 1751 supportato dal team stesso di Matroska, illustreremo il suo solo utilizzo. | |
| 1752 </para> | |
| 1753 | |
| 1754 <para> | |
| 1755 Probabilmente il modo più semplice di avvicinarsi a Matroska è utilizzare | |
| 1756 <application>MMG</application>, il frontend grafico fornito con | |
| 1757 <application>mkvtoolnix</application>, e seguire la <ulink url="http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge-gui.html">guida della GUI di mkvmerge (mmg)</ulink>. | |
| 1758 </para> | |
| 1759 | |
| 1760 <para> | |
| 1761 Puoi anche fare il mux dei file audio e video usando la riga comando: | |
| 25279 | 1762 <screen> |
| 26192 | 1763 mkvmerge -o <replaceable>destinazione.mkv</replaceable> <replaceable>video_sorgente.avi</replaceable> <replaceable>audio_sorgente1.mp3</replaceable> <replaceable>audio_sorgente2.ac3</replaceable> |
| 25279 | 1764 </screen> |
| 26192 | 1765 Questo unirà il file video <replaceable>video_sorgente.avi</replaceable> e i |
| 1766 due file audio <replaceable>audio_sorgente1.mp3</replaceable> e | |
| 1767 <replaceable>audio_sorgente2.ac3</replaceable> nel file Matroska | |
| 1768 <replaceable>destinazione.mkv</replaceable>. | |
| 1769 Matroska, come detto precedentemente, è in grado di far molto più di questo, | |
| 1770 come tracce audio multiple (inclusa una fine sincronia audio/video), capitoli, | |
| 1771 sottotitoli, salti, etc... | |
| 1772 Fai per favore riferimento alla documentazione di queste applicazioni per | |
| 1773 maggiori delucidazioni. | |
| 25279 | 1774 </para> |
| 1775 </sect3> | |
| 1776 </sect2> | |
| 1777 </sect1> | |
| 1778 | |
| 1779 | |
| 1780 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
| 1781 | |
| 1782 | |
| 1783 <sect1 id="menc-feat-telecine"> | |
| 26192 | 1784 <title>Come trattare telecine e interlacciamento nei DVD NTSC</title> |
| 25279 | 1785 |
| 1786 <sect2 id="menc-feat-telecine-intro"> | |
| 26192 | 1787 <title>Introduzione</title> |
| 25279 | 1788 |
| 1789 <formalpara> | |
| 26192 | 1790 <title>Cos'è telecine?</title> |
| 1791 <para> | |
| 1792 Se non comprendi molto quello che è scritto in questo documento, leggi la | |
| 1793 <ulink url="http://en.wikipedia.org/wiki/Telecine">definizione di telecine su Wikipedia</ulink> | |
| 1794 (<ulink url="http://en.wikipedia.org/wiki/Telecine">pagina inglese</ulink>). | |
| 1795 E' una descrizione comprensibile e ragionevolmente completa di cosa si indichi | |
| 1796 con telecine. | |
| 25279 | 1797 </para></formalpara> |
| 1798 | |
| 1799 <formalpara> | |
| 26192 | 1800 <title>Una nota riguardo i numeri.</title> |
| 1801 <para> | |
| 1802 Molti documenti, inclusa la guida su indicata, fanno riferimento al valore dei | |
| 1803 campi per secondo del video NTSC come 59.94 e i valori corrispondenti di | |
| 1804 fotogrammi al secondo come 29.97 (con telecine e interlacciamento) e 23.976 | |
| 1805 (per il progressivo). Per semplicità alcune documentazioni arrotondano tali | |
| 1806 cifre a 60, 30 e 24. | |
| 25279 | 1807 </para></formalpara> |
| 1808 | |
| 1809 <para> | |
| 26192 | 1810 Strettamente parlando, tutti questi numeri sono approssimati. Il video NTSC in |
| 1811 bianco e nero era esattamente 60 campi al secondo, ma successivamente venne | |
| 1812 scelto 60000/1001 per incastrare i dati del colore e rimanere compatibili con | |
| 1813 le televisioni bianco e nero contemporanee. Anche il video NTSC digitale (come | |
| 1814 quello sui DVD) è a 60000/1001 campi al secondo. Da ciò discende che il video | |
| 1815 interlacciato e telecine è 30000/1001 fotogrammi al secondo; il video | |
| 1816 progressivo è 24000/1001 fotogrammi al secondo. | |
| 1817 </para> | |
| 1818 | |
| 1819 <para> | |
| 1820 Precedenti versioni della documentazioni di <application>MEncoder</application> | |
| 1821 a molti post archiviati della mailig list fanno riferimento a 59.94, 29.97 e | |
| 1822 23.976. | |
| 1823 Tutta la documentazioni di <application>MEncoder</application> è stata | |
| 1824 aggiornata per usare i valori in frazione, e anche tu dovresti usare questi. | |
| 1825 </para> | |
| 1826 | |
| 1827 <para> | |
| 1828 <option>-ofps 23.976</option> è sbagliato. | |
| 1829 <option>-ofps 24000/1001</option> dovrebbe invece essere usato. | |
| 25279 | 1830 </para> |
| 1831 | |
| 1832 <formalpara> | |
| 26192 | 1833 <title>Come viene usato telecine.</title> |
| 25279 | 1834 <para> |
| 26192 | 1835 Tutto il video pensato per essere riprodotto su televisione NTSC deve essere a |
| 1836 60000/1001 campi al secondo. I film per la TV e gli spettacoli sono spesso | |
| 1837 registrati direttamente a 60000/1001 campi al secondo, ma la stragrande | |
| 1838 maggioranzna dei film per cinema è filmata a 24 o 24000/1001 fotogrammi al | |
| 1839 secondo. Quando i film da cinema vengono masterizzati su DVD, il video viene | |
| 1840 quindi convertito per la televisione usando un processo chiamato telecine | |
| 1841 (o telecinema). | |
| 25279 | 1842 </para></formalpara> |
| 1843 | |
| 1844 <para> | |
| 26192 | 1845 Su un DVD il video non è praticamente mai memorizzato con 60000/1001 campi al |
| 1846 secondo. Per un video che originariamente era 60000/1001, ogni coppia di campi | |
| 1847 viene combinata in un fotogramma, risultando in 30000/1001 fotogrammi al | |
| 1848 secondo. I lettori DVD hardware leggono quindi un parametro codificato nel | |
| 1849 flusso video pe rdeterminare se le linee pari o quelle dispari debbano formare | |
| 1850 il primo campo. | |
| 1851 </para> | |
| 1852 | |
| 1853 <para> | |
| 1854 Solitamente il contenuto a 24000/1001 fotogrammi per secondi resta così com'è | |
| 1855 quando viene codificato per un DVD, e il lettore DVD deve eseguire il telecine | |
| 1856 al momento. Alcune volte invece, il video subisce il telecine | |
| 1857 <emphasis>prima</emphasis> di essere scritto su DVD; anche se in origine era a | |
| 1858 24000/1001 fotogrammi al secondi, diventa 60000/1001 campi al secondo. Quando | |
| 1859 viene memorizzato su DVD, le coppie di campi vengono assemblate per formare | |
| 1860 30000/1001 fotogrammi al secondo. | |
| 1861 </para> | |
| 1862 | |
| 1863 <para> | |
| 1864 Guardando i singoli fotogrammi generati da video a 60000/1001 campi al secondo, | |
| 1865 che sia telecine o no, l'interlacciamento è chiaramente visibile ovunque vi sia | |
| 1866 del movimento, dato che un campo (diciamo le linee pari) rappresenta un istante | |
| 1867 nel tempo 1/(60000/1001) secondi dopo l'altro. Riprodurre video interlacciato | |
| 1868 su un computer risulta brutto sia perché il monitor ha una risoluzione maggiore | |
| 1869 sia perché il video viene mostrato un fotogramma dopo l'altro invece che un | |
| 1870 campo dopo l'altro. | |
| 25279 | 1871 </para> |
| 1872 | |
| 1873 <itemizedlist> | |
| 26192 | 1874 <title>Note:</title> |
| 25279 | 1875 <listitem><para> |
| 26192 | 1876 Questa sezione si applica solo ai DVD NTSC, e non a quelli PAL. |
| 25279 | 1877 </para></listitem> |
| 1878 <listitem><para> | |
| 26192 | 1879 Le righe di esempio per <application>MEncoder</application> proposte nella |
| 1880 documentazione <emphasis role="bold">non</emphasis> sono pensate per un | |
| 1881 utilizzo reale. Sono solo quelle minimali richieste per codificare la | |
| 1882 relativa categoria di video. Come fare buoni rip di DVD o configurare bene | |
| 1883 <systemitem class="library">libavcodec</systemitem> per la massima qualità | |
| 1884 non è lo scopo di questa documentazione. | |
| 25279 | 1885 </para></listitem> |
| 1886 <listitem><para> | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
1887 Ci sono alcune note a piè di pagina specifiche di questa guida, così |
| 26192 | 1888 indicate: |
| 25279 | 1889 <link linkend="menc-feat-telecine-footnotes">[1]</link> |
| 1890 </para></listitem> | |
| 1891 </itemizedlist> | |
| 1892 </sect2> | |
| 1893 | |
| 1894 <!-- ********** --> | |
| 1895 | |
| 1896 <sect2 id="menc-feat-telecine-ident"> | |
| 26253 | 1897 <title>Come scoprire il tipo di video che possiedi</title> |
| 25279 | 1898 |
| 1899 <sect3 id="menc-feat-telecine-ident-progressive"> | |
| 26827 | 1900 <title>Progressivo</title> |
| 26253 | 1901 |
| 1902 <para> | |
| 1903 Il video progressivo è stato originariamente filmato a 24000/1001 fps, e | |
| 1904 memorizzato sul DVD senza modifica alcuna. | |
| 1905 </para> | |
| 1906 | |
| 1907 <para> | |
| 1908 Quando riproduci un DVD progressivo con <application>MPlayer</application>, | |
| 1909 <application>MPlayer</application> emette la riga seguente appena il video | |
| 1910 inizia la riproduzione: | |
| 25279 | 1911 <screen> |
| 1912 demux_mpg: 24000/1001 fps progressive NTSC content detected, switching framerate. | |
| 1913 </screen> | |
| 26253 | 1914 Da qui in poi, demux_mpg non dovrebbe mai comunicare di aver trovato |
| 1915 "30000/1001 fps NTSC content" (contenuto NTSC a 30000/1001 fps). | |
| 1916 </para> | |
| 1917 | |
| 1918 <para> | |
| 1919 Quando guardi video progressivo, non dovresti mai vedere alcuna interlacciatura. | |
| 1920 Fai tuttavia attenzione, poiché alcune volte c'è una piccola parte in telecine | |
| 1921 infilata dove non te la aspetteresti. Ho trovato alcuni DVD di spettacoli | |
| 1922 televisivi che hanno un secondo di telecine ad ogni cambio di scena, o anche in | |
| 1923 momenti casuali. Una volta ho guardato un DVD che aveva una prima parte | |
| 1924 progressiva e la seconda in telecine. Se vuoi esserne | |
| 1925 <emphasis>davvero</emphasis> certo, devi controllare tutto il video: | |
| 25279 | 1926 <screen>mplayer dvd://1 -nosound -vo null -benchmark</screen> |
| 1927 Using <option>-benchmark</option> makes | |
| 26253 | 1928 L'utilizzo di <option>-benchmark</option> fa sì che |
| 1929 <application>MPlayer</application> riproduca il filmato il più velocemente | |
| 1930 possibile; tuttavia, in dipendenza dal tuo hardware, può metterci un po'. | |
| 1931 Ogni volta che demux_mpg segnala un cambio nella frequenza fotogrammi | |
| 1932 (framerate), la linea immediatamente sopra ti dirà il tempo ove è cambiata. | |
| 1933 </para> | |
| 1934 | |
| 1935 <para> | |
| 1936 Alcune volte il video progressivo sui DVD viene indicato come "soft-telecine" | |
| 1937 perché è fatto in modo che il lettore DVD esegua il telecine. | |
| 25279 | 1938 </para> |
| 1939 </sect3> | |
| 1940 | |
| 1941 | |
| 1942 <sect3 id="menc-feat-telecine-ident-telecined"> | |
| 26253 | 1943 <title>Telecine</title> |
| 1944 | |
| 1945 <para> | |
| 1946 Il video in telecine è stato filmato in origine a 24000/1001, ma ha subito il | |
| 1947 telecine <emphasis>prima</emphasis> di essere scritto sul DVD. | |
| 1948 </para> | |
| 1949 | |
| 1950 <para> | |
| 1951 Quando <application>MPlayer</application> riproduce video in telecine non | |
| 1952 segnala (mai) alcun cambio di framerate. | |
| 1953 </para> | |
| 1954 | |
| 1955 <para> | |
| 1956 Guardado un video in telecine, noterai artefatti che sembrano "lampeggiare": | |
| 1957 appaiono e scompaiono ripetutamente. | |
| 1958 Puoi notarlo meglio facendo quello che segue | |
| 25279 | 1959 <orderedlist> |
| 1960 <listitem><screen>mplayer dvd://1</screen></listitem> | |
| 1961 <listitem><para> | |
| 26253 | 1962 Ricerca una parte con movimento. |
| 25279 | 1963 </para></listitem> |
| 1964 <listitem><para> | |
| 26253 | 1965 Usa il tasto <keycap>.</keycap> per avanzare di un fotogramma per volta. |
| 25279 | 1966 </para></listitem> |
| 1967 <listitem><para> | |
| 26253 | 1968 Guarda il pattern dei fotogrammi che paiono interlacciati e di quelli |
| 1969 progressivi. Se il pattern che vedi è PPPII,PPPII,PPPII,... allora il video | |
| 1970 è in telecine. Se vedi qualche altro pattern, allora il video può aver | |
| 1971 subito il telecine attraverso qualche metodo strano; | |
| 1972 <application>MEncoder</application> può effettuare la conversione senza | |
| 1973 perdita da telecine non standard a progressivo. Se non vedi alcun pattern, | |
| 1974 allora molto probabilmente è interlacciato. | |
| 25279 | 1975 </para></listitem> |
| 1976 </orderedlist> | |
| 1977 </para> | |
| 1978 | |
| 1979 <para> | |
| 26253 | 1980 Alcune volte il video in telecine sui DVD viene indicato come "hard-telecine". |
| 1981 Dato che l'hard-telecine è già a 60000/1001 campi al secondi, il lettore DVD | |
| 1982 riproduce il video senza elaborazione alcuna. | |
| 1983 </para> | |
| 1984 | |
| 1985 <para> | |
| 1986 Un altro modo per scoprire se la tua sorgente è in telecine o no è riprodurla | |
| 1987 con le opzioni <option>-vf pullup</option> e <option>-v</option> da riga | |
| 1988 comando per vedere come <option>pullup</option> relaziona i fotogrammi. | |
| 1989 Se la sorgente è in telecine, dovresti vedere sulla console un pattern 3:2 con | |
| 1990 <systemitem>0+.1.+2</systemitem> e <systemitem>0++1</systemitem> che si | |
| 1991 alternano. | |
| 1992 Questa tecnica ha il vantaggio di evitare di guardare la sorgente per doverla | |
| 1993 identificare, il che può tornare utile se vuoi automatizzare la procedura di | |
| 1994 codifica ovvero se vuoi eseguire tale procedura in remoto su una connessione | |
| 1995 lenta. | |
| 25279 | 1996 </para> |
| 1997 </sect3> | |
| 1998 | |
| 1999 | |
| 2000 <sect3 id="menc-feat-telecine-ident-interlaced"> | |
| 26253 | 2001 <title>Interlacciato</title> |
| 2002 | |
| 2003 <para> | |
| 2004 Il video interlacciato è stato filmato in origine a 60000/1001 campi al | |
| 2005 secondo ed è memorizzato sul DVD a 30000/1001 fotogrammi al secondo. L'effetto | |
| 2006 di interlacciatura (spesso chimato "combing") è un risultato di coppie di | |
| 2007 campi che vengono combinate in fotogrammi. Ogni campo è spostato di | |
| 2008 1/(60000/1001) secondi e quando vengono mostrati contemporaneamente la | |
| 2009 differenza si nota. | |
| 2010 </para> | |
| 2011 | |
| 2012 <para> | |
| 2013 Come per il video in telecine, <application>MPlayer</application> non dovrebbe | |
| 2014 mai segnalare alcun cambio di framerete, riproducendo contenuto interlacciato. | |
| 2015 </para> | |
| 2016 | |
| 2017 <para> | |
| 2018 Quando guardi attentamente un video interlacciato avanzando fotogramma per | |
| 2019 fotogramma col tasto <keycap>.</keycap>, noterai che ogni singolo fotogramma è | |
| 2020 interlacciato. | |
| 25279 | 2021 </para> |
| 2022 </sect3> | |
| 2023 | |
| 2024 | |
| 2025 <sect3 id="menc-feat-telecine-ident-mixedpt"> | |
| 27851 | 2026 <title>Progressivo e telecine mescolati</title> |
| 2027 | |
| 2028 <para> | |
| 2029 Tutto il contenuto di un video "progressivo e telecine mescolati" è stato | |
| 26253 | 2030 in origine filmato a 24000/1001 fotogrammi al secondo, ma alcune parti alla |
| 2031 fine hanno subito il telecine. | |
| 2032 </para> | |
| 2033 | |
| 2034 <para> | |
| 2035 Quando <application>MPlayer</application> riproduce questa tipologia di video | |
| 2036 salta (spesso ripetutamente) avanti e indietro tra "30000/1001 fps NTSC" e | |
| 2037 "24000/1001 fps progressive NTSC". Controlla le ultime righe dell'emissione di | |
| 2038 <application>MPlayer</application> per vedere questi messaggi. | |
| 2039 </para> | |
| 2040 | |
| 2041 <para> | |
| 2042 Dovresti controllare le sezioni "30000/1001 fps NTSC" per assicurarti che siano | |
| 2043 davvero in telecine e non solamente interlacciate. | |
| 25279 | 2044 </para> |
| 2045 </sect3> | |
| 2046 | |
| 2047 | |
| 2048 <sect3 id="menc-feat-telecine-ident-mixedpi"> | |
| 27851 | 2049 <title>Progressivo e interlacciato mescolati</title> |
| 2050 | |
| 2051 <para> | |
| 2052 Nei contenuti con video "progressivo e interlacciato mescolati", il video | |
| 26253 | 2053 progressivo e interlacciato sono mescolati tra loro. |
| 2054 </para> | |
| 2055 | |
| 2056 <para> | |
| 27851 | 2057 Questa categoria è decisamente simile a "progressivo e telecine mescolati", |
| 26253 | 2058 fino a quando non controlli le parti a 30000/1001 fps e scopri che non hanno |
| 2059 il pattern del telecine. | |
| 25279 | 2060 </para> |
| 2061 </sect3> | |
| 2062 </sect2> | |
| 2063 | |
| 2064 <!-- ********** --> | |
| 2065 | |
| 2066 <sect2 id="menc-feat-telecine-encode"> | |
| 26811 | 2067 <title>Come codificare ciascuna categoria</title> |
| 2068 <para> | |
| 2069 Come menzionato all'inizio, le linee di esempio qui sotto per | |
| 2070 <application>MEncoder</application> <emphasis role="bold">non</emphasis> sono | |
| 2071 pensate per essere usate davvero; dimostrano solamente i parametri minimi per | |
| 2072 codificare correttamente ciascuna categoria. | |
| 25279 | 2073 </para> |
| 2074 | |
| 2075 | |
| 2076 <sect3 id="menc-feat-telecine-encode-progressive"> | |
| 26811 | 2077 <title>Progressivo</title> |
| 2078 <para> | |
| 2079 Il video progressivo non richiede particolari filtri per la codifica. L'unico | |
| 26827 | 2080 parametrioche devi assicurarti di usare è <option>-ofps 24000/1001</option>. |
| 2081 Se non lo usi, <application>MEncoder</application> cercherà di codificare a | |
| 2082 30000/1001 fps e duplicherà i fotogrammi. | |
| 25279 | 2083 </para> |
| 2084 | |
| 2085 <para> | |
| 2086 <screen>mencoder dvd://1 -oac copy -ovc lavc -ofps 24000/1001</screen> | |
| 2087 </para> | |
| 2088 | |
| 2089 <para> | |
| 26811 | 2090 Spesso e volentieri capita che un video che sembra progressivo contenga anche |
| 27851 | 2091 alcune brevi parti di telecine mescolate. A meno che tu non sia sicuro, |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
2092 conviene trattare il video come |
| 27851 | 2093 <link linkend="menc-feat-telecine-encode-mixedpt">progressivo e telecine mescolati</link>. |
| 26827 | 2094 Il calo di prestazioni è piccolo |
| 25279 | 2095 <link linkend="menc-feat-telecine-footnotes">[3]</link>. |
| 2096 </para> | |
| 2097 </sect3> | |
| 2098 | |
| 2099 | |
| 2100 <sect3 id="menc-feat-telecine-encode-telecined"> | |
| 26811 | 2101 <title>Telecine</title> |
| 2102 | |
| 2103 <para> | |
| 26827 | 2104 Il telecine può essere invertito per ricavare il contenuto originario a |
| 26811 | 2105 24000/1001 usando un processo conosciuto come telecine-inverso. |
| 26827 | 2106 <application>MPlayer</application> include vari filtri per ottenere ciò; |
| 2107 il filtro migliore, <option>pullup</option>, è descritto nella sezione | |
| 26811 | 2108 <link linkend="menc-feat-telecine-encode-mixedpt">progressivo e telecine |
| 27851 | 2109 mescolati</link>. |
| 25279 | 2110 </para> |
| 2111 </sect3> | |
| 2112 | |
| 2113 | |
| 2114 <sect3 id="menc-feat-telecine-encode-interlaced"> | |
| 26811 | 2115 <title>Interlacciato</title> |
| 2116 | |
| 2117 <para> | |
| 26827 | 2118 Nella maggior parte dei casi reali non è possibile ricavare un video |
| 26811 | 2119 progressivo completo da contenuto interlacciato. L'unico modo di farlo senza |
| 26827 | 2120 perdere metà della risoluzione verticale è raddoppiare il framerate e provare |
| 26811 | 2121 ad "indovinare" quello che forma le linee corrispondenti per ogni campo |
| 2122 (questo ha delle controindicazioni - vedi il metodo 3). | |
| 25279 | 2123 </para> |
| 2124 | |
| 2125 <orderedlist> | |
| 2126 <listitem><para> | |
| 26811 | 2127 Codifica il video in forma interlacciata. Normalmente l'interlacciatura fa a |
| 26827 | 2128 pugni con l'abilità del codificatore di comprimere bene, ma |
| 26811 | 2129 <systemitem class="library">libavcodec</systemitem> ha due parametri |
| 2130 appositamente per gestire un pochino meglio il video interlacciato: | |
| 2131 <option>ildct</option> e <option>ilme</option>. Inoltre viene caldamente | |
| 2132 consigliato l'utilizzo di <option>mbd=2</option> | |
| 26827 | 2133 <link linkend="menc-feat-telecine-footnotes">[2] </link> poiché |
| 2134 codificherà i macroblocchi come non interlacciati in posti dove non c'è | |
| 26811 | 2135 movimento. Nota che <option>-ofps</option> qui NON serve. |
| 25279 | 2136 <screen>mencoder dvd://1 -oac copy -ovc lavc -lavcopts ildct:ilme:mbd=2</screen> |
| 2137 </para></listitem> | |
| 2138 <listitem><para> | |
| 26811 | 2139 Usa un filtro di de-interlacciatura prima della codifica. Ci sono vari filtri |
| 2140 disponibili tra cui scegliere, ognuno dei quali con i suoi pro e i suoi | |
| 2141 contro. Controlla <option>mplayer -pphelp</option> e | |
| 26827 | 2142 <option>mplayer -vf help</option> per vedere cosa c'è disponibile |
| 26811 | 2143 (fa in grep per "deint"), leggi il <ulink url="http://guru.multimedia.cx/deinterlacing-filters/">confronto tra filtri di deinterlacciatura |
| 2144 (Deinterlacing filters comparison)</ulink> di Michael Niedermayer, e cerca | |
| 2145 nelle <ulink url="http://www.mplayerhq.hu/design7/mailing_lists.html"> | |
| 2146 mailing list di MPlayer</ulink> per trovare discussioni riguardanti i vari | |
| 2147 filtri. | |
| 2148 Di nuovo il framerate non cambia, indi niente <option>-ofps</option>. | |
| 2149 Inoltre, la deinterlacciatura dovrebbe essere eseguita dopo il ritaglio | |
| 2150 <link linkend="menc-feat-telecine-footnotes">[1]</link> e prima del | |
| 2151 ridimensionamento. | |
| 25279 | 2152 <screen>mencoder dvd://1 -oac copy -vf yadif -ovc lavc</screen> |
| 2153 </para></listitem> | |
| 2154 <listitem><para> | |
| 26811 | 2155 Sfortunatamente, quest'opzione non funziona bene con |
| 2156 <application>MEncoder</application>; dovrebbe funzionar bene con | |
| 2157 <application>MEncoder G2</application>, ma ancora non esiste. Puoi subire | |
| 26827 | 2158 dei crash. Tuttavia l'obiettivo di <option>-vf tfields</option> è di |
| 26811 | 2159 generare un fotogramma completo da ogni campo, portando il framerate a |
| 26827 | 2160 60000/1001. Il vantaggio di questo approccio è che non viene mai perso alcun |
| 26811 | 2161 dato; d'altro canto, dato che ogni fotogramma deriva da un solo campo, le |
| 2162 righe mancanti devono essere interpolate in qualche modo. Non ci sono metodi | |
| 26827 | 2163 veramente validi per ricreare i dati mancanti, quindi il risultato apparirà |
| 26811 | 2164 molto simile a quando vengono usati dei filtri di deinterlacciatura. |
| 26827 | 2165 La generazione delle righe che mancano è foriera di altri problemi, |
| 26811 | 2166 solamente per il fatto che i dati sono raddoppiati. Conseguentemente per |
| 26827 | 2167 mantenere la qualità si rendono necessari bitrate più elevati e viene usata |
| 26811 | 2168 una maggior potenza di CPU sia per la codifica che la decodifica. |
| 2169 tfields ha varie opzioni su come generare le righe mancanti di ogni | |
| 2170 fotogramma. Se usi questo metodo, fai riferimento al manuale, e scegli | |
| 26827 | 2171 l'opzione che può andar meglio per il tuo materiale sorgente. Fai attenzione |
| 26811 | 2172 che usando <option>tfields</option> <emphasis role="bold">devi</emphasis> |
| 2173 specificare sia <option>-fps</option> che <option>-ofps</option> pari al | |
| 2174 doppio della sorgente originaria. | |
| 25279 | 2175 <screen> |
| 2176 mencoder dvd://1 -oac copy -vf tfields=2 -ovc lavc \ | |
| 2177 -fps 60000/1001 -ofps 60000/1001<!-- | |
| 2178 --></screen> | |
| 2179 </para></listitem> | |
| 2180 <listitem><para> | |
| 26811 | 2181 Se conti di ridurre drasticamente le dimensioni puoi estrarre e decodificare |
| 26827 | 2182 sono uno dei due campi. Perderai di sicuro metà della risoluzione verticale, |
| 2183 ma se pensi di ridurla almeno a 1/2 dell'originale, la perdità non sarà poi | |
| 2184 molta. Il risultato sarà un file progressivo a 30000/1001 fotogrammi per | |
| 2185 secondo. La procedura è utilizzare <option>-vf field</option>, poi crop | |
| 26811 | 2186 <link linkend="menc-feat-telecine-footnotes">[1]</link> e scale in modo |
| 2187 corretto. Ricorda che dovrai correggere scale per compensare la risoluzione | |
| 2188 verticale dimezzata. | |
| 25279 | 2189 <screen>mencoder dvd://1 -oac copy -vf field=0 -ovc lavc</screen> |
| 2190 </para></listitem> | |
| 2191 </orderedlist> | |
| 2192 </sect3> | |
| 2193 | |
| 2194 | |
| 2195 <sect3 id="menc-feat-telecine-encode-mixedpt"> | |
| 27851 | 2196 <title>Progressivo e telecine mescolati</title> |
| 2197 | |
| 2198 <para> | |
| 2199 Per poter portare un video progressivo e telecine mescolati in un video | |
| 26811 | 2200 completamente progressivo, le parti in telecine devono essere passate in |
| 26827 | 2201 telecine inverso. Ci son tre modi per ottenere ciò, e sono descritti qui sotto. |
| 26811 | 2202 Nota che dovresti <emphasis role="bold">sempre</emphasis> effettuare il |
| 2203 telecine inverso prima di ogni ridimensionamento; a meno che tu non sappia | |
| 26827 | 2204 davvero cosa tu stia facendo, applica il telecine inverso anche prima del ritaglio (crop) |
| 2205 <link linkend="menc-feat-telecine-footnotes">[1]</link>. | |
| 2206 In questo caso serve <option>-ofps 24000/1001</option> perché il video in | |
| 2207 uscita sarà a 24000/1001 fotogrammi al secondo. | |
| 25279 | 2208 </para> |
| 2209 | |
| 2210 <itemizedlist> | |
| 2211 <listitem><para> | |
| 27851 | 2212 <option>-vf pullup</option> è studiata per togliere il telecine da materiale |
| 2213 in telecine lasciando stare le parti in progressivo. Per poter funzionare | |
| 2214 correttamente, <option>pullup</option> <emphasis role="bold">deve</emphasis> | |
| 2215 essere seguita dal filtro <option>softskip</option> altrimenti | |
| 2216 <application>MEncoder</application> andrà in crash. | |
| 2217 <option>pullup</option> è tuttavia il modo migliore e più preciso disponibile | |
| 2218 per codificare sia telecine che "progressivo e telecine mescolati". | |
| 25279 | 2219 <screen> |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
2220 mencoder dvd://1 -oac copy -vf pullup,softskip |
| 25279 | 2221 -ovc lavc -ofps 24000/1001<!-- |
| 2222 --></screen> | |
| 2223 </para></listitem> | |
| 2224 <listitem><para> | |
| 27851 | 2225 Un metodo più vecchio, invece di togliere il telecine dove c'è, è portare |
| 2226 in telecine le parti che non lo sono e dopo invertire il telecine su tutto il | |
| 2227 video. Sembra incasinato? softpulldown è un filtro che prende tutto il video | |
| 2228 e lo porta in telecine. Se facciamo seguire a softpulldown | |
| 2229 <option>detc</option> oppure <option>ivtc</option>, il risultato finale sarà | |
| 2230 completamente progressivo. Serve <option>-ofps 24000/1001</option>. | |
| 25279 | 2231 <screen> |
| 2232 mencoder dvd://1 -oac copy -vf softpulldown,ivtc=1 -ovc lavc -ofps 24000/1001 | |
| 2233 </screen> | |
| 2234 </para></listitem> | |
| 2235 | |
| 2236 <listitem><para> | |
| 27851 | 2237 Non ho usato <option>-vf filmdint</option>, ma questa è l'opinione che ne ha |
| 2238 D Richard Felker III: | |
| 2239 | |
| 2240 <blockquote><para>E' OK, ma IMO cerca troppo spesso di deinterlacciare | |
| 2241 piuttosto che invertire il telecine (come molti lettori DVD da tavolo & | |
| 2242 televisioni progressive), il che porta orrendi sfarfallii e altri | |
| 2243 artefatti. Se vuoi utilizzarlo devi perlomeno spendere un po' di tempo ad | |
| 2244 impostare le opzioni e controllare i risultati prima di esser certo che non | |
| 2245 faccia danni. | |
| 25279 | 2246 </para></blockquote> |
| 2247 </para></listitem> | |
| 2248 </itemizedlist> | |
| 2249 </sect3> | |
| 2250 | |
| 2251 | |
| 2252 <sect3 id="menc-feat-telecine-encode-mixedpi"> | |
| 27851 | 2253 <title>Progressivo e interlacciato mescolati</title> |
| 2254 | |
| 2255 <para> | |
| 2256 Ci sono due opzioni per gestire questa categoria, ognuna delle quali è un | |
| 2257 compromesso. Dovresti decidere basandoti sulla lunghezza/durata di uno dei due | |
| 2258 tipi. | |
| 25279 | 2259 </para> |
| 2260 | |
| 2261 <itemizedlist> | |
| 2262 <listitem> | |
| 2263 <para> | |
| 27851 | 2264 Trattarlo come progressivo. Le parti interlacciate sembreranno interlacciate, |
| 2265 e alcuni dei campi interlacciati dovranno essere scartati, apportando un | |
| 2266 pelino di saltellamenti impari. Se vuoi puoi utilizzare un filtro di | |
| 2267 postelaborazione, ma potrebbe leggermente inficiare le parti progressive. | |
| 25279 | 2268 </para> |
| 2269 | |
| 2270 <para> | |
| 27851 | 2271 Questa opzione non sarebbe decisamente da usare se casomai ti interessi |
| 2272 riprodurre il video su un dispositivo interlacciato (con una sche da TV, per | |
| 2273 esempio). Se hai fotogrammi interlacciati in un video a 24000/1001 fotogrammi | |
| 2274 al secondo, verranno messi in telecine con i fotogrammi progressivi. | |
| 2275 Metà dei "fotogrammi" interlacciati saranno mostrati per la durata di tre | |
| 2276 campi (3/(60000/1001) secondi), risultando in un effetto alla "salto indietro | |
| 2277 nel tempo" che è bruttino. Se solo provi a far in questo modo, | |
| 2278 <emphasis role="bold">devi</emphasis> usare in filtro di deinterlacciamento | |
| 2279 come <option>lb</option> o <option>l5</option>. | |
| 25279 | 2280 </para> |
| 2281 | |
| 2282 <para> | |
| 27851 | 2283 Può anche essere una brutta idea per un display progressivo. Scarterà coppie |
| 2284 di campi interlacciati consecutivi, dando una discontinuità che si vede | |
| 2285 maggiormente con il secondo metodo, che mostra per due volte alcuni | |
| 2286 fotogrammi progressivi. Il video interlacciato a 30000/1001 fotogrammi per | |
| 2287 secondo è di suo un pochino zoppo dato che sarebbe da mostrare a 60000/1001 | |
| 2288 campi al secondo, quindi i fotogrammi duplicati non si notano così tanto. | |
| 25279 | 2289 </para> |
| 2290 | |
| 2291 <para> | |
| 27851 | 2292 In ogni modo è meglio tenere in considerazione il tuo contenuto e come |
| 2293 intendi riprodurlo. Se il tuo video è al 90% progressivo e non pensi di | |
| 2294 riprodurlo mai su una TV, dovresti propendere per l'approccio progressivo. | |
| 2295 Se è progressivo solo per metà, probabilmente ti converrà codificarlo come | |
| 2296 se fosse interlacciato. | |
| 25279 | 2297 </para> |
| 2298 </listitem> | |
| 2299 | |
| 2300 <listitem><para> | |
| 27851 | 2301 Trattarlo come interlacciato. Alcuni fotogrammi delle parti progressive |
| 2302 verranno duplicati, portando saltelli impari. Ancora, i filtri di | |
| 2303 deinterlacciamento potrebbero inficiare le parti progressive. | |
| 25279 | 2304 </para></listitem> |
| 2305 </itemizedlist> | |
| 2306 </sect3> | |
| 2307 </sect2> | |
| 2308 | |
| 2309 <!-- ********** --> | |
| 2310 | |
| 2311 <sect2 id="menc-feat-telecine-footnotes"> | |
| 27851 | 2312 <title>Note a pie' pagina</title> |
| 25279 | 2313 |
| 2314 <orderedlist> | |
| 2315 <listitem> | |
| 2316 <formalpara> | |
| 27851 | 2317 <title>Riguardo il taglio (crop):</title> |
| 25279 | 2318 <para> |
| 27851 | 2319 I dati video sui DVD sono memorizzati in un formato conosciuto come YUV 4:2:0. |
| 2320 In un video YUV, la luminosità ("luma") e il colore ("chroma") vengono | |
| 2321 salvati separatamente. Dato che l'occhio umano è in qualche modo meno | |
| 2322 sensibile al colore che alla luminosità, in un'immagine YUV 4:2:0 c'è solo | |
| 2323 un pixel chroma ogni quattro pixel luma. In un'immagine progressiva, ogni | |
| 2324 quadrato di quattro pixel luma (due per lato) ha in comune un pixel chroma. | |
| 2325 Devi prima ridimensionare lo YUV 4:2:0 progressivo a una risoluzione pari, e | |
| 2326 anche utilizzare lo scostamento. Per esempio, | |
| 2327 <option>crop=716:380:2:26</option> è OK ma | |
| 2328 <option>crop=716:380:3:26 </option> non lo è. | |
| 25279 | 2329 </para> |
| 2330 </formalpara> | |
| 2331 | |
| 2332 <para> | |
| 27851 | 2333 Quando gestisci YUV 4:2:0 interlacciato, la situazione è un pelo più |
| 2334 complessa. Invece di avere quattro pixel luma nel | |
| 2335 <emphasis>fotogramma</emphasis> che condividono un pixel chroma, quattro | |
| 2336 pixel in ogni <emphasis>campo</emphasis> condividono un pixel chroma. | |
| 2337 Quando i campi vengono interlacciati per formare un fotogramma, ogni | |
| 2338 "scanline" è alta un pixel. Ora, invece di avere tutti i quattro pixel luma | |
| 2339 in un quadrato, ci sono due pixel affiancati, e gli altri due pixel sono | |
| 2340 affiancati due scanline più sotto. I due pixel luma nella scanline di mezzo | |
| 2341 sono di un altro campo, e quindi condividono un pixel chroma differente con | |
| 2342 due pixel due scanline dopo. Tutta questa confusione rende necessario avere | |
| 2343 dimensione verticale pari e lo scostamento deve essere un multiplo di quattro. | |
| 2344 La dimensione orizzontale può rimanere dispari. | |
| 25279 | 2345 </para> |
| 2346 | |
| 2347 <para> | |
| 27851 | 2348 Per video in telecine, si consiglia di effettuare il taglio dopo l'inversione |
| 2349 del telecine. Una volta che il video è progressivo ti serve solo tagliare di | |
| 2350 numeri dispari. Se davvero vuoi ottenere il piccolo aumento di velocità che | |
| 2351 puoi avere tagliando prima, devi prima tagliare in verticale di multipli di | |
| 2352 quattro, altrimenti il filtro di telecine inverso non riceverà dati corretti. | |
| 25279 | 2353 </para> |
| 2354 | |
| 2355 <para> | |
| 27851 | 2356 Per video interlacciato (non in telecine), devi sempre tagliare |
| 2357 verticalmente di multipli di quattro a meno che tu non stia usando | |
| 2358 <option>-vf field</option> prima del taglio. | |
| 25279 | 2359 </para> |
| 2360 </listitem> | |
| 2361 | |
| 2362 <listitem><formalpara> | |
| 30939 | 2363 <title>Riguardo i parameti di codifica e la qualità:</title> |
| 25279 | 2364 <para> |
| 30939 | 2365 Il fatto che qui venga cosigliata <option>mbd=2</option> non significa che |
| 2366 non si debba usare altrimenti. Insieme con <option>trell</option>, | |
| 2367 <option>mbd=2</option> è una delle due opzioni di | |
| 2368 <systemitem class="library">libavcodec</systemitem> che ottimizzano al | |
| 2369 meglio la qualità e sarebbero sempre da utilizzare entrambe a meno che | |
| 2370 l'aumento della velocità di codifica sua proibitivo (ad es. per la codifica | |
| 2371 in tempo reale (realtime)). Ci sono molte altre opzioni di | |
| 2372 <systemitem class="library">libavcodec</systemitem> che aumentano la | |
| 2373 qualità (e rallentano la codifica), ma questo non è l'obiettivo di | |
| 2374 questa documentaziione. | |
| 25279 | 2375 </para> |
| 2376 </formalpara></listitem> | |
| 2377 | |
| 2378 <listitem><formalpara> | |
| 2379 <title>About the performance of pullup:</title> | |
| 2380 <para> | |
| 2381 It is safe to use <option>pullup</option> (along with <option>softskip | |
| 2382 </option>) on progressive video, and is usually a good idea unless | |
| 2383 the source has been definitively verified to be entirely progressive. | |
| 2384 The performace loss is small for most cases. On a bare-minimum encode, | |
| 2385 <option>pullup</option> causes <application>MEncoder</application> to | |
| 2386 be 50% slower. Adding sound processing and advanced <option>lavcopts | |
| 2387 </option> overshadows that difference, bringing the performance | |
| 2388 decrease of using <option>pullup</option> down to 2%. | |
| 2389 </para> | |
| 2390 </formalpara></listitem> | |
| 2391 </orderedlist> | |
| 2392 </sect2> | |
| 2393 </sect1> | |
| 2394 | |
| 2395 | |
| 2396 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
| 2397 | |
| 2398 | |
| 2399 <sect1 id="menc-feat-enc-libavcodec"> | |
| 2400 <title>Encoding with the <systemitem class="library">libavcodec</systemitem> | |
| 2401 codec family</title> | |
| 2402 | |
| 2403 <para> | |
| 27831 | 2404 <systemitem class="library">libavcodec</systemitem> |
| 25279 | 2405 provides simple encoding to a lot of interesting video and audio formats. |
| 2406 You can encode to the following codecs (more or less up to date): | |
| 2407 </para> | |
| 2408 | |
| 2409 <!-- ********** --> | |
| 2410 | |
| 2411 <sect2 id="menc-feat-enc-libavcodec-video-codecs"> | |
| 2412 <title><systemitem class="library">libavcodec</systemitem>'s | |
| 2413 video codecs</title> | |
| 2414 | |
| 2415 <para> | |
| 2416 <informaltable frame="all"> | |
| 2417 <tgroup cols="2"> | |
| 2418 <thead> | |
| 2419 <row><entry>Video codec name</entry><entry>Description</entry></row> | |
| 2420 </thead> | |
| 2421 <tbody> | |
| 2422 <row> | |
| 2423 <entry>mjpeg</entry> | |
| 2424 <entry>Motion JPEG</entry> | |
| 2425 </row> | |
| 2426 <row> | |
| 2427 <entry>ljpeg</entry> | |
| 2428 <entry>lossless JPEG</entry> | |
| 2429 </row> | |
| 2430 <row> | |
| 2431 <entry>jpegls</entry> | |
| 2432 <entry>JPEG LS</entry> | |
| 2433 </row> | |
| 2434 <row> | |
| 2435 <entry>targa</entry> | |
| 2436 <entry>Targa image</entry> | |
| 2437 </row> | |
| 2438 <row> | |
| 2439 <entry>gif</entry> | |
| 2440 <entry>GIF image</entry> | |
| 2441 </row> | |
| 2442 <row> | |
| 2443 <entry>bmp</entry> | |
| 2444 <entry>BMP image</entry> | |
| 2445 </row> | |
| 2446 <row> | |
| 2447 <entry>png</entry> | |
| 2448 <entry>PNG image</entry> | |
| 2449 </row> | |
| 2450 <row> | |
| 2451 <entry>h261</entry> | |
| 2452 <entry>H.261</entry> | |
| 2453 </row> | |
| 2454 <row> | |
| 2455 <entry>h263</entry> | |
| 2456 <entry>H.263 </entry> | |
| 2457 </row> | |
| 2458 <row> | |
| 2459 <entry>h263p</entry> | |
| 2460 <entry>H.263+</entry> | |
| 2461 </row> | |
| 2462 <row> | |
| 2463 <entry>mpeg4</entry> | |
| 2464 <entry>ISO standard MPEG-4 (DivX, Xvid compatible)</entry> | |
| 2465 </row> | |
| 2466 <row> | |
| 2467 <entry>msmpeg4</entry> | |
| 2468 <entry>pre-standard MPEG-4 variant by MS, v3 (AKA DivX3)</entry> | |
| 2469 </row> | |
| 2470 <row> | |
| 2471 <entry>msmpeg4v2</entry> | |
| 2472 <entry>pre-standard MPEG-4 by MS, v2 (used in old ASF files)</entry> | |
| 2473 </row> | |
| 2474 <row> | |
| 2475 <entry>wmv1</entry> | |
| 2476 <entry>Windows Media Video, version 1 (AKA WMV7)</entry> | |
| 2477 </row> | |
| 2478 <row> | |
| 2479 <entry>wmv2</entry> | |
| 2480 <entry>Windows Media Video, version 2 (AKA WMV8)</entry> | |
| 2481 </row> | |
| 2482 <row> | |
| 2483 <entry>rv10</entry> | |
| 2484 <entry>RealVideo 1.0</entry> | |
| 2485 </row> | |
| 2486 <row> | |
| 2487 <entry>rv20</entry> | |
| 2488 <entry>RealVideo 2.0</entry> | |
| 2489 </row> | |
| 2490 <row> | |
| 2491 <entry>mpeg1video</entry> | |
| 2492 <entry>MPEG-1 video</entry> | |
| 2493 </row> | |
| 2494 <row> | |
| 2495 <entry>mpeg2video</entry> | |
| 2496 <entry>MPEG-2 video</entry> | |
| 2497 </row> | |
| 2498 <row> | |
| 2499 <entry>huffyuv</entry> | |
| 2500 <entry>lossless compression</entry> | |
| 2501 </row> | |
| 2502 <row> | |
| 2503 <entry>ffvhuff</entry> | |
| 2504 <entry>FFmpeg modified huffyuv lossless</entry> | |
| 2505 </row> | |
| 2506 <row> | |
| 2507 <entry>asv1</entry> | |
| 2508 <entry>ASUS Video v1</entry> | |
| 2509 </row> | |
| 2510 <row> | |
| 2511 <entry>asv2</entry> | |
| 2512 <entry>ASUS Video v2</entry> | |
| 2513 </row> | |
| 2514 <row> | |
| 2515 <entry>ffv1</entry> | |
| 2516 <entry>FFmpeg's lossless video codec</entry> | |
| 2517 </row> | |
| 2518 <row> | |
| 2519 <entry>svq1</entry> | |
| 2520 <entry>Sorenson video 1</entry> | |
| 2521 </row> | |
| 2522 <row> | |
| 2523 <entry>flv</entry> | |
| 2524 <entry>Sorenson H.263 used in Flash Video</entry> | |
| 2525 </row> | |
| 2526 <row> | |
| 2527 <entry>flashsv</entry> | |
| 2528 <entry>Flash Screen Video</entry> | |
| 2529 </row> | |
| 2530 <row> | |
| 2531 <entry>dvvideo</entry> | |
| 2532 <entry>Sony Digital Video</entry> | |
| 2533 </row> | |
| 2534 <row> | |
| 2535 <entry>snow</entry> | |
| 2536 <entry>FFmpeg's experimental wavelet-based codec</entry> | |
| 2537 </row> | |
| 2538 <row> | |
| 2539 <entry>zbmv</entry> | |
| 2540 <entry>Zip Blocks Motion Video</entry> | |
| 2541 </row> | |
| 2542 </tbody> | |
| 2543 </tgroup> | |
| 2544 </informaltable> | |
| 2545 | |
| 2546 The first column contains the codec names that should be passed after the | |
| 2547 <literal>vcodec</literal> config, | |
| 2548 like: <option>-lavcopts vcodec=msmpeg4</option> | |
| 2549 </para> | |
| 2550 | |
| 2551 <informalexample><para> | |
| 2552 An example with MJPEG compression: | |
| 2553 <screen> | |
| 2554 mencoder dvd://2 -o <replaceable>title2.avi</replaceable> -ovc lavc -lavcopts vcodec=mjpeg -oac copy | |
| 2555 </screen> | |
| 2556 </para></informalexample> | |
| 2557 </sect2> | |
| 2558 | |
| 2559 <!-- ********** --> | |
| 2560 | |
| 2561 <sect2 id="menc-feat-enc-libavcodec-audio-codecs"> | |
| 2562 <title><systemitem class="library">libavcodec</systemitem>'s | |
| 2563 audio codecs</title> | |
| 2564 | |
| 2565 <para> | |
| 2566 <informaltable frame="all"> | |
| 2567 <tgroup cols="2"> | |
| 2568 <thead> | |
| 2569 <row><entry>Audio codec name</entry><entry>Description</entry></row> | |
| 2570 </thead> | |
| 2571 <tbody> | |
| 2572 <row> | |
| 30939 | 2573 <entry>ac3</entry> |
| 2574 <entry>Dolby Digital (AC-3)</entry> | |
| 2575 </row> | |
| 2576 <row> | |
| 2577 <entry>adpcm_*</entry> | |
| 2578 <entry>Adaptive PCM formats - see supplementary table</entry> | |
| 2579 </row> | |
| 2580 <row> | |
| 2581 <entry>flac</entry> | |
| 2582 <entry>Free Lossless Audio Codec (FLAC)</entry> | |
| 2583 </row> | |
| 2584 <row> | |
| 2585 <entry>g726</entry> | |
| 2586 <entry>G.726 ADPCM</entry> | |
| 2587 </row> | |
| 2588 <row> | |
| 2589 <entry>libfaac</entry> | |
| 2590 <entry>Advanced Audio Coding (AAC) - using FAAC</entry> | |
| 25279 | 2591 </row> |
| 2592 <row> | |
| 30939 | 2593 <entry>libgsm</entry> |
| 2594 <entry>ETSI GSM 06.10 full rate</entry> | |
| 2595 </row> | |
| 2596 <row> | |
| 2597 <entry>libgsm_ms</entry> | |
| 2598 <entry>Microsoft GSM</entry> | |
| 25279 | 2599 </row> |
| 2600 <row> | |
| 30939 | 2601 <entry>libmp3lame</entry> |
| 2602 <entry>MPEG-1 audio layer 3 (MP3) - using LAME</entry> | |
| 2603 </row> | |
| 2604 <row> | |
| 2605 <entry>mp2</entry> | |
| 2606 <entry>MPEG-1 audio layer 2 (MP2)</entry> | |
| 2607 </row> | |
| 2608 <row> | |
| 2609 <entry>pcm_*</entry> | |
| 2610 <entry>PCM formats - see supplementary table</entry> | |
| 2611 </row> | |
| 2612 <row> | |
| 2613 <entry>roq_dpcm</entry> | |
| 2614 <entry>Id Software RoQ DPCM</entry> | |
| 25279 | 2615 </row> |
| 2616 <row> | |
| 2617 <entry>sonic</entry> | |
| 2618 <entry>experimental FFmpeg lossy codec</entry> | |
| 2619 </row> | |
| 2620 <row> | |
| 2621 <entry>sonicls</entry> | |
| 2622 <entry>experimental FFmpeg lossless codec</entry> | |
| 2623 </row> | |
| 2624 <row> | |
| 2625 <entry>vorbis</entry> | |
| 30939 | 2626 <entry>Vorbis</entry> |
| 25279 | 2627 </row> |
| 2628 <row> | |
| 2629 <entry>wmav1</entry> | |
| 30939 | 2630 <entry>Windows Media Audio v1</entry> |
| 25279 | 2631 </row> |
| 2632 <row> | |
| 2633 <entry>wmav2</entry> | |
| 30939 | 2634 <entry>Windows Media Audio v2</entry> |
| 25279 | 2635 </row> |
| 2636 </tbody> | |
| 2637 </tgroup> | |
| 2638 </informaltable> | |
| 2639 | |
| 2640 The first column contains the codec names that should be passed after the | |
| 2641 <literal>acodec</literal> option, like: <option>-lavcopts acodec=ac3</option> | |
| 2642 </para> | |
| 2643 | |
| 2644 <informalexample><para> | |
| 2645 An example with AC-3 compression: | |
| 2646 <screen> | |
| 2647 mencoder dvd://2 -o <replaceable>title2.avi</replaceable> -oac lavc -lavcopts acodec=ac3 -ovc copy | |
| 2648 </screen> | |
| 2649 </para></informalexample> | |
| 2650 | |
| 2651 <para> | |
| 2652 Contrary to <systemitem class="library">libavcodec</systemitem>'s video | |
| 2653 codecs, its audio codecs do not make a wise usage of the bits they are | |
| 2654 given as they lack some minimal psychoacoustic model (if at all) | |
| 2655 which most other codec implementations feature. | |
| 2656 However, note that all these audio codecs are very fast and work | |
| 2657 out-of-the-box everywhere <application>MEncoder</application> has been | |
| 2658 compiled with <systemitem class="library">libavcodec</systemitem> (which | |
| 2659 is the case most of time), and do not depend on external libraries. | |
| 2660 </para> | |
| 2661 </sect2> | |
| 2662 | |
| 2663 <!-- ********** --> | |
| 2664 | |
| 2665 <sect2 id="menc-feat-dvd-mpeg4-lavc-encoding-options"> | |
| 2666 <title>Encoding options of libavcodec</title> | |
| 2667 | |
| 2668 <para> | |
| 2669 Ideally, you would probably want to be able to just tell the encoder to switch | |
| 2670 into "high quality" mode and move on. | |
| 2671 That would probably be nice, but unfortunately hard to implement as different | |
| 2672 encoding options yield different quality results depending on the source | |
| 2673 material. That is because compression depends on the visual properties of the | |
| 2674 video in question. | |
| 2675 For example, anime and live action have very different properties and | |
| 2676 thus require different options to obtain optimum encoding. | |
| 2677 The good news is that some options should never be left out, like | |
| 2678 <option>mbd=2</option>, <option>trell</option>, and <option>v4mv</option>. | |
| 2679 See below for a detailed description of common encoding options. | |
| 2680 </para> | |
| 2681 | |
| 2682 <itemizedlist> | |
| 2683 <title>Options to adjust:</title> | |
| 2684 <listitem><para> | |
| 2685 <emphasis role="bold">vmax_b_frames</emphasis>: 1 or 2 is good, depending on | |
| 2686 the movie. | |
| 2687 Note that if you need to have your encode be decodable by DivX5, you | |
| 2688 need to activate closed GOP support, using | |
| 2689 <systemitem class="library">libavcodec</systemitem>'s <option>cgop</option> | |
| 2690 option, but you need to deactivate scene detection, which | |
| 2691 is not a good idea as it will hurt encode efficiency a bit. | |
| 2692 </para></listitem> | |
| 2693 <listitem><para> | |
| 2694 <emphasis role="bold">vb_strategy=1</emphasis>: helps in high-motion scenes. | |
| 2695 On some videos, vmax_b_frames may hurt quality, but vmax_b_frames=2 along | |
| 2696 with vb_strategy=1 helps. | |
| 2697 </para></listitem> | |
| 2698 <listitem><para> | |
| 2699 <emphasis role="bold">dia</emphasis>: motion search range. Bigger is better | |
| 2700 and slower. | |
| 2701 Negative values are a completely different scale. | |
| 2702 Good values are -1 for a fast encode, or 2-4 for slower. | |
| 2703 </para></listitem> | |
| 2704 <listitem><para> | |
| 2705 <emphasis role="bold">predia</emphasis>: motion search pre-pass. | |
| 2706 Not as important as dia. Good values are 1 (default) to 4. Requires preme=2 | |
| 2707 to really be useful. | |
| 2708 </para></listitem> | |
| 2709 <listitem><para> | |
| 2710 <emphasis role="bold">cmp, subcmp, precmp</emphasis>: Comparison function for | |
| 2711 motion estimation. | |
| 2712 Experiment with values of 0 (default), 2 (hadamard), 3 (dct), and 6 (rate | |
| 2713 distortion). | |
| 2714 0 is fastest, and sufficient for precmp. | |
| 2715 For cmp and subcmp, 2 is good for anime, and 3 is good for live action. | |
| 2716 6 may or may not be slightly better, but is slow. | |
| 2717 </para></listitem> | |
| 2718 <listitem><para> | |
| 2719 <emphasis role="bold">last_pred</emphasis>: Number of motion predictors to | |
| 2720 take from the previous frame. | |
| 2721 1-3 or so help at little speed cost. | |
| 2722 Higher values are slow for no extra gain. | |
| 2723 </para></listitem> | |
| 2724 <listitem><para> | |
| 2725 <emphasis role="bold">cbp, mv0</emphasis>: Controls the selection of | |
| 2726 macroblocks. Small speed cost for small quality gain. | |
| 2727 </para></listitem> | |
| 2728 <listitem><para> | |
| 2729 <emphasis role="bold">qprd</emphasis>: adaptive quantization based on the | |
| 2730 macroblock's complexity. | |
| 2731 May help or hurt depending on the video and other options. | |
| 2732 This can cause artifacts unless you set vqmax to some reasonably small value | |
| 2733 (6 is good, maybe as low as 4); vqmin=1 should also help. | |
| 2734 </para></listitem> | |
| 2735 <listitem><para> | |
| 2736 <emphasis role="bold">qns</emphasis>: very slow, especially when combined | |
| 2737 with qprd. | |
| 2738 This option will make the encoder minimize noise due to compression | |
| 2739 artifacts instead of making the encoded video strictly match the source. | |
| 2740 Do not use this unless you have already tweaked everything else as far as it | |
| 2741 will go and the results still are not good enough. | |
| 2742 </para></listitem> | |
| 2743 <listitem><para> | |
| 2744 <emphasis role="bold">vqcomp</emphasis>: Tweak ratecontrol. | |
| 2745 What values are good depends on the movie. | |
| 2746 You can safely leave this alone if you want. | |
| 2747 Reducing vqcomp puts more bits on low-complexity scenes, increasing it puts | |
| 2748 them on high-complexity scenes (default: 0.5, range: 0-1. recommended range: | |
| 2749 0.5-0.7). | |
| 2750 </para></listitem> | |
| 2751 <listitem><para> | |
| 2752 <emphasis role="bold">vlelim, vcelim</emphasis>: Sets the single coefficient | |
| 2753 elimination threshold for luminance and chroma planes. | |
| 2754 These are encoded separately in all MPEG-like algorithms. | |
| 2755 The idea behind these options is to use some good heuristics to determine | |
| 2756 when the change in a block is less than the threshold you specify, and in | |
| 2757 such a case, to just encode the block as "no change". | |
| 2758 This saves bits and perhaps speeds up encoding. vlelim=-4 and vcelim=9 | |
| 2759 seem to be good for live movies, but seem not to help with anime; | |
| 2760 when encoding animation, you should probably leave them unchanged. | |
| 2761 </para></listitem> | |
| 2762 <listitem><para> | |
| 2763 <emphasis role="bold">qpel</emphasis>: Quarter pixel motion estimation. | |
| 2764 MPEG-4 uses half pixel precision for its motion search by default, | |
| 2765 therefore this option comes with an overhead as more information will be | |
| 2766 stored in the encoded file. | |
| 2767 The compression gain/loss depends on the movie, but it is usually not very | |
| 2768 effective on anime. | |
| 2769 qpel always incurs a significant cost in CPU decode time (+25% in | |
| 2770 practice). | |
| 2771 </para></listitem> | |
| 2772 <listitem><para> | |
| 2773 <emphasis role="bold">psnr</emphasis>: does not affect the actual encoding, | |
| 2774 but writes a log file giving the type/size/quality of each frame, and | |
| 2775 prints a summary of PSNR (Peak Signal to Noise Ratio) at the end. | |
| 2776 </para></listitem> | |
| 2777 </itemizedlist> | |
| 2778 | |
| 2779 <itemizedlist> | |
| 2780 <title>Options not recommended to play with:</title> | |
| 2781 <listitem><para> | |
| 2782 <emphasis role="bold">vme</emphasis>: The default is best. | |
| 2783 </para></listitem> | |
| 2784 <listitem><para> | |
| 2785 <emphasis role="bold">lumi_mask, dark_mask</emphasis>: Psychovisual adaptive | |
| 2786 quantization. | |
| 2787 You do not want to play with those options if you care about quality. | |
| 2788 Reasonable values may be effective in your case, but be warned this is very | |
| 2789 subjective. | |
| 2790 </para></listitem> | |
| 2791 <listitem><para> | |
| 2792 <emphasis role="bold">scplx_mask</emphasis>: Tries to prevent blocky | |
| 2793 artifacts, but postprocessing is better. | |
| 2794 </para></listitem> | |
| 2795 </itemizedlist> | |
| 2796 </sect2> | |
| 2797 | |
| 2798 <!-- ********** --> | |
| 2799 | |
| 2800 <sect2 id="menc-feat-mpeg4-lavc-example-settings"> | |
| 2801 <title>Encoding setting examples</title> | |
| 2802 | |
| 2803 <para> | |
| 2804 The following settings are examples of different encoding | |
| 2805 option combinations that affect the speed vs quality tradeoff | |
| 2806 at the same target bitrate. | |
| 2807 </para> | |
| 2808 | |
| 2809 <para> | |
| 2810 All the encoding settings were tested on a 720x448 @30000/1001 fps | |
| 2811 video sample, the target bitrate was 900kbps, and the machine was an | |
| 2812 AMD-64 3400+ at 2400 MHz in 64 bits mode. | |
| 2813 Each encoding setting features the measured encoding speed (in | |
| 2814 frames per second) and the PSNR loss (in dB) compared to the "very | |
| 2815 high quality" setting. | |
| 2816 Please understand that depending on your source, your machine type | |
| 2817 and development advancements, you may get very different results. | |
| 2818 </para> | |
| 2819 | |
| 2820 <para> | |
| 2821 <informaltable frame="all"> | |
| 2822 <tgroup cols="4"> | |
| 2823 <thead> | |
| 2824 <row> | |
| 2825 <entry>Description</entry> | |
| 2826 <entry>Encoding options</entry> | |
| 2827 <entry>speed (in fps)</entry> | |
| 2828 <entry>Relative PSNR loss (in dB)</entry> | |
| 2829 </row> | |
| 2830 </thead> | |
| 2831 <tbody> | |
| 2832 <row> | |
| 2833 <entry>Very high quality</entry> | |
| 2834 <entry><option>vcodec=mpeg4:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:vmax_b_frames=2:vb_strategy=1:precmp=2:cmp=2:subcmp=2:preme=2:qns=2</option></entry> | |
| 2835 <entry>6fps</entry> | |
| 2836 <entry>0dB</entry> | |
| 2837 </row> | |
| 2838 <row> | |
| 2839 <entry>High quality</entry> | |
| 2840 <entry><option>vcodec=mpeg4:mbd=2:trell:v4mv:last_pred=2:dia=-1:vmax_b_frames=2:vb_strategy=1:cmp=3:subcmp=3:precmp=0:vqcomp=0.6:turbo</option></entry> | |
| 2841 <entry>15fps</entry> | |
| 2842 <entry>-0.5dB</entry> | |
| 2843 </row> | |
| 2844 <row> | |
| 2845 <entry>Fast</entry> | |
| 2846 <entry><option>vcodec=mpeg4:mbd=2:trell:v4mv:turbo</option></entry> | |
| 2847 <entry>42fps</entry> | |
| 2848 <entry>-0.74dB</entry> | |
| 2849 </row> | |
| 2850 <row> | |
| 2851 <entry>Realtime</entry> | |
| 2852 <entry><option>vcodec=mpeg4:mbd=2:turbo</option></entry> | |
| 2853 <entry>54fps</entry> | |
| 2854 <entry>-1.21dB</entry> | |
| 2855 </row> | |
| 2856 </tbody> | |
| 2857 </tgroup> | |
| 2858 </informaltable> | |
| 2859 </para> | |
| 2860 </sect2> | |
| 2861 | |
| 2862 <!-- ********** --> | |
| 2863 | |
| 2864 <sect2 id="custommatrices"> | |
| 2865 <title>Custom inter/intra matrices</title> | |
| 2866 | |
| 2867 <para> | |
| 2868 With this feature of | |
| 27831 | 2869 <systemitem class="library">libavcodec</systemitem> |
| 25279 | 2870 you are able to set custom inter (I-frames/keyframes) and intra |
| 2871 (P-frames/predicted frames) matrices. It is supported by many of the codecs: | |
| 2872 <systemitem>mpeg1video</systemitem> and <systemitem>mpeg2video</systemitem> | |
| 2873 are reported as working. | |
| 2874 </para> | |
| 2875 | |
| 2876 <para> | |
| 2877 A typical usage of this feature is to set the matrices preferred by the | |
| 2878 <ulink url="http://www.kvcd.net/">KVCD</ulink> specifications. | |
| 2879 </para> | |
| 2880 | |
| 2881 <para> | |
| 2882 The <emphasis role="bold">KVCD "Notch" Quantization Matrix:</emphasis> | |
| 2883 </para> | |
| 2884 | |
| 2885 <para> | |
| 2886 Intra: | |
| 2887 <screen> | |
| 2888 8 9 12 22 26 27 29 34 | |
| 2889 9 10 14 26 27 29 34 37 | |
| 2890 12 14 18 27 29 34 37 38 | |
| 2891 22 26 27 31 36 37 38 40 | |
| 2892 26 27 29 36 39 38 40 48 | |
| 2893 27 29 34 37 38 40 48 58 | |
| 2894 29 34 37 38 40 48 58 69 | |
| 2895 34 37 38 40 48 58 69 79 | |
| 2896 </screen> | |
| 2897 | |
| 2898 Inter: | |
| 2899 <screen> | |
| 2900 16 18 20 22 24 26 28 30 | |
| 2901 18 20 22 24 26 28 30 32 | |
| 2902 20 22 24 26 28 30 32 34 | |
| 2903 22 24 26 30 32 32 34 36 | |
| 2904 24 26 28 32 34 34 36 38 | |
| 2905 26 28 30 32 34 36 38 40 | |
| 2906 28 30 32 34 36 38 42 42 | |
| 2907 30 32 34 36 38 40 42 44 | |
| 2908 </screen> | |
| 2909 </para> | |
| 2910 | |
| 2911 <para> | |
| 2912 Usage: | |
| 2913 <screen> | |
| 2914 mencoder <replaceable>input.avi</replaceable> -o <replaceable>output.avi</replaceable> -oac copy -ovc lavc \ | |
| 2915 -lavcopts inter_matrix=...:intra_matrix=... | |
| 2916 </screen> | |
| 2917 </para> | |
| 2918 | |
| 2919 <para> | |
| 2920 <screen> | |
| 2921 mencoder <replaceable>input.avi</replaceable> -ovc lavc -lavcopts \ | |
| 2922 vcodec=mpeg2video:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,\ | |
| 2923 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,\ | |
| 2924 29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79\ | |
| 2925 :inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,\ | |
| 2926 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,\ | |
| 2927 36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44 -oac copy -o svcd.mpg | |
| 2928 </screen> | |
| 2929 </para> | |
| 2930 </sect2> | |
| 2931 | |
| 2932 <!-- ********** --> | |
| 2933 | |
| 2934 <sect2 id="menc-feat-dvd-mpeg4-example"> | |
| 2935 <title>Example</title> | |
| 2936 | |
| 2937 <para> | |
| 2938 So, you have just bought your shiny new copy of Harry Potter and the Chamber | |
| 2939 of Secrets (widescreen edition, of course), and you want to rip this DVD | |
| 2940 so that you can add it to your Home Theatre PC. This is a region 1 DVD, | |
| 2941 so it is NTSC. The example below will still apply to PAL, except you will | |
| 2942 omit <option>-ofps 24000/1001</option> (because the output framerate is the | |
| 2943 same as the input framerate), and of course the crop dimensions will be | |
| 2944 different. | |
| 2945 </para> | |
| 2946 | |
| 2947 <para> | |
| 2948 After running <option>mplayer dvd://1</option>, we follow the process | |
| 2949 detailed in the section <link linkend="menc-feat-telecine">How to deal | |
| 2950 with telecine and interlacing in NTSC DVDs</link> and discover that it is | |
| 2951 24000/1001 fps progressive video, which means that we need not use an inverse | |
| 2952 telecine filter, such as <option>pullup</option> or | |
| 2953 <option>filmdint</option>. | |
| 2954 </para> | |
| 2955 | |
| 2956 <para id="menc-feat-dvd-mpeg4-example-crop"> | |
| 2957 Next, we want to determine the appropriate crop rectangle, so we use the | |
| 2958 cropdetect filter: | |
| 2959 <screen>mplayer dvd://1 -vf cropdetect</screen> | |
| 2960 Make sure you seek to a fully filled frame (such as a bright scene, | |
| 2961 past the opening credits and logos), and | |
| 2962 you will see in <application>MPlayer</application>'s console output: | |
| 2963 <screen>crop area: X: 0..719 Y: 57..419 (-vf crop=720:362:0:58)</screen> | |
| 2964 We then play the movie back with this filter to test its correctness: | |
| 2965 <screen>mplayer dvd://1 -vf crop=720:362:0:58</screen> | |
| 2966 And we see that it looks perfectly fine. Next, we ensure the width and | |
| 2967 height are a multiple of 16. The width is fine, however the height is | |
| 2968 not. Since we did not fail 7th grade math, we know that the nearest | |
| 2969 multiple of 16 lower than 362 is 352. | |
| 2970 </para> | |
| 2971 | |
| 2972 <para> | |
| 2973 We could just use <option>crop=720:352:0:58</option>, but it would be nice | |
| 2974 to take a little off the top and a little off the bottom so that we | |
| 2975 retain the center. We have shrunk the height by 10 pixels, but we do not | |
| 2976 want to increase the y-offset by 5-pixels since that is an odd number and | |
| 2977 will adversely affect quality. Instead, we will increase the y-offset by | |
| 2978 4 pixels: | |
| 2979 <screen>mplayer dvd://1 -vf crop=720:352:0:62</screen> | |
| 2980 Another reason to shave pixels from both the top and the bottom is that we | |
| 2981 ensure we have eliminated any half-black pixels if they exist. Note that if | |
| 2982 your video is telecined, make sure the <option>pullup</option> filter (or | |
| 2983 whichever inverse telecine filter you decide to use) appears in the filter | |
| 2984 chain before you crop. If it is interlaced, deinterlace before cropping. | |
| 2985 (If you choose to preserve the interlaced video, then make sure your | |
| 2986 vertical crop offset is a multiple of 4.) | |
| 2987 </para> | |
| 2988 | |
| 2989 <para> | |
| 2990 If you are really concerned about losing those 10 pixels, you might | |
| 2991 prefer instead to scale the dimensions down to the nearest multiple of 16. | |
| 2992 The filter chain would look like: | |
| 2993 <screen>-vf crop=720:362:0:58,scale=720:352</screen> | |
| 2994 Scaling the video down like this will mean that some small amount of | |
| 2995 detail is lost, though it probably will not be perceptible. Scaling up will | |
| 2996 result in lower quality (unless you increase the bitrate). Cropping | |
| 2997 discards those pixels altogether. It is a tradeoff that you will want to | |
| 2998 consider for each circumstance. For example, if the DVD video was made | |
| 2999 for television, you might want to avoid vertical scaling, since the line | |
| 3000 sampling corresponds to the way the content was originally recorded. | |
| 3001 </para> | |
| 3002 | |
| 3003 <para> | |
| 3004 On inspection, we see that our movie has a fair bit of action and high | |
| 3005 amounts of detail, so we pick 2400Kbit for our bitrate. | |
| 3006 </para> | |
| 3007 | |
| 3008 <para> | |
| 3009 We are now ready to do the two pass encode. Pass one: | |
| 3010 <screen> | |
| 3011 mencoder dvd://1 -ofps 24000/1001 -oac copy -o <replaceable>Harry_Potter_2.avi</replaceable> -ovc lavc \ | |
| 3012 -lavcopts vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:autoaspect:vpass=1 \ | |
| 3013 -vf pullup,softskip,crop=720:352:0:62,hqdn3d=2:1:2 | |
| 3014 </screen> | |
| 3015 And pass two is the same, except that we specify <option>vpass=2</option>: | |
| 3016 <screen> | |
| 3017 mencoder dvd://1 -ofps 24000/1001 -oac copy -o <replaceable>Harry_Potter_2.avi</replaceable> -ovc lavc \ | |
| 3018 -lavcopts vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:autoaspect:vpass=2 \ | |
| 3019 -vf pullup,softskip,crop=720:352:0:62,hqdn3d=2:1:2 | |
| 3020 </screen> | |
| 3021 </para> | |
| 3022 | |
| 3023 <para> | |
| 3024 The options <option>v4mv:mbd=2:trell</option> will greatly increase the | |
| 3025 quality at the expense of encoding time. There is little reason to leave | |
| 3026 these options out when the primary goal is quality. The options | |
| 3027 <option>cmp=3:subcmp=3</option> select a comparison function that | |
| 3028 yields higher quality than the defaults. You might try experimenting with | |
| 3029 this parameter (refer to the man page for the possible values) as | |
| 3030 different functions can have a large impact on quality depending on the | |
| 3031 source material. For example, if you find | |
| 3032 <systemitem class="library">libavcodec</systemitem> produces too much | |
| 3033 blocky artifacting, you could try selecting the experimental NSSE as | |
| 3034 comparison function via <option>*cmp=10</option>. | |
| 3035 </para> | |
| 3036 | |
| 3037 <para> | |
| 3038 For this movie, the resulting AVI will be 138 minutes long and nearly | |
| 3039 3GB. And because you said that file size does not matter, this is a | |
| 3040 perfectly acceptable size. However, if you had wanted it smaller, you | |
| 3041 could try a lower bitrate. Increasing bitrates have diminishing | |
| 3042 returns, so while we might clearly see an improvement from 1800Kbit to | |
| 3043 2000Kbit, it might not be so noticeable above 2000Kbit. Feel | |
| 3044 free to experiment until you are happy. | |
| 3045 </para> | |
| 3046 | |
| 3047 <para> | |
| 3048 Because we passed the source video through a denoise filter, you may want | |
| 3049 to add some of it back during playback. This, along with the | |
| 3050 <option>spp</option> post-processing filter, drastically improves the | |
| 3051 perception of quality and helps eliminate blocky artifacts in the video. | |
| 3052 With <application>MPlayer</application>'s <option>autoq</option> option, | |
| 3053 you can vary the amount of post-processing done by the spp filter | |
| 3054 depending on available CPU. Also, at this point, you may want to apply | |
| 3055 gamma and/or color correction to best suit your display. For example: | |
| 3056 <screen> | |
| 3057 mplayer <replaceable>Harry_Potter_2.avi</replaceable> -vf spp,noise=9ah:5ah,eq2=1.2 -autoq 3 | |
| 3058 </screen> | |
| 3059 </para> | |
| 3060 </sect2> | |
| 3061 </sect1> | |
| 3062 | |
| 3063 | |
| 3064 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
| 3065 | |
| 3066 | |
| 3067 <sect1 id="menc-feat-xvid"> | |
| 3068 <title>Encoding with the <systemitem class="library">Xvid</systemitem> | |
| 3069 codec</title> | |
| 3070 | |
| 3071 <para> | |
| 3072 <systemitem class="library">Xvid</systemitem> is a free library for | |
| 3073 encoding MPEG-4 ASP video streams. | |
| 3074 Before starting to encode, you need to <link linkend="xvid"> | |
| 3075 set up <application>MEncoder</application> to support it</link>. | |
| 3076 </para> | |
| 3077 | |
| 3078 <para> | |
| 3079 This guide mainly aims at featuring the same kind of information | |
| 3080 as x264's encoding guide. | |
| 3081 Therefore, please begin by reading | |
| 3082 <link linkend="menc-feat-x264-encoding-options-intro">the first part</link> | |
| 3083 of that guide. | |
| 3084 </para> | |
| 3085 | |
| 3086 <!-- ********** --> | |
| 3087 | |
| 3088 <sect2 id="menc-feat-xvid-intro"> | |
| 3089 <title>What options should I use to get the best results?</title> | |
| 3090 | |
| 3091 <para> | |
| 3092 Please begin by reviewing the | |
| 3093 <systemitem class="library">Xvid</systemitem> section of | |
| 3094 <application>MPlayer</application>'s man page. | |
| 3095 This section is intended to be a supplement to the man page. | |
| 3096 </para> | |
| 3097 | |
| 3098 <para> | |
| 3099 The Xvid default settings are already a good tradeoff between | |
| 3100 speed and quality, therefore you can safely stick to them if | |
| 3101 the following section puzzles you. | |
| 3102 </para> | |
| 3103 </sect2> | |
| 3104 | |
| 3105 <!-- ********** --> | |
| 3106 | |
| 3107 <sect2 id="menc-feat-xvid-encoding-options"> | |
| 3108 <title>Encoding options of <systemitem class="library">Xvid</systemitem></title> | |
| 3109 | |
| 3110 <itemizedlist> | |
| 3111 <listitem><para> | |
| 3112 <emphasis role="bold">vhq</emphasis> | |
| 3113 This setting affects the macroblock decision algorithm, where the | |
| 3114 higher the setting, the wiser the decision. | |
| 3115 The default setting may be safely used for every encode, while | |
| 3116 higher settings always help PSNR but are significantly slower. | |
| 3117 Please note that a better PSNR does not necessarily mean | |
| 3118 that the picture will look better, but tells you that it is | |
| 3119 closer to the original. | |
| 3120 Turning it off will noticeably speed up encoding; if speed is | |
| 3121 critical for you, the tradeoff may be worth it. | |
| 3122 </para></listitem> | |
| 3123 <listitem><para> | |
| 3124 <emphasis role="bold">bvhq</emphasis> | |
| 3125 This does the same job as vhq, but does it on B-frames. | |
| 3126 It has a negligible impact on speed, and slightly improves quality | |
| 3127 (around +0.1dB PSNR). | |
| 3128 </para></listitem> | |
| 3129 <listitem><para> | |
| 3130 <emphasis role="bold">max_bframes</emphasis> | |
| 3131 A higher number of consecutive allowed B-frames usually improves | |
| 3132 compressibility, although it may also lead to more blocking artifacts. | |
| 3133 The default setting is a good tradeoff between compressibility and | |
| 3134 quality, but you may increase it up to 3 if you are bitrate-starved. | |
| 3135 You may also decrease it to 1 or 0 if you are aiming at perfect | |
| 3136 quality, though in that case you should make sure your | |
| 3137 target bitrate is high enough to ensure that the encoder does not | |
| 3138 have to increase quantizers to reach it. | |
| 3139 </para></listitem> | |
| 3140 <listitem><para> | |
| 3141 <emphasis role="bold">bf_threshold</emphasis> | |
| 3142 This controls the B-frame sensitivity of the encoder, where a higher | |
| 3143 value leads to more B-frames being used (and vice versa). | |
| 3144 This setting is to be used together with <option>max_bframes</option>; | |
| 3145 if you are bitrate-starved, you should increase both | |
| 3146 <option>max_bframes</option> and <option>bf_threshold</option>, | |
| 3147 while you may increase <option>max_bframes</option> and reduce | |
| 3148 <option>bf_threshold</option> so that the encoder may use more | |
| 3149 B-frames in places that only <emphasis role="bold">really</emphasis> | |
| 3150 need them. | |
| 3151 A low number of <option>max_bframes</option> and a high value of | |
| 3152 <option>bf_threshold</option> is probably not a wise choice as it | |
| 3153 will force the encoder to put B-frames in places that would not | |
| 3154 benefit from them, therefore reducing visual quality. | |
| 3155 However, if you need to be compatible with standalone players that | |
| 3156 only support old DivX profiles (which only supports up to 1 | |
| 3157 consecutive B-frame), this would be your only way to | |
| 3158 increase compressibility through using B-frames. | |
| 3159 </para></listitem> | |
| 3160 <listitem><para> | |
| 3161 <emphasis role="bold">trellis</emphasis> | |
| 3162 Optimizes the quantization process to get an optimal tradeoff | |
| 3163 between PSNR and bitrate, which allows significant bit saving. | |
| 3164 These bits will in return be spent elsewhere on the video, | |
| 3165 raising overall visual quality. | |
| 3166 You should always leave it on as its impact on quality is huge. | |
| 3167 Even if you are looking for speed, do not disable it until you | |
| 3168 have turned down <option>vhq</option> and all other more | |
| 3169 CPU-hungry options to the minimum. | |
| 3170 </para></listitem> | |
| 3171 <listitem><para> | |
| 3172 <emphasis role="bold">hq_ac</emphasis> | |
| 3173 Activates a better coefficient cost estimation method, which slightly | |
| 3174 reduces filesize by around 0.15 to 0.19% (which corresponds to less | |
| 3175 than 0.01dB PSNR increase), while having a negligible impact on speed. | |
| 3176 It is therefore recommended to always leave it on. | |
| 3177 </para></listitem> | |
| 3178 <listitem><para> | |
| 3179 <emphasis role="bold">cartoon</emphasis> | |
| 3180 Designed to better encode cartoon content, and has no impact on | |
| 3181 speed as it just tunes the mode decision heuristics for this type | |
| 3182 of content. | |
| 3183 </para></listitem> | |
| 3184 <listitem> | |
| 3185 <para> | |
| 3186 <emphasis role="bold">me_quality</emphasis> | |
| 3187 This setting is to control the precision of the motion estimation. | |
| 3188 The higher <option>me_quality</option>, the more | |
| 3189 precise the estimation of the original motion will be, and the | |
| 3190 better the resulting clip will capture the original motion. | |
| 3191 </para> | |
| 3192 <para> | |
| 3193 The default setting is best in all cases; | |
| 3194 thus it is not recommended to turn it down unless you are | |
| 3195 really looking for speed, as all the bits saved by a good motion | |
| 3196 estimation would be spent elsewhere, raising overall quality. | |
| 3197 Therefore, do not go any lower than 5, and even that only as a last | |
| 3198 resort. | |
| 3199 </para> | |
| 3200 </listitem> | |
| 3201 <listitem><para> | |
| 3202 <emphasis role="bold">chroma_me</emphasis> | |
| 3203 Improves motion estimation by also taking the chroma (color) | |
| 3204 information into account, whereas <option>me_quality</option> | |
| 3205 alone only uses luma (grayscale). | |
| 3206 This slows down encoding by 5-10% but improves visual quality | |
| 3207 quite a bit by reducing blocking effects and reduces filesize by | |
| 3208 around 1.3%. | |
| 3209 If you are looking for speed, you should disable this option before | |
| 3210 starting to consider reducing <option>me_quality</option>. | |
| 3211 </para></listitem> | |
| 3212 <listitem><para> | |
| 3213 <emphasis role="bold">chroma_opt</emphasis> | |
| 3214 Is intended to increase chroma image quality around pure | |
| 3215 white/black edges, rather than improving compression. | |
| 3216 This can help to reduce the "red stairs" effect. | |
| 3217 </para></listitem> | |
| 3218 <listitem><para> | |
| 3219 <emphasis role="bold">lumi_mask</emphasis> | |
| 3220 Tries to give less bitrate to part of the picture that the | |
| 3221 human eye cannot see very well, which should allow the encoder | |
| 3222 to spend the saved bits on more important parts of the picture. | |
| 3223 The quality of the encode yielded by this option highly depends | |
| 3224 on personal preferences and on the type and monitor settings | |
| 3225 used to watch it (typically, it will not look as good if it is | |
| 3226 bright or if it is a TFT monitor). | |
| 3227 </para></listitem> | |
| 3228 <listitem> | |
| 3229 <para> | |
| 3230 <emphasis role="bold">qpel</emphasis> | |
| 3231 Raise the number of candidate motion vectors by increasing | |
| 3232 the precision of the motion estimation from halfpel to | |
| 3233 quarterpel. | |
| 3234 The idea is to find better motion vectors which will in return | |
| 3235 reduce bitrate (hence increasing quality). | |
| 3236 However, motion vectors with quarterpel precision require a | |
| 3237 few extra bits to code, but the candidate vectors do not always | |
| 3238 give (much) better results. | |
| 3239 Quite often, the codec still spends bits on the extra precision, | |
| 3240 but little or no extra quality is gained in return. | |
| 3241 Unfortunately, there is no way to foresee the possible gains of | |
| 3242 <option>qpel</option>, so you need to actually encode with and | |
| 3243 without it to know for sure. | |
| 3244 </para> | |
| 3245 <para> | |
| 3246 <option>qpel</option> can be almost double encoding time, and | |
| 3247 requires as much as 25% more processing power to decode. | |
| 3248 It is not supported by all standalone players. | |
| 3249 </para> | |
| 3250 </listitem> | |
| 3251 <listitem><para> | |
| 3252 <emphasis role="bold">gmc</emphasis> | |
| 3253 Tries to save bits on panning scenes by using a single motion | |
| 3254 vector for the whole frame. | |
| 3255 This almost always raises PSNR, but significantly slows down | |
| 3256 encoding (as well as decoding). | |
| 3257 Therefore, you should only use it when you have turned | |
| 3258 <option>vhq</option> to the maximum. | |
| 3259 <systemitem class="library">Xvid</systemitem>'s GMC is more | |
| 3260 sophisticated than DivX's, but is only supported by few | |
| 3261 standalone players. | |
| 3262 </para></listitem> | |
| 3263 </itemizedlist> | |
| 3264 </sect2> | |
| 3265 | |
| 3266 <!-- ********** --> | |
| 3267 | |
| 3268 <sect2 id="menc-feat-xvid-encoding-profiles"> | |
| 3269 <title>Encoding profiles</title> | |
| 3270 | |
| 3271 <para> | |
| 3272 Xvid supports encoding profiles through the <option>profile</option> option, | |
| 3273 which are used to impose restrictions on the properties of the Xvid video | |
| 3274 stream such that it will be playable on anything which supports the | |
| 3275 chosen profile. | |
| 3276 The restrictions relate to resolutions, bitrates and certain MPEG-4 | |
| 3277 features. | |
| 3278 The following table shows what each profile supports. | |
| 3279 </para> | |
| 3280 | |
| 3281 <informaltable> | |
| 3282 <tgroup cols="16" align="center"> | |
| 3283 <colspec colnum="1" colname="col1"/> | |
| 3284 <colspec colnum="2" colname="col2"/> | |
| 3285 <colspec colnum="3" colname="col3"/> | |
| 3286 <colspec colnum="4" colname="col4"/> | |
| 3287 <colspec colnum="5" colname="col5"/> | |
| 3288 <colspec colnum="6" colname="col6"/> | |
| 3289 <colspec colnum="7" colname="col7"/> | |
| 3290 <colspec colnum="8" colname="col8"/> | |
| 3291 <colspec colnum="9" colname="col9"/> | |
| 3292 <colspec colnum="10" colname="col10"/> | |
| 3293 <colspec colnum="11" colname="col11"/> | |
| 3294 <colspec colnum="12" colname="col12"/> | |
| 3295 <colspec colnum="13" colname="col13"/> | |
| 3296 <colspec colnum="14" colname="col14"/> | |
| 3297 <colspec colnum="15" colname="col15"/> | |
| 3298 <colspec colnum="16" colname="col16"/> | |
| 3299 <colspec colnum="17" colname="col17"/> | |
| 3300 <spanspec spanname="spa2-5" namest="col2" nameend="col5"/> | |
| 3301 <spanspec spanname="spa6-11" namest="col6" nameend="col11"/> | |
| 3302 <spanspec spanname="spa12-17" namest="col12" nameend="col17"/> | |
| 3303 <tbody> | |
| 3304 <row> | |
| 3305 <entry></entry> | |
| 3306 <entry spanname="spa2-5">Simple</entry> | |
| 3307 <entry spanname="spa6-11">Advanced Simple</entry> | |
| 3308 <entry spanname="spa12-17">DivX</entry> | |
| 3309 </row> | |
| 3310 <row> | |
| 3311 <entry>Profile name</entry> | |
| 3312 <entry>0</entry> | |
| 3313 <entry>1</entry> | |
| 3314 <entry>2</entry> | |
| 3315 <entry>3</entry> | |
| 3316 <entry>0</entry> | |
| 3317 <entry>1</entry> | |
| 3318 <entry>2</entry> | |
| 3319 <entry>3</entry> | |
| 3320 <entry>4</entry> | |
| 3321 <entry>5</entry> | |
| 3322 <entry>Handheld</entry> | |
| 3323 <entry>Portable NTSC</entry> | |
| 3324 <entry>Portable PAL</entry> | |
| 3325 <entry>Home Theater NTSC</entry> | |
| 3326 <entry>Home Theater PAL</entry> | |
| 3327 <entry>HDTV</entry> | |
| 3328 </row> | |
| 3329 <row> | |
| 3330 <entry>Width [pixels]</entry> | |
| 3331 <entry>176</entry> | |
| 3332 <entry>176</entry> | |
| 3333 <entry>352</entry> | |
| 3334 <entry>352</entry> | |
| 3335 <entry>176</entry> | |
| 3336 <entry>176</entry> | |
| 3337 <entry>352</entry> | |
| 3338 <entry>352</entry> | |
| 3339 <entry>352</entry> | |
| 3340 <entry>720</entry> | |
| 3341 <entry>176</entry> | |
| 3342 <entry>352</entry> | |
| 3343 <entry>352</entry> | |
| 3344 <entry>720</entry> | |
| 3345 <entry>720</entry> | |
| 3346 <entry>1280</entry> | |
| 3347 </row> | |
| 3348 <row> | |
| 3349 <entry>Height [pixels]</entry> | |
| 3350 <entry>144</entry> | |
| 3351 <entry>144</entry> | |
| 3352 <entry>288</entry> | |
| 3353 <entry>288</entry> | |
| 3354 <entry>144</entry> | |
| 3355 <entry>144</entry> | |
| 3356 <entry>288</entry> | |
| 3357 <entry>288</entry> | |
| 3358 <entry>576</entry> | |
| 3359 <entry>576</entry> | |
| 3360 <entry>144</entry> | |
| 3361 <entry>240</entry> | |
| 3362 <entry>288</entry> | |
| 3363 <entry>480</entry> | |
| 3364 <entry>576</entry> | |
| 3365 <entry>720</entry> | |
| 3366 </row> | |
| 3367 <row> | |
| 3368 <entry>Frame rate [fps]</entry> | |
| 3369 <entry>15</entry> | |
| 3370 <entry>15</entry> | |
| 3371 <entry>15</entry> | |
| 3372 <entry>15</entry> | |
| 3373 <entry>30</entry> | |
| 3374 <entry>30</entry> | |
| 3375 <entry>15</entry> | |
| 3376 <entry>30</entry> | |
| 3377 <entry>30</entry> | |
| 3378 <entry>30</entry> | |
| 3379 <entry>15</entry> | |
| 3380 <entry>30</entry> | |
| 3381 <entry>25</entry> | |
| 3382 <entry>30</entry> | |
| 3383 <entry>25</entry> | |
| 3384 <entry>30</entry> | |
| 3385 </row> | |
| 3386 <row> | |
| 3387 <entry>Max average bitrate [kbps]</entry> | |
| 3388 <entry>64</entry> | |
| 3389 <entry>64</entry> | |
| 3390 <entry>128</entry> | |
| 3391 <entry>384</entry> | |
| 3392 <entry>128</entry> | |
| 3393 <entry>128</entry> | |
| 3394 <entry>384</entry> | |
| 3395 <entry>768</entry> | |
| 3396 <entry>3000</entry> | |
| 3397 <entry>8000</entry> | |
| 3398 <entry>537.6</entry> | |
| 3399 <entry>4854</entry> | |
| 3400 <entry>4854</entry> | |
| 3401 <entry>4854</entry> | |
| 3402 <entry>4854</entry> | |
| 3403 <entry>9708.4</entry> | |
| 3404 </row> | |
| 3405 <row> | |
| 3406 <entry>Peak average bitrate over 3 secs [kbps]</entry> | |
| 3407 <entry></entry> | |
| 3408 <entry></entry> | |
| 3409 <entry></entry> | |
| 3410 <entry></entry> | |
| 3411 <entry></entry> | |
| 3412 <entry></entry> | |
| 3413 <entry></entry> | |
| 3414 <entry></entry> | |
| 3415 <entry></entry> | |
| 3416 <entry></entry> | |
| 3417 <entry>800</entry> | |
| 3418 <entry>8000</entry> | |
| 3419 <entry>8000</entry> | |
| 3420 <entry>8000</entry> | |
| 3421 <entry>8000</entry> | |
| 3422 <entry>16000</entry> | |
| 3423 </row> | |
| 3424 <row> | |
| 3425 <entry>Max. B-frames</entry> | |
| 3426 <entry>0</entry> | |
| 3427 <entry>0</entry> | |
| 3428 <entry>0</entry> | |
| 3429 <entry>0</entry> | |
| 3430 <entry></entry> | |
| 3431 <entry></entry> | |
| 3432 <entry></entry> | |
| 3433 <entry></entry> | |
| 3434 <entry></entry> | |
| 3435 <entry></entry> | |
| 3436 <entry>0</entry> | |
| 3437 <entry>1</entry> | |
| 3438 <entry>1</entry> | |
| 3439 <entry>1</entry> | |
| 3440 <entry>1</entry> | |
| 3441 <entry>2</entry> | |
| 3442 </row> | |
| 3443 <row> | |
| 3444 <entry>MPEG quantization</entry> | |
| 3445 <entry></entry> | |
| 3446 <entry></entry> | |
| 3447 <entry></entry> | |
| 3448 <entry></entry> | |
| 3449 <entry>X</entry> | |
| 3450 <entry>X</entry> | |
| 3451 <entry>X</entry> | |
| 3452 <entry>X</entry> | |
| 3453 <entry>X</entry> | |
| 3454 <entry>X</entry> | |
| 3455 <entry></entry> | |
| 3456 <entry></entry> | |
| 3457 <entry></entry> | |
| 3458 <entry></entry> | |
| 3459 <entry></entry> | |
| 3460 <entry></entry> | |
| 3461 </row> | |
| 3462 <row> | |
| 3463 <entry>Adaptive quantization</entry> | |
| 3464 <entry></entry> | |
| 3465 <entry></entry> | |
| 3466 <entry></entry> | |
| 3467 <entry></entry> | |
| 3468 <entry>X</entry> | |
| 3469 <entry>X</entry> | |
| 3470 <entry>X</entry> | |
| 3471 <entry>X</entry> | |
| 3472 <entry>X</entry> | |
| 3473 <entry>X</entry> | |
| 3474 <entry>X</entry> | |
| 3475 <entry>X</entry> | |
| 3476 <entry>X</entry> | |
| 3477 <entry>X</entry> | |
| 3478 <entry>X</entry> | |
| 3479 <entry>X</entry> | |
| 3480 </row> | |
| 3481 <row> | |
| 3482 <entry>Interlaced encoding</entry> | |
| 3483 <entry></entry> | |
| 3484 <entry></entry> | |
| 3485 <entry></entry> | |
| 3486 <entry></entry> | |
| 3487 <entry>X</entry> | |
| 3488 <entry>X</entry> | |
| 3489 <entry>X</entry> | |
| 3490 <entry>X</entry> | |
| 3491 <entry>X</entry> | |
| 3492 <entry>X</entry> | |
| 3493 <entry></entry> | |
| 3494 <entry></entry> | |
| 3495 <entry></entry> | |
| 3496 <entry>X</entry> | |
| 3497 <entry>X</entry> | |
| 3498 <entry>X</entry> | |
| 3499 </row> | |
| 3500 <row> | |
| 3501 <entry>Quaterpixel</entry> | |
| 3502 <entry></entry> | |
| 3503 <entry></entry> | |
| 3504 <entry></entry> | |
| 3505 <entry></entry> | |
| 3506 <entry>X</entry> | |
| 3507 <entry>X</entry> | |
| 3508 <entry>X</entry> | |
| 3509 <entry>X</entry> | |
| 3510 <entry>X</entry> | |
| 3511 <entry>X</entry> | |
| 3512 <entry></entry> | |
| 3513 <entry></entry> | |
| 3514 <entry></entry> | |
| 3515 <entry></entry> | |
| 3516 <entry></entry> | |
| 3517 <entry></entry> | |
| 3518 </row> | |
| 3519 <row> | |
| 3520 <entry>Global motion compensation</entry> | |
| 3521 <entry></entry> | |
| 3522 <entry></entry> | |
| 3523 <entry></entry> | |
| 3524 <entry></entry> | |
| 3525 <entry>X</entry> | |
| 3526 <entry>X</entry> | |
| 3527 <entry>X</entry> | |
| 3528 <entry>X</entry> | |
| 3529 <entry>X</entry> | |
| 3530 <entry>X</entry> | |
| 3531 <entry></entry> | |
| 3532 <entry></entry> | |
| 3533 <entry></entry> | |
| 3534 <entry></entry> | |
| 3535 <entry></entry> | |
| 3536 <entry></entry> | |
| 3537 </row> | |
| 3538 </tbody> | |
| 3539 </tgroup> | |
| 3540 </informaltable> | |
| 3541 </sect2> | |
| 3542 | |
| 3543 <!-- ********** --> | |
| 3544 | |
| 3545 <sect2 id="menc-feat-xvid-example-settings"> | |
| 3546 <title>Encoding setting examples</title> | |
| 3547 | |
| 3548 <para> | |
| 3549 The following settings are examples of different encoding | |
| 3550 option combinations that affect the speed vs quality tradeoff | |
| 3551 at the same target bitrate. | |
| 3552 </para> | |
| 3553 | |
| 3554 <para> | |
| 3555 All the encoding settings were tested on a 720x448 @30000/1001 fps | |
| 3556 video sample, the target bitrate was 900kbps, and the machine was an | |
| 3557 AMD-64 3400+ at 2400 MHz in 64 bits mode. | |
| 3558 Each encoding setting features the measured encoding speed (in | |
| 3559 frames per second) and the PSNR loss (in dB) compared to the "very | |
| 3560 high quality" setting. | |
| 3561 Please understand that depending on your source, your machine type | |
| 3562 and development advancements, you may get very different results. | |
| 3563 </para> | |
| 3564 | |
| 3565 <informaltable frame="all"> | |
| 3566 <tgroup cols="4"> | |
| 3567 <thead> | |
| 3568 <row><entry>Description</entry><entry>Encoding options</entry><entry>speed (in fps)</entry><entry>Relative PSNR loss (in dB)</entry></row> | |
| 3569 </thead> | |
| 3570 <tbody> | |
| 3571 <row> | |
| 3572 <entry>Very high quality</entry> | |
| 3573 <entry><option>chroma_opt:vhq=4:bvhq=1:quant_type=mpeg</option></entry> | |
| 3574 <entry>16fps</entry> | |
| 3575 <entry>0dB</entry> | |
| 3576 </row> | |
| 3577 <row> | |
| 3578 <entry>High quality</entry> | |
| 3579 <entry><option>vhq=2:bvhq=1:chroma_opt:quant_type=mpeg</option></entry> | |
| 3580 <entry>18fps</entry> | |
| 3581 <entry>-0.1dB</entry> | |
| 3582 </row> | |
| 3583 <row> | |
| 3584 <entry>Fast</entry> | |
| 3585 <entry><option>turbo:vhq=0</option></entry> | |
| 3586 <entry>28fps</entry> | |
| 3587 <entry>-0.69dB</entry> | |
| 3588 </row> | |
| 3589 <row> | |
| 3590 <entry>Realtime</entry> | |
| 3591 <entry><option>turbo:nochroma_me:notrellis:max_bframes=0:vhq=0</option></entry> | |
| 3592 <entry>38fps</entry> | |
| 3593 <entry>-1.48dB</entry> | |
| 3594 </row> | |
| 3595 </tbody> | |
| 3596 </tgroup> | |
| 3597 </informaltable> | |
| 3598 </sect2> | |
| 3599 </sect1> | |
| 3600 | |
| 3601 | |
| 3602 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
| 3603 | |
| 3604 | |
| 3605 <sect1 id="menc-feat-x264"> | |
| 3606 <title>Encoding with the | |
| 3607 <systemitem class="library">x264</systemitem> codec</title> | |
| 3608 | |
| 3609 <para> | |
| 3610 <systemitem class="library">x264</systemitem> is a free library for | |
| 3611 encoding H.264/AVC video streams. | |
| 3612 Before starting to encode, you need to | |
| 28476 | 3613 <link linkend="x264">set up <application>MEncoder</application> to support it</link>. |
| 25279 | 3614 </para> |
| 3615 | |
| 3616 <!-- ********** --> | |
| 3617 | |
| 3618 <sect2 id="menc-feat-x264-encoding-options"> | |
| 3619 <title>Encoding options of x264</title> | |
| 3620 | |
| 3621 <para> | |
| 3622 Please begin by reviewing the | |
| 3623 <systemitem class="library">x264</systemitem> section of | |
| 3624 <application>MPlayer</application>'s man page. | |
| 3625 This section is intended to be a supplement to the man page. | |
| 3626 Here you will find quick hints about which options are most | |
| 3627 likely to interest most people. The man page is more terse, | |
| 3628 but also more exhaustive, and it sometimes offers much better | |
| 3629 technical detail. | |
| 3630 </para> | |
| 3631 | |
| 3632 | |
| 3633 <sect3 id="menc-feat-x264-encoding-options-intro"> | |
| 3634 <title>Introduction</title> | |
| 3635 | |
| 3636 <para> | |
| 3637 This guide considers two major categories of encoding options: | |
| 3638 </para> | |
| 3639 | |
| 3640 <orderedlist> | |
| 3641 <listitem><para> | |
| 3642 Options which mainly trade off encoding time vs. quality | |
| 3643 </para></listitem> | |
| 3644 <listitem><para> | |
| 3645 Options which may be useful for fulfilling various personal | |
| 3646 preferences and special requirements | |
| 3647 </para></listitem> | |
| 3648 </orderedlist> | |
| 3649 | |
| 3650 <para> | |
| 3651 Ultimately, only you can decide which options are best for your | |
| 3652 purposes. The decision for the first class of options is the simplest: | |
| 3653 you only have to decide whether you think the quality differences | |
| 3654 justify the speed differences. For the second class of options, | |
| 3655 preferences may be far more subjective, and more factors may be | |
| 3656 involved. Note that some of the "personal preferences and special | |
| 3657 requirements" options can still have large impacts on speed or quality, | |
| 3658 but that is not what they are primarily useful for. A couple of the | |
| 3659 "personal preference" options may even cause changes that look better | |
| 3660 to some people, but look worse to others. | |
| 3661 </para> | |
| 3662 | |
| 3663 <para> | |
| 3664 Before continuing, you need to understand that this guide uses only one | |
| 3665 quality metric: global PSNR. | |
| 3666 For a brief explanation of what PSNR is, see | |
| 3667 <ulink url="http://en.wikipedia.org/wiki/PSNR">the Wikipedia article on PSNR</ulink>. | |
| 3668 Global PSNR is the last PSNR number reported when you include | |
| 3669 the <option>psnr</option> option in <option>x264encopts</option>. | |
| 3670 Any time you read a claim about PSNR, one of the assumptions | |
| 3671 behind the claim is that equal bitrates are used. | |
| 3672 </para> | |
| 3673 | |
| 3674 <para> | |
| 3675 Nearly all of this guide's comments assume you are using two pass. | |
| 3676 When comparing options, there are two major reasons for using | |
| 3677 two pass encoding. | |
| 3678 First, using two pass often gains around 1dB PSNR, which is a | |
| 3679 very big difference. | |
| 3680 Secondly, testing options by doing direct quality comparisons | |
| 3681 with one pass encodes introduces a major confounding | |
| 3682 factor: bitrate often varies significantly with each encode. | |
| 3683 It is not always easy to tell whether quality changes are due | |
| 3684 mainly to changed options, or if they mostly reflect essentially | |
| 3685 random differences in the achieved bitrate. | |
| 3686 </para> | |
| 3687 </sect3> | |
| 3688 | |
| 3689 | |
| 3690 <sect3 id="menc-feat-x264-encoding-options-speedvquality"> | |
| 3691 <title>Options which primarily affect speed and quality</title> | |
| 3692 | |
| 3693 <itemizedlist> | |
| 3694 <listitem> | |
| 3695 <para> | |
| 3696 <emphasis role="bold">subq</emphasis>: | |
| 3697 Of the options which allow you to trade off speed for quality, | |
| 3698 <option>subq</option> and <option>frameref</option> (see below) are usually | |
| 3699 by far the most important. | |
| 3700 If you are interested in tweaking either speed or quality, these | |
| 3701 are the first options you should consider. | |
| 3702 On the speed dimension, the <option>frameref</option> and | |
| 3703 <option>subq</option> options interact with each other fairly | |
| 3704 strongly. | |
| 3705 Experience shows that, with one reference frame, | |
| 3706 <option>subq=5</option> (the default setting) takes about 35% more time than | |
| 3707 <option>subq=1</option>. | |
| 3708 With 6 reference frames, the penalty grows to over 60%. | |
| 3709 <option>subq</option>'s effect on PSNR seems fairly constant | |
| 3710 regardless of the number of reference frames. | |
| 3711 Typically, <option>subq=5</option> achieves 0.2-0.5 dB higher global | |
| 3712 PSNR in comparison <option>subq=1</option>. | |
| 3713 This is usually enough to be visible. | |
| 3714 </para> | |
| 3715 <para> | |
| 3716 <option>subq=6</option> is slower and yields better quality at a reasonable | |
| 3717 cost. | |
| 3718 In comparison to <option>subq=5</option>, it usually gains 0.1-0.4 dB | |
| 3719 global PSNR with speed costs varying from 25%-100%. | |
| 3720 Unlike other levels of <option>subq</option>, the behavior of | |
| 3721 <option>subq=6</option> does not depend much on <option>frameref</option> | |
| 3722 and <option>me</option>. Instead, the effectiveness of <option>subq=6 | |
| 3723 </option> depends mostly upon the number of B-frames used. In normal | |
| 3724 usage, this means <option>subq=6</option> has a large impact on both speed | |
| 3725 and quality in complex, high motion scenes, but it may not have much effect | |
| 3726 in low-motion scenes. Note that it is still recommended to always set | |
| 3727 <option>bframes</option> to something other than zero (see below). | |
| 3728 </para> | |
| 3729 <para> | |
| 3730 <option>subq=7</option> is the slowest, highest quality mode. | |
| 3731 In comparison to <option>subq=6</option>, it usually gains 0.01-0.05 dB | |
| 3732 global PSNR with speed costs varying from 15%-33%. | |
| 3733 Since the tradeoff encoding time vs. quality is quite low, you should | |
| 3734 only use it if you are after every bit saving and if encoding time is | |
| 3735 not an issue. | |
| 3736 </para> | |
| 3737 </listitem> | |
| 3738 <listitem> | |
| 3739 <para> | |
| 3740 <emphasis role="bold">frameref</emphasis>: | |
| 3741 <option>frameref</option> is set to 1 by default, but this | |
| 3742 should not be taken to imply that it is reasonable to set it to 1. | |
| 3743 Merely raising <option>frameref</option> to 2 gains around | |
| 3744 0.15dB PSNR with a 5-10% speed penalty; this seems like a good tradeoff. | |
| 3745 <option>frameref=3</option> gains around 0.25dB PSNR over | |
| 3746 <option>frameref=1</option>, which should be a visible difference. | |
| 3747 <option>frameref=3</option> is around 15% slower than | |
| 3748 <option>frameref=1</option>. | |
| 3749 Unfortunately, diminishing returns set in rapidly. | |
| 3750 <option>frameref=6</option> can be expected to gain only | |
| 3751 0.05-0.1 dB over <option>frameref=3</option> at an additional | |
| 3752 15% speed penalty. | |
| 3753 Above <option>frameref=6</option>, the quality gains are | |
| 3754 usually very small (although you should keep in mind throughout | |
| 3755 this whole discussion that it can vary quite a lot depending on your source). | |
| 3756 In a fairly typical case, <option>frameref=12</option> | |
| 3757 will improve global PSNR by a tiny 0.02dB over | |
| 3758 <option>frameref=6</option>, at a speed cost of 15%-20%. | |
| 3759 At such high <option>frameref</option> values, the only really | |
| 3760 good thing that can be said is that increasing it even further will | |
| 3761 almost certainly never <emphasis role="bold">harm</emphasis> | |
| 3762 PSNR, but the additional quality benefits are barely even | |
| 3763 measurable, let alone perceptible. | |
| 3764 </para> | |
| 3765 <note><title>Note:</title> | |
| 3766 <para> | |
| 3767 Raising <option>frameref</option> to unnecessarily high values | |
| 3768 <emphasis role="bold">can</emphasis> and | |
| 3769 <emphasis role="bold">usually does</emphasis> | |
| 3770 hurt coding efficiency if you turn CABAC off. | |
| 3771 With CABAC on (the default behavior), the possibility of setting | |
| 3772 <option>frameref</option> "too high" currently seems too remote | |
| 3773 to even worry about, and in the future, optimizations may remove | |
| 3774 the possibility altogether. | |
| 3775 </para></note> | |
| 3776 <para> | |
| 3777 If you care about speed, a reasonable compromise is to use low | |
| 3778 <option>subq</option> and <option>frameref</option> values on | |
| 3779 the first pass, and then raise them on the second pass. | |
| 3780 Typically, this has a negligible negative effect on the final | |
| 3781 quality: You will probably lose well under 0.1dB PSNR, which | |
| 3782 should be much too small of a difference to see. | |
| 3783 However, different values of <option>frameref</option> can | |
| 3784 occasionally affect frametype decision. | |
| 3785 Most likely, these are rare outlying cases, but if you want to | |
| 3786 be pretty sure, consider whether your video has either | |
| 3787 fullscreen repetitive flashing patterns or very large temporary | |
| 3788 occlusions which might force an I-frame. | |
| 3789 Adjust the first-pass <option>frameref</option> so it is large | |
| 3790 enough to contain the duration of the flashing cycle (or occlusion). | |
| 3791 For example, if the scene flashes back and forth between two images | |
| 3792 over a duration of three frames, set the first pass | |
| 3793 <option>frameref</option> to 3 or higher. | |
| 3794 This issue is probably extremely rare in live action video material, | |
| 3795 but it does sometimes come up in video game captures. | |
| 3796 </para> | |
| 3797 </listitem> | |
| 3798 <listitem> | |
| 3799 <para> | |
| 3800 <emphasis role="bold">me</emphasis>: | |
| 3801 This option is for choosing the motion estimation search method. | |
| 3802 Altering this option provides a straightforward quality-vs-speed | |
| 3803 tradeoff. <option>me=dia</option> is only a few percent faster than | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
3804 the default search, at a cost of under 0.1dB global PSNR. The |
| 25279 | 3805 default setting (<option>me=hex</option>) is a reasonable tradeoff |
| 3806 between speed and quality. <option>me=umh</option> gains a little under | |
| 3807 0.1dB global PSNR, with a speed penalty that varies depending on | |
| 3808 <option>frameref</option>. At high values of | |
| 3809 <option>frameref</option> (e.g. 12 or so), <option>me=umh</option> | |
| 3810 is about 40% slower than the default <option> me=hex</option>. With | |
| 3811 <option>frameref=3</option>, the speed penalty incurred drops to | |
| 3812 25%-30%. | |
| 3813 </para> | |
| 3814 <para> | |
| 3815 <option>me=esa</option> uses an exhaustive search that is too slow for | |
| 3816 practical use. | |
| 3817 </para> | |
| 3818 </listitem> | |
| 3819 <listitem><para> | |
| 3820 <emphasis role="bold">partitions=all</emphasis>: | |
| 3821 This option enables the use of 8x4, 4x8 and 4x4 subpartitions in | |
| 3822 predicted macroblocks (in addition to the default partitions). | |
| 3823 Enabling it results in a fairly consistent | |
| 3824 10%-15% loss of speed. This option is rather useless in source | |
| 3825 containing only low motion, however in some high-motion source, | |
| 3826 particularly source with lots of small moving objects, gains of | |
| 3827 about 0.1dB can be expected. | |
| 3828 </para></listitem> | |
| 3829 <listitem> | |
| 3830 <para> | |
| 3831 <emphasis role="bold">bframes</emphasis>: | |
| 3832 If you are used to encoding with other codecs, you may have found | |
| 3833 that B-frames are not always useful. | |
| 3834 In H.264, this has changed: there are new techniques and block | |
| 3835 types that are possible in B-frames. | |
| 3836 Usually, even a naive B-frame choice algorithm can have a | |
| 3837 significant PSNR benefit. | |
| 3838 It is interesting to note that using B-frames usually speeds up | |
| 3839 the second pass somewhat, and may also speed up a single | |
| 3840 pass encode if adaptive B-frame decision is turned off. | |
| 3841 </para> | |
| 3842 <para> | |
| 3843 With adaptive B-frame decision turned off | |
| 3844 (<option>x264encopts</option>'s <option>nob_adapt</option>), | |
| 3845 the optimal value for this setting is usually no more than | |
| 3846 <option>bframes=1</option>, or else high-motion scenes can suffer. | |
| 3847 With adaptive B-frame decision on (the default behavior), it is | |
| 3848 safe to use higher values; the encoder will reduce the use of | |
| 3849 B-frames in scenes where they would hurt compression. | |
| 3850 The encoder rarely chooses to use more than 3 or 4 B-frames; | |
| 3851 setting this option any higher will have little effect. | |
| 3852 </para> | |
| 3853 </listitem> | |
| 3854 <listitem> | |
| 3855 <para> | |
| 3856 <emphasis role="bold">b_adapt</emphasis>: | |
| 3857 Note: This is on by default. | |
| 3858 </para> | |
| 3859 <para> | |
| 3860 With this option enabled, the encoder will use a reasonably fast | |
| 3861 decision process to reduce the number of B-frames used in scenes that | |
| 3862 might not benefit from them as much. | |
| 3863 You can use <option>b_bias</option> to tweak how B-frame-happy | |
| 3864 the encoder is. | |
| 3865 The speed penalty of adaptive B-frames is currently rather modest, | |
| 3866 but so is the potential quality gain. | |
| 3867 It usually does not hurt, however. | |
| 3868 Note that this only affects speed and frametype decision on the | |
| 3869 first pass. | |
| 3870 <option>b_adapt</option> and <option>b_bias</option> have no | |
| 3871 effect on subsequent passes. | |
| 3872 </para> | |
| 3873 </listitem> | |
| 3874 <listitem><para> | |
| 3875 <emphasis role="bold">b_pyramid</emphasis>: | |
| 3876 You might as well enable this option if you are using >=2 B-frames; | |
| 3877 as the man page says, you get a little quality improvement at no | |
| 3878 speed cost. | |
| 3879 Note that these videos cannot be read by libavcodec-based decoders | |
| 3880 older than about March 5, 2005. | |
| 3881 </para></listitem> | |
| 3882 <listitem> | |
| 3883 <para> | |
| 3884 <emphasis role="bold">weight_b</emphasis>: | |
| 3885 In typical cases, there is not much gain with this option. | |
| 3886 However, in crossfades or fade-to-black scenes, weighted | |
| 3887 prediction gives rather large bitrate savings. | |
| 3888 In MPEG-4 ASP, a fade-to-black is usually best coded as a series | |
| 3889 of expensive I-frames; using weighted prediction in B-frames | |
| 3890 makes it possible to turn at least some of these into much smaller | |
| 3891 B-frames. | |
| 3892 Encoding time cost is minimal, as no extra decisions need to be made. | |
| 3893 Also, contrary to what some people seem to guess, the decoder | |
| 3894 CPU requirements are not much affected by weighted prediction, | |
| 3895 all else being equal. | |
| 3896 </para> | |
| 3897 <para> | |
| 3898 Unfortunately, the current adaptive B-frame decision algorithm | |
| 3899 has a strong tendency to avoid B-frames during fades. | |
| 3900 Until this changes, it may be a good idea to add | |
| 3901 <option>nob_adapt</option> to your x264encopts, if you expect | |
| 3902 fades to have a large effect in your particular video | |
| 3903 clip. | |
| 3904 </para> | |
| 3905 </listitem> | |
| 3906 <listitem id="menc-feat-x264-encoding-options-speedvquality-threads"> | |
| 3907 <para> | |
| 3908 <emphasis role="bold">threads</emphasis>: | |
| 3909 This option allows to spawn threads to encode in parallel on multiple CPUs. | |
| 3910 You can manually select the number of threads to be created or, better, set | |
| 3911 <option>threads=auto</option> and let | |
| 3912 <systemitem class="library">x264</systemitem> detect how many CPUs are | |
| 3913 available and pick an appropriate number of threads. | |
| 3914 If you have a multi-processor machine, you should really consider using it | |
| 3915 as it can to increase encoding speed linearly with the number of CPU cores | |
| 3916 (about 94% per CPU core), with very little quality reduction (about 0.005dB | |
| 3917 for dual processor, about 0.01dB for a quad processor machine). | |
| 3918 </para> | |
| 3919 </listitem> | |
| 3920 </itemizedlist> | |
| 3921 </sect3> | |
| 3922 | |
| 3923 | |
| 3924 <sect3 id="menc-feat-x264-encoding-options-misc-preferences"> | |
| 3925 <title>Options pertaining to miscellaneous preferences</title> | |
| 3926 | |
| 3927 <itemizedlist> | |
| 3928 <listitem> | |
| 3929 <para> | |
| 3930 <emphasis role="bold">Two pass encoding</emphasis>: | |
| 3931 Above, it was suggested to always use two pass encoding, but there | |
| 3932 are still reasons for not using it. For instance, if you are capturing | |
| 3933 live TV and encoding in realtime, you are forced to use single-pass. | |
| 3934 Also, one pass is obviously faster than two passes; if you use the | |
| 3935 exact same set of options on both passes, two pass encoding is almost | |
| 3936 twice as slow. | |
| 3937 </para> | |
| 3938 <para> | |
| 3939 Still, there are very good reasons for using two pass encoding. For | |
| 3940 one thing, single pass ratecontrol is not psychic, and it often makes | |
| 3941 unreasonable choices because it cannot see the big picture. For example, | |
| 3942 suppose you have a two minute long video consisting of two distinct | |
| 3943 halves. The first half is a very high-motion scene lasting 60 seconds | |
| 3944 which, in isolation, requires about 2500kbps in order to look decent. | |
| 3945 Immediately following it is a much less demanding 60-second scene | |
| 3946 that looks good at 300kbps. Suppose you ask for 1400kbps on the theory | |
| 3947 that this is enough to accomodate both scenes. Single pass ratecontrol | |
| 3948 will make a couple of "mistakes" in such a case. First of all, it | |
| 3949 will target 1400kbps in both segments. The first segment may end up | |
| 3950 heavily overquantized, causing it to look unacceptably and unreasonably | |
| 3951 blocky. The second segment will be heavily underquantized; it may look | |
| 3952 perfect, but the bitrate cost of that perfection will be completely | |
| 3953 unreasonable. What is even harder to avoid is the problem at the | |
| 3954 transition between the two scenes. The first seconds of the low motion | |
| 3955 half will be hugely over-quantized, because the ratecontrol is still | |
| 3956 expecting the kind of bitrate requirements it met in the first half | |
| 3957 of the video. This "error period" of heavily over-quantized low motion | |
| 3958 will look jarringly bad, and will actually use less than the 300kbps | |
| 3959 it would have taken to make it look decent. There are ways to | |
| 3960 mitigate the pitfalls of single-pass encoding, but they may tend to | |
| 3961 increase bitrate misprediction. | |
| 3962 </para> | |
| 3963 <para> | |
| 3964 Multipass ratecontrol can offer huge advantages over a single pass. | |
| 3965 Using the statistics gathered from the first pass encode, the encoder | |
| 3966 can estimate, with reasonable accuracy, the "cost" (in bits) of | |
| 3967 encoding any given frame, at any given quantizer. This allows for | |
| 3968 a much more rational, better planned allocation of bits between the | |
| 3969 expensive (high-motion) and cheap (low-motion) scenes. See | |
| 3970 <option>qcomp</option> below for some ideas on how to tweak this | |
| 3971 allocation to your liking. | |
| 3972 </para> | |
| 3973 <para> | |
| 3974 Moreover, two passes need not take twice as long as one pass. You can | |
| 3975 tweak the options in the first pass for higher speed and lower quality. | |
| 3976 If you choose your options well, you can get a very fast first pass. | |
| 3977 The resulting quality in the second pass will be slightly lower because size | |
| 3978 prediction is less accurate, but the quality difference is normally much | |
| 3979 too small to be visible. Try, for example, adding | |
| 3980 <option>subq=1:frameref=1</option> to the first pass | |
| 3981 <option>x264encopts</option>. Then, on the second pass, use slower, | |
| 3982 higher-quality options: | |
| 3983 <option>subq=6:frameref=15:partitions=all:me=umh</option> | |
| 3984 </para> | |
| 3985 </listitem> | |
| 3986 <listitem><para> | |
| 3987 <emphasis role="bold">Three pass encoding</emphasis>? | |
| 3988 x264 offers the ability to make an arbitrary number of consecutive | |
| 3989 passes. If you specify <option>pass=1</option> on the first pass, | |
| 3990 then use <option>pass=3</option> on a subsequent pass, the subsequent | |
| 3991 pass will both read the statistics from the previous pass, and write | |
| 3992 its own statistics. An additional pass following this one will have | |
| 3993 a very good base from which to make highly accurate predictions of | |
| 3994 framesizes at a chosen quantizer. In practice, the overall quality | |
| 3995 gain from this is usually close to zero, and quite possibly a third | |
| 3996 pass will result in slightly worse global PSNR than the pass before | |
| 3997 it. In typical usage, three passes help if you get either bad bitrate | |
| 3998 prediction or bad looking scene transitions when using only two passes. | |
| 3999 This is somewhat likely to happen on extremely short clips. There are | |
| 4000 also a few special cases in which three (or more) passes are handy | |
| 4001 for advanced users, but for brevity, this guide omits discussing those | |
| 4002 special cases. | |
| 4003 </para></listitem> | |
| 4004 <listitem><para> | |
| 4005 <emphasis role="bold">qcomp</emphasis>: | |
| 4006 <option>qcomp</option> trades off the number of bits allocated | |
| 4007 to "expensive" high-motion versus "cheap" low-motion frames. At | |
| 4008 one extreme, <option>qcomp=0</option> aims for true constant | |
| 4009 bitrate. Typically this would make high-motion scenes look completely | |
| 4010 awful, while low-motion scenes would probably look absolutely | |
| 4011 perfect, but would also use many times more bitrate than they | |
| 4012 would need in order to look merely excellent. At the other extreme, | |
| 4013 <option>qcomp=1</option> achieves nearly constant quantization parameter | |
| 4014 (QP). Constant QP does not look bad, but most people think it is more | |
| 4015 reasonable to shave some bitrate off of the extremely expensive scenes | |
| 4016 (where the loss of quality is not as noticeable) and reallocate it to | |
| 4017 the scenes that are easier to encode at excellent quality. | |
| 4018 <option>qcomp</option> is set to 0.6 by default, which may be slightly | |
| 4019 low for many peoples' taste (0.7-0.8 are also commonly used). | |
| 4020 </para></listitem> | |
| 4021 <listitem><para> | |
| 4022 <emphasis role="bold">keyint</emphasis>: | |
| 4023 <option>keyint</option> is solely for trading off file seekability against | |
| 4024 coding efficiency. By default, <option>keyint</option> is set to 250. In | |
| 4025 25fps material, this guarantees the ability to seek to within 10 seconds | |
| 4026 precision. If you think it would be important and useful to be able to | |
| 4027 seek within 5 seconds of precision, set <option>keyint=125</option>; | |
| 4028 this will hurt quality/bitrate slightly. If you care only about quality | |
| 4029 and not about seekability, you can set it to much higher values | |
| 4030 (understanding that there are diminishing returns which may become | |
| 4031 vanishingly low, or even zero). The video stream will still have seekable | |
| 4032 points as long as there are some scene changes. | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4033 </para></listitem> |
| 25279 | 4034 <listitem> |
| 4035 <para> | |
| 4036 <emphasis role="bold">deblock</emphasis>: | |
| 4037 This topic is going to be a bit controversial. | |
| 4038 </para> | |
| 4039 <para> | |
| 4040 H.264 defines a simple deblocking procedure on I-blocks that uses | |
| 4041 pre-set strengths and thresholds depending on the QP of the block | |
| 4042 in question. | |
| 4043 By default, high QP blocks are filtered heavily, and low QP blocks | |
| 4044 are not deblocked at all. | |
| 4045 The pre-set strengths defined by the standard are well-chosen and | |
| 4046 the odds are very good that they are PSNR-optimal for whatever | |
| 4047 video you are trying to encode. | |
| 4048 The <option>deblock</option> allow you to specify offsets to the preset | |
| 4049 deblocking thresholds. | |
| 4050 </para> | |
| 4051 <para> | |
| 4052 Many people seem to think it is a good idea to lower the deblocking | |
| 4053 filter strength by large amounts (say, -3). | |
| 4054 This is however almost never a good idea, and in most cases, | |
| 4055 people who are doing this do not understand very well how | |
| 4056 deblocking works by default. | |
| 4057 </para> | |
| 4058 <para> | |
| 4059 The first and most important thing to know about the in-loop | |
| 4060 deblocking filter is that the default thresholds are almost always | |
| 4061 PSNR-optimal. | |
| 4062 In the rare cases that they are not optimal, the ideal offset is | |
| 4063 plus or minus 1. | |
| 4064 Adjusting deblocking parameters by a larger amount is almost | |
| 4065 guaranteed to hurt PSNR. | |
| 4066 Strengthening the filter will smear more details; weakening the | |
| 4067 filter will increase the appearance of blockiness. | |
| 4068 </para> | |
| 4069 <para> | |
| 4070 It is definitely a bad idea to lower the deblocking thresholds if | |
| 4071 your source is mainly low in spacial complexity (i.e., not a lot | |
| 4072 of detail or noise). | |
| 4073 The in-loop filter does a rather excellent job of concealing | |
| 4074 the artifacts that occur. | |
| 4075 If the source is high in spacial complexity, however, artifacts | |
| 4076 are less noticeable. | |
| 4077 This is because the ringing tends to look like detail or noise. | |
| 4078 Human visual perception easily notices when detail is removed, | |
| 4079 but it does not so easily notice when the noise is wrongly | |
| 4080 represented. | |
| 4081 When it comes to subjective quality, noise and detail are somewhat | |
| 4082 interchangeable. | |
| 4083 By lowering the deblocking filter strength, you are most likely | |
| 4084 increasing error by adding ringing artifacts, but the eye does | |
| 4085 not notice because it confuses the artifacts with detail. | |
| 4086 </para> | |
| 4087 <para> | |
| 4088 This <emphasis role="bold">still</emphasis> does not justify | |
| 4089 lowering the deblocking filter strength, however. | |
| 4090 You can generally get better quality noise from postprocessing. | |
| 4091 If your H.264 encodes look too blurry or smeared, try playing with | |
| 4092 <option>-vf noise</option> when you play your encoded movie. | |
| 4093 <option>-vf noise=8a:4a</option> should conceal most mild | |
| 4094 artifacting. | |
| 4095 It will almost certainly look better than the results you | |
| 4096 would have gotten just by fiddling with the deblocking filter. | |
| 4097 </para> | |
| 4098 </listitem> | |
| 4099 </itemizedlist> | |
| 4100 </sect3> | |
| 4101 </sect2> | |
| 4102 | |
| 4103 <!-- ********** --> | |
| 4104 | |
| 4105 <sect2 id="menc-feat-x264-example-settings"> | |
| 4106 <title>Encoding setting examples</title> | |
| 4107 | |
| 4108 <para> | |
| 4109 The following settings are examples of different encoding | |
| 4110 option combinations that affect the speed vs quality tradeoff | |
| 4111 at the same target bitrate. | |
| 4112 </para> | |
| 4113 | |
| 4114 <para> | |
| 4115 All the encoding settings were tested on a 720x448 @30000/1001 fps | |
| 4116 video sample, the target bitrate was 900kbps, and the machine was an | |
| 4117 AMD-64 3400+ at 2400 MHz in 64 bits mode. | |
| 4118 Each encoding setting features the measured encoding speed (in | |
| 4119 frames per second) and the PSNR loss (in dB) compared to the "very | |
| 4120 high quality" setting. | |
| 4121 Please understand that depending on your source, your machine type | |
| 4122 and development advancements, you may get very different results. | |
| 4123 </para> | |
| 4124 | |
| 4125 <informaltable frame="all"> | |
| 4126 <tgroup cols="4"> | |
| 4127 <thead> | |
| 4128 <row> | |
| 4129 <entry>Description</entry> | |
| 4130 <entry>Encoding options</entry> | |
| 4131 <entry>speed (in fps)</entry> | |
| 4132 <entry>Relative PSNR loss (in dB)</entry> | |
| 4133 </row> | |
| 4134 </thead> | |
| 4135 <tbody> | |
| 4136 <row> | |
| 4137 <entry>Very high quality</entry> | |
| 4138 <entry><option>subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b</option></entry> | |
| 4139 <entry>6fps</entry> | |
| 4140 <entry>0dB</entry> | |
| 4141 </row> | |
| 4142 <row> | |
| 4143 <entry>High quality</entry> | |
| 4144 <entry><option>subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b</option></entry> | |
| 4145 <entry>13fps</entry> | |
| 4146 <entry>-0.89dB</entry> | |
| 4147 </row> | |
| 4148 <row> | |
| 4149 <entry>Fast</entry> | |
| 4150 <entry><option>subq=4:bframes=2:b_pyramid:weight_b</option></entry> | |
| 4151 <entry>17fps</entry> | |
| 4152 <entry>-1.48dB</entry> | |
| 4153 </row> | |
| 4154 </tbody> | |
| 4155 </tgroup> | |
| 4156 </informaltable> | |
| 4157 </sect2> | |
| 4158 </sect1> | |
| 4159 | |
| 4160 | |
| 4161 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
| 4162 | |
| 4163 | |
| 4164 <sect1 id="menc-feat-video-for-windows"> | |
| 4165 <title> | |
| 4166 Encoding with the <systemitem class="library">Video For Windows</systemitem> | |
| 4167 codec family | |
| 4168 </title> | |
| 4169 | |
| 4170 <para> | |
| 4171 Video for Windows provides simple encoding by means of binary video codecs. | |
| 4172 You can encode with the following codecs (if you have more, please tell us!) | |
| 4173 </para> | |
| 4174 | |
| 4175 <para> | |
| 4176 Note that support for this is very experimental and some codecs may not work | |
| 4177 correctly. Some codecs will only work in certain colorspaces, try | |
| 4178 <option>-vf format=bgr24</option> and <option>-vf format=yuy2</option> | |
| 4179 if a codec fails or gives wrong output. | |
| 4180 </para> | |
| 4181 | |
| 4182 <!-- ********** --> | |
| 4183 | |
| 4184 <sect2 id="menc-feat-enc-vfw-video-codecs"> | |
| 4185 <title>Video for Windows supported codecs</title> | |
| 4186 | |
| 4187 <para> | |
| 4188 <informaltable frame="all"> | |
| 4189 <tgroup cols="4"> | |
| 4190 <thead> | |
| 4191 <row> | |
| 4192 <entry>Video codec file name</entry> | |
| 4193 <entry>Description (FourCC)</entry> | |
| 4194 <entry>md5sum</entry> | |
| 4195 <entry>Comment</entry> | |
| 4196 </row> | |
| 4197 </thead> | |
| 4198 <tbody> | |
| 4199 <row> | |
| 4200 <entry>aslcodec_vfw.dll</entry> | |
| 4201 <entry>Alparysoft lossless codec vfw (ASLC)</entry> | |
| 4202 <entry>608af234a6ea4d90cdc7246af5f3f29a</entry> | |
| 4203 <entry></entry> | |
| 4204 </row> | |
| 4205 <row> | |
| 4206 <entry>avimszh.dll</entry> | |
| 4207 <entry>AVImszh (MSZH)</entry> | |
| 4208 <entry>253118fe1eedea04a95ed6e5f4c28878</entry> | |
| 4209 <entry>needs <option>-vf format</option></entry> | |
| 4210 </row> | |
| 4211 <row> | |
| 4212 <entry>avizlib.dll</entry> | |
| 4213 <entry>AVIzlib (ZLIB)</entry> | |
| 4214 <entry>2f1cc76bbcf6d77d40d0e23392fa8eda</entry> | |
| 4215 <entry></entry> | |
| 4216 </row> | |
| 4217 <row> | |
| 4218 <entry>divx.dll</entry> | |
| 4219 <entry>DivX4Windows-VFW</entry> | |
| 4220 <entry>acf35b2fc004a89c829531555d73f1e6</entry> | |
| 4221 <entry></entry> | |
| 4222 </row> | |
| 4223 <row> | |
| 4224 <entry>huffyuv.dll</entry> | |
| 4225 <entry>HuffYUV (lossless) (HFYU)</entry> | |
| 4226 <entry>b74695b50230be4a6ef2c4293a58ac3b</entry> | |
| 4227 <entry></entry> | |
| 4228 </row> | |
| 4229 <row> | |
| 4230 <entry>iccvid.dll</entry> | |
| 4231 <entry>Cinepak Video (cvid)</entry> | |
| 4232 <entry>cb3b7ee47ba7dbb3d23d34e274895133</entry> | |
| 4233 <entry></entry> | |
| 4234 </row> | |
| 4235 <row> | |
| 4236 <entry>icmw_32.dll</entry> | |
| 4237 <entry>Motion Wavelets (MWV1)</entry> | |
| 4238 <entry>c9618a8fc73ce219ba918e3e09e227f2</entry> | |
| 4239 <entry></entry> | |
| 4240 </row> | |
| 4241 <row> | |
| 4242 <entry>jp2avi.dll</entry> | |
| 4243 <entry>ImagePower MJPEG2000 (IPJ2)</entry> | |
| 4244 <entry>d860a11766da0d0ea064672c6833768b</entry> | |
| 4245 <entry><option>-vf flip</option></entry> | |
| 4246 </row> | |
| 4247 <row> | |
| 4248 <entry>m3jp2k32.dll</entry> | |
| 4249 <entry>Morgan MJPEG2000 (MJ2C)</entry> | |
| 4250 <entry>f3c174edcbaef7cb947d6357cdfde7ff</entry> | |
| 4251 <entry></entry> | |
| 4252 </row> | |
| 4253 <row> | |
| 4254 <entry>m3jpeg32.dll</entry> | |
| 4255 <entry>Morgan Motion JPEG Codec (MJPG)</entry> | |
| 4256 <entry>1cd13fff5960aa2aae43790242c323b1</entry> | |
| 4257 <entry></entry> | |
| 4258 </row> | |
| 4259 <row> | |
| 4260 <entry>mpg4c32.dll</entry> | |
| 4261 <entry>Microsoft MPEG-4 v1/v2</entry> | |
| 4262 <entry>b5791ea23f33010d37ab8314681f1256</entry> | |
| 4263 <entry></entry> | |
| 4264 </row> | |
| 4265 <row> | |
| 4266 <entry>tsccvid.dll</entry> | |
| 4267 <entry>TechSmith Camtasia Screen Codec (TSCC)</entry> | |
| 4268 <entry>8230d8560c41d444f249802a2700d1d5</entry> | |
| 4269 <entry>shareware error on windows</entry> | |
| 4270 </row> | |
| 4271 <row> | |
| 4272 <entry>vp31vfw.dll</entry> | |
| 4273 <entry>On2 Open Source VP3 Codec (VP31)</entry> | |
| 4274 <entry>845f3590ea489e2e45e876ab107ee7d2</entry> | |
| 4275 <entry></entry> | |
| 4276 </row> | |
| 4277 <row> | |
| 4278 <entry>vp4vfw.dll</entry> | |
| 4279 <entry>On2 VP4 Personal Codec (VP40)</entry> | |
| 4280 <entry>fc5480a482ccc594c2898dcc4188b58f</entry> | |
| 4281 <entry></entry> | |
| 4282 </row> | |
| 4283 <row> | |
| 4284 <entry>vp6vfw.dll</entry> | |
| 4285 <entry>On2 VP6 Personal Codec (VP60)</entry> | |
| 4286 <entry>04d635a364243013898fd09484f913fb</entry> | |
| 4287 <entry></entry> | |
| 4288 </row> | |
| 4289 <row> | |
| 4290 <entry>vp7vfw.dll</entry> | |
| 4291 <entry>On2 VP7 Personal Codec (VP70)</entry> | |
| 4292 <entry>cb4cc3d4ea7c94a35f1d81c3d750bc8d</entry> | |
| 4293 <entry>wrong FourCC?</entry> | |
| 4294 </row> | |
| 4295 <row> | |
| 4296 <entry>ViVD2.dll</entry> | |
| 4297 <entry>SoftMedia ViVD V2 codec VfW (GXVE)</entry> | |
| 4298 <entry>a7b4bf5cac630bb9262c3f80d8a773a1</entry> | |
| 4299 <entry></entry> | |
| 4300 </row> | |
| 4301 <row> | |
| 4302 <entry>msulvc06.DLL</entry> | |
| 4303 <entry>MSU Lossless codec (MSUD)</entry> | |
| 4304 <entry>294bf9288f2f127bb86f00bfcc9ccdda</entry> | |
| 4305 <entry> | |
| 4306 Decodable by <application>Window Media Player</application>, | |
| 4307 not <application>MPlayer</application> (yet). | |
| 4308 </entry> | |
| 4309 </row> | |
| 4310 <row> | |
| 4311 <entry>camcodec.dll</entry> | |
| 4312 <entry>CamStudio lossless video codec (CSCD)</entry> | |
| 4313 <entry>0efe97ce08bb0e40162ab15ef3b45615</entry> | |
| 4314 <entry>sf.net/projects/camstudio</entry> | |
| 4315 </row> | |
| 4316 </tbody> | |
| 4317 </tgroup> | |
| 4318 </informaltable> | |
| 4319 | |
| 4320 The first column contains the codec names that should be passed after the | |
| 4321 <literal>codec</literal> parameter, | |
| 4322 like: <option>-xvfwopts codec=divx.dll</option> | |
| 4323 The FourCC code used by each codec is given in the parentheses. | |
| 4324 </para> | |
| 4325 | |
| 4326 <informalexample> | |
| 4327 <para> | |
| 4328 An example to convert an ISO DVD trailer to a VP6 flash video file | |
| 4329 using compdata bitrate settings: | |
| 4330 <screen> | |
| 4331 mencoder -dvd-device <replaceable>zeiram.iso</replaceable> dvd://7 -o <replaceable>trailer.flv</replaceable> \ | |
| 4332 -ovc vfw -xvfwopts codec=vp6vfw.dll:compdata=onepass.mcf -oac mp3lame \ | |
| 4333 -lameopts cbr:br=64 -af lavcresample=22050 -vf yadif,scale=320:240,flip \ | |
| 4334 -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames | |
| 4335 </screen> | |
| 4336 </para> | |
| 4337 </informalexample> | |
| 4338 </sect2> | |
| 4339 | |
| 4340 <sect2 id="menc-feat-video-for-windows-bitrate-settings"> | |
| 4341 <title>Using vfw2menc to create a codec settings file.</title> | |
| 4342 | |
| 4343 <para> | |
| 4344 To encode with the Video for Windows codecs, you will need to set bitrate | |
| 4345 and other options. This is known to work on x86 on both *NIX and Windows. | |
| 4346 </para> | |
| 4347 <para> | |
| 4348 First you must build the <application>vfw2menc</application> program. | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4349 It is located in the <filename class="directory">TOOLS</filename> subdirectory |
| 25279 | 4350 of the MPlayer source tree. |
| 4351 To build on Linux, this can be done using <application>Wine</application>: | |
| 4352 <screen>winegcc vfw2menc.c -o vfw2menc -lwinmm -lole32</screen> | |
| 4353 | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4354 To build on Windows in <application>MinGW</application> or |
| 25279 | 4355 <application>Cygwin</application> use: |
| 4356 <screen>gcc vfw2menc.c -o vfw2menc.exe -lwinmm -lole32</screen> | |
| 4357 | |
| 4358 To build on <application>MSVC</application> you will need getopt. | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4359 Getopt can be found in the original <application>vfw2menc</application> |
| 25279 | 4360 archive available at: |
| 4361 The <ulink url="http://oss.netfarm.it/mplayer-win32.php">MPlayer on win32</ulink> project. | |
| 4362 </para> | |
| 4363 <informalexample> | |
| 4364 <para> | |
| 4365 Below is an example with the VP6 codec. | |
| 4366 <screen> | |
| 4367 vfw2menc -f VP62 -d vp6vfw.dll -s firstpass.mcf | |
| 4368 </screen> | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4369 This will open the VP6 codec dialog window. |
| 25279 | 4370 Repeat this step for the second pass |
| 4371 and use <option>-s <replaceable>secondpass.mcf</replaceable></option>. | |
| 4372 </para> | |
| 4373 </informalexample> | |
| 4374 <para> | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4375 Windows users can use |
| 25279 | 4376 <option>-xvfwopts codec=vp6vfw.dll:compdata=dialog</option> to have |
| 4377 the codec dialog display before encoding starts. | |
| 4378 </para> | |
| 4379 </sect2> | |
| 4380 </sect1> | |
| 4381 | |
| 4382 | |
| 4383 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
| 4384 | |
| 4385 | |
| 4386 <sect1 id="menc-feat-quicktime-7"> | |
| 4387 <title>Using <application>MEncoder</application> to create | |
| 4388 <application>QuickTime</application>-compatible files</title> | |
| 4389 | |
| 4390 | |
| 4391 <sect2 id="menc-feat-quicktime-7-why-use-it"> | |
| 4392 <title>Why would one want to produce <application>QuickTime</application>-compatible Files?</title> | |
| 4393 | |
| 4394 <para> | |
| 4395 There are several reasons why producing | |
| 4396 <application>QuickTime</application>-compatible files can be desirable. | |
| 4397 </para> | |
| 4398 <itemizedlist> | |
| 4399 <listitem><para> | |
| 4400 You want any computer illiterate to be able to watch your encode on | |
| 4401 any major platform (Windows, Mac OS X, Unices …). | |
| 4402 </para></listitem> | |
| 4403 <listitem><para> | |
| 4404 <application>QuickTime</application> is able to take advantage of more | |
| 4405 hardware and software acceleration features of Mac OS X than | |
| 4406 platform-independent players like <application>MPlayer</application> | |
| 4407 or <application>VLC</application>. | |
| 4408 That means that your encodes have a chance to be played smoothly by older | |
| 4409 G4-powered machines. | |
| 4410 </para></listitem> | |
| 4411 <listitem><para> | |
| 4412 <application>QuickTime</application> 7 supports the next-generation codec H.264, | |
| 4413 which yields significantly better picture quality than previous codec | |
| 4414 generations (MPEG-2, MPEG-4 …). | |
| 4415 </para></listitem> | |
| 4416 </itemizedlist> | |
| 4417 </sect2> | |
| 4418 | |
| 4419 <sect2 id="menc-feat-quicktime-7-constraints"> | |
| 4420 <title><application>QuickTime</application> 7 limitations</title> | |
| 4421 | |
| 4422 <para> | |
| 4423 <application>QuickTime</application> 7 supports H.264 video and AAC audio, | |
| 4424 but it does not support them muxed in the AVI container format. | |
| 4425 However, you can use <application>MEncoder</application> to encode | |
| 4426 the video and audio, and then use an external program such as | |
| 4427 <application>mp4creator</application> (part of the | |
| 4428 <ulink url="http://mpeg4ip.sourceforge.net/">MPEG4IP suite</ulink>) | |
| 4429 to remux the video and audio tracks into an MP4 container. | |
| 4430 </para> | |
| 4431 | |
| 4432 <para> | |
| 4433 <application>QuickTime</application>'s support for H.264 is limited, | |
| 4434 so you will need to drop some advanced features. | |
| 4435 If you encode your video with features that | |
| 4436 <application>QuickTime</application> 7 does not support, | |
| 4437 <application>QuickTime</application>-based players will show you a pretty | |
| 4438 white screen instead of your expected video. | |
| 4439 </para> | |
| 4440 | |
| 4441 <itemizedlist> | |
| 4442 <listitem><para> | |
| 4443 <emphasis role="bold">B-frames</emphasis>: | |
| 4444 <application>QuickTime</application> 7 supports a maximum of 1 B-frame, i.e. | |
| 4445 <option>-x264encopts bframes=1</option>. This means that | |
| 4446 <option>b_pyramid</option> and <option>weight_b</option> will have no | |
| 4447 effect, since they require <option>bframes</option> to be greater than 1. | |
| 4448 </para></listitem> | |
| 4449 <listitem><para> | |
| 4450 <emphasis role="bold">Macroblocks</emphasis>: | |
| 4451 <application>QuickTime</application> 7 does not support 8x8 DCT macroblocks. | |
| 4452 This option (<option>8x8dct</option>) is off by default, so just be sure | |
| 4453 not to explicitly enable it. This also means that the <option>i8x8</option> | |
| 4454 option will have no effect, since it requires <option>8x8dct</option>. | |
| 4455 </para></listitem> | |
| 4456 <listitem><para> | |
| 4457 <emphasis role="bold">Aspect ratio</emphasis>: | |
| 4458 <application>QuickTime</application> 7 does not support SAR (sample | |
| 4459 aspect ratio) information in MPEG-4 files; it assumes that SAR=1. Read | |
| 4460 <link linkend="menc-feat-quicktime-7-scale">the section on scaling</link> | |
| 4461 for a workaround. | |
| 4462 </para></listitem> | |
| 4463 </itemizedlist> | |
| 4464 | |
| 4465 </sect2> | |
| 4466 | |
| 4467 <sect2 id="menc-feat-quicktime-7-crop"> | |
| 4468 <title>Cropping</title> | |
| 4469 <para> | |
| 4470 Suppose you want to rip your freshly bought copy of "The Chronicles of | |
| 4471 Narnia". Your DVD is region 1, | |
| 4472 which means it is NTSC. The example below would still apply to PAL, | |
| 4473 except you would omit <option>-ofps 24000/1001</option> and use slightly | |
| 4474 different <option>crop</option> and <option>scale</option> dimensions. | |
| 4475 </para> | |
| 4476 | |
| 4477 <para> | |
| 4478 After running <option>mplayer dvd://1</option>, you follow the process | |
| 4479 detailed in the section <link linkend="menc-feat-telecine">How to deal | |
| 4480 with telecine and interlacing in NTSC DVDs</link> and discover that it is | |
| 4481 24000/1001 fps progressive video. This simplifies the process somewhat, | |
| 4482 since you do not need to use an inverse telecine filter such as | |
| 4483 <option>pullup</option> or a deinterlacing filter such as | |
| 4484 <option>yadif</option>. | |
| 4485 </para> | |
| 4486 | |
| 4487 <para> | |
| 4488 Next, you need to crop out the black bars from the top and bottom of the | |
| 4489 video, as detailed in <link linkend="menc-feat-dvd-mpeg4-example-crop">this</link> | |
| 4490 previous section. | |
| 4491 </para> | |
| 4492 | |
| 4493 </sect2> | |
| 4494 | |
| 4495 <sect2 id="menc-feat-quicktime-7-scale"> | |
| 4496 <title>Scaling</title> | |
| 4497 | |
| 4498 <para> | |
| 4499 The next step is truly heartbreaking. | |
| 4500 <application>QuickTime</application> 7 does not support MPEG-4 videos | |
| 4501 with a sample aspect ratio other than 1, so you will need to upscale | |
| 4502 (which wastes a lot of disk space) or downscale (which loses some | |
| 4503 details of the source) the video to square pixels. | |
| 4504 Either way you do it, this is highly inefficient, but simply cannot | |
| 4505 be avoided if you want your video to be playable by | |
| 4506 <application>QuickTime</application> 7. | |
| 4507 <application>MEncoder</application> can apply the appropriate upscaling | |
| 4508 or downscaling by specifying respectively <option>-vf scale=-10:-1</option> | |
| 4509 or <option>-vf scale=-1:-10</option>. | |
| 4510 This will scale your video to the correct width for the cropped height, | |
| 4511 rounded to the closest multiple of 16 for optimal compression. | |
| 4512 Remember that if you are cropping, you should crop first, then scale: | |
| 4513 | |
| 4514 <screen>-vf crop=720:352:0:62,scale=-10:-1</screen> | |
| 4515 </para> | |
| 4516 | |
| 4517 </sect2> | |
| 4518 | |
| 4519 <sect2 id="menc-feat-quicktime-7-avsync"> | |
| 4520 <title>A/V sync</title> | |
| 4521 | |
| 4522 <para> | |
| 4523 Because you will be remuxing into a different container, you should | |
| 4524 always use the <option>harddup</option> option to ensure that duplicated | |
| 4525 frames are actually duplicated in the video output. Without this option, | |
| 4526 <application>MEncoder</application> will simply put a marker in the video | |
| 4527 stream that a frame was duplicated, and rely on the client software to | |
| 4528 show the same frame twice. Unfortunately, this "soft duplication" does | |
| 4529 not survive remuxing, so the audio would slowly lose sync with the video. | |
| 4530 </para> | |
| 4531 | |
| 4532 <para> | |
| 4533 The final filter chain looks like this: | |
| 4534 <screen>-vf crop=720:352:0:62,scale=-10:-1,harddup</screen> | |
| 4535 </para> | |
| 4536 | |
| 4537 </sect2> | |
| 4538 | |
| 4539 <sect2 id="menc-feat-quicktime-7-bitrate"> | |
| 4540 <title>Bitrate</title> | |
| 4541 | |
| 4542 <para> | |
| 4543 As always, the selection of bitrate is a matter of the technical properties | |
| 4544 of the source, as explained | |
| 4545 <link linkend="menc-feat-dvd-mpeg4-resolution-bitrate">here</link>, as | |
| 4546 well as a matter of taste. | |
| 4547 This movie has a fair bit of action and lots of detail, but H.264 video | |
| 4548 looks good at much lower bitrates than XviD or other MPEG-4 codecs. | |
| 4549 After much experimentation, the author of this guide chose to encode | |
| 4550 this movie at 900kbps, and thought that it looked very good. | |
| 4551 You may decrease bitrate if you need to save more space, or increase | |
| 4552 it if you need to improve quality. | |
| 4553 </para> | |
| 4554 | |
| 4555 </sect2> | |
| 4556 | |
| 4557 <sect2 id="menc-feat-quicktime-7-example"> | |
| 4558 <title>Encoding example</title> | |
| 4559 | |
| 4560 <para> | |
| 4561 You are now ready to encode the video. Since you care about | |
| 4562 quality, of course you will be doing a two-pass encode. To shave off | |
| 4563 some encoding time, you can specify the <option>turbo</option> option | |
| 4564 on the first pass; this reduces <option>subq</option> and | |
| 4565 <option>frameref</option> to 1. To save some disk space, you can | |
| 4566 use the <option>ss</option> option to strip off the first few seconds | |
| 4567 of the video. (I found that this particular movie has 32 seconds of | |
| 4568 credits and logos.) <option>bframes</option> can be 0 or 1. | |
| 4569 The other options are documented in <link | |
| 4570 linkend="menc-feat-x264-encoding-options-speedvquality">Encoding with | |
| 4571 the <systemitem class="library">x264</systemitem> codec</link> and | |
| 4572 the man page. | |
| 4573 | |
| 4574 <screen>mencoder dvd://1 -o /dev/null -ss 32 -ovc x264 \ | |
| 4575 -x264encopts pass=1:turbo:bitrate=900:bframes=1:\ | |
| 4576 me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \ | |
| 4577 -vf crop=720:352:0:62,scale=-10:-1,harddup \ | |
| 4578 -oac faac -faacopts br=192:mpeg=4:object=1 -channels 2 -srate 48000 \ | |
| 4579 -ofps 24000/1001</screen> | |
| 4580 | |
| 4581 If you have a multi-processor machine, don't miss the opportunity to | |
| 4582 dramatically speed-up encoding by enabling | |
| 4583 <link linkend="menc-feat-x264-encoding-options-speedvquality-threads"> | |
| 4584 <systemitem class="library">x264</systemitem>'s multi-threading mode</link> | |
| 4585 by adding <option>threads=auto</option> to your <option>x264encopts</option> | |
| 4586 command-line. | |
| 4587 </para> | |
| 4588 | |
| 4589 <para> | |
| 4590 The second pass is the same, except that you specify the output file | |
| 4591 and set <option>pass=2</option>. | |
| 4592 | |
| 4593 <screen>mencoder dvd://1 <emphasis role="bold">-o narnia.avi</emphasis> -ss 32 -ovc x264 \ | |
| 4594 -x264encopts <emphasis role="bold">pass=2</emphasis>:turbo:bitrate=900:frameref=5:bframes=1:\ | |
| 4595 me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300 \ | |
| 4596 -vf crop=720:352:0:62,scale=-10:-1,harddup \ | |
| 4597 -oac faac -faacopts br=192:mpeg=4:object=1 -channels 2 -srate 48000 \ | |
| 4598 -ofps 24000/1001</screen> | |
| 4599 </para> | |
| 4600 | |
| 4601 <para> | |
| 4602 The resulting AVI should play perfectly in | |
| 4603 <application>MPlayer</application>, but of course | |
| 4604 <application>QuickTime</application> can not play it because it does | |
| 4605 not support H.264 muxed in AVI. | |
| 4606 So the next step is to remux the video into an MP4 container. | |
| 4607 </para> | |
| 4608 </sect2> | |
| 4609 | |
| 4610 <sect2 id="menc-feat-quicktime-7-remux"> | |
| 4611 <title>Remuxing as MP4</title> | |
| 4612 | |
| 4613 <para> | |
| 4614 There are several ways to remux AVI files to MP4. You can use | |
| 4615 <application>mp4creator</application>, which is part of the | |
| 4616 <ulink url="http://mpeg4ip.sourceforge.net/">MPEG4IP suite</ulink>. | |
| 4617 </para> | |
| 4618 | |
| 4619 <para> | |
| 4620 First, demux the AVI into separate audio and video streams using | |
| 4621 <application>MPlayer</application>. | |
| 4622 | |
| 4623 <screen>mplayer narnia.avi -dumpaudio -dumpfile narnia.aac | |
| 4624 mplayer narnia.avi -dumpvideo -dumpfile narnia.h264</screen> | |
| 4625 | |
| 4626 The filenames are important; <application>mp4creator</application> | |
| 4627 requires that AAC audio streams be named <systemitem>.aac</systemitem> | |
| 4628 and H.264 video streams be named <systemitem>.h264</systemitem>. | |
| 4629 </para> | |
| 4630 | |
| 4631 <para> | |
| 4632 Now use <application>mp4creator</application> to create a new | |
| 4633 MP4 file out of the audio and video streams. | |
| 4634 | |
| 4635 <screen>mp4creator -create=narnia.aac narnia.mp4 | |
| 4636 mp4creator -create=narnia.h264 -rate=23.976 narnia.mp4</screen> | |
| 4637 | |
| 4638 Unlike the encoding step, you must specify the framerate as a | |
| 4639 decimal (such as 23.976), not a fraction (such as 24000/1001). | |
| 4640 </para> | |
| 4641 | |
| 4642 <para> | |
| 4643 This <systemitem>narnia.mp4</systemitem> file should now be playable | |
| 4644 with any <application>QuickTime</application> 7 application, such as | |
| 4645 <application>QuickTime Player</application> or | |
| 4646 <application>iTunes</application>. If you are planning to view the | |
| 4647 video in a web browser with the <application>QuickTime</application> | |
| 4648 plugin, you should also hint the movie so that the | |
| 4649 <application>QuickTime</application> plugin can start playing it | |
| 4650 while it is still downloading. <application>mp4creator</application> | |
| 4651 can create these hint tracks: | |
| 4652 | |
| 4653 <screen>mp4creator -hint=1 narnia.mp4 | |
| 4654 mp4creator -hint=2 narnia.mp4 | |
| 4655 mp4creator -optimize narnia.mp4</screen> | |
| 4656 | |
| 4657 You can check the final result to ensure that the hint tracks were | |
| 4658 created successfully: | |
| 4659 | |
| 4660 <screen>mp4creator -list narnia.mp4</screen> | |
| 4661 | |
| 4662 You should see a list of tracks: 1 audio, 1 video, and 2 hint tracks. | |
| 4663 | |
| 4664 <screen>Track Type Info | |
| 4665 1 audio MPEG-4 AAC LC, 8548.714 secs, 190 kbps, 48000 Hz | |
| 4666 2 video H264 Main@5.1, 8549.132 secs, 899 kbps, 848x352 @ 23.976001 fps | |
| 4667 3 hint Payload mpeg4-generic for track 1 | |
| 4668 4 hint Payload H264 for track 2 | |
| 4669 </screen> | |
| 4670 </para> | |
| 4671 | |
| 4672 </sect2> | |
| 4673 | |
| 4674 <sect2 id="menc-feat-quicktime-7-metadata"> | |
| 4675 <title>Adding metadata tags</title> | |
| 4676 | |
| 4677 <para> | |
| 4678 If you want to add tags to your video that show up in iTunes, you can use | |
| 4679 <ulink url="http://atomicparsley.sourceforge.net/">AtomicParsley</ulink>. | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4680 |
| 25279 | 4681 <screen>AtomicParsley narnia.mp4 --metaEnema --title "The Chronicles of Narnia" --year 2005 --stik Movie --freefree --overWrite</screen> |
| 4682 | |
| 4683 The <option>--metaEnema</option> option removes any existing metadata | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4684 (<application>mp4creator</application> inserts its name in the |
| 25279 | 4685 "encoding tool" tag), and <option>--freefree</option> reclaims the |
| 4686 space from the deleted metadata. | |
| 4687 The <option>--stik</option> option sets the type of video (such as Movie | |
| 4688 or TV Show), which iTunes uses to group related video files. | |
| 4689 The <option>--overWrite</option> option overwrites the original file; | |
| 4690 without it, <application>AtomicParsley</application> creates a new | |
| 4691 auto-named file in the same directory and leaves the original file | |
| 4692 untouched. | |
| 4693 </para> | |
| 4694 | |
| 4695 </sect2> | |
| 4696 | |
| 4697 </sect1> | |
| 4698 | |
| 4699 | |
| 4700 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> | |
| 4701 | |
| 4702 | |
| 4703 <sect1 id="menc-feat-vcd-dvd"> | |
| 4704 <title>Using <application>MEncoder</application> | |
| 4705 to create VCD/SVCD/DVD-compliant files</title> | |
| 4706 | |
| 4707 <sect2 id="menc-feat-vcd-dvd-constraints"> | |
| 4708 <title>Format Constraints</title> | |
| 4709 | |
| 4710 <para> | |
| 4711 <application>MEncoder</application> is capable of creating VCD, SCVD | |
| 4712 and DVD format MPEG files using the | |
| 4713 <systemitem class="library">libavcodec</systemitem> library. | |
| 4714 These files can then be used in conjunction with | |
| 4715 <ulink url="http://www.gnu.org/software/vcdimager/vcdimager.html">vcdimager</ulink> | |
| 4716 or | |
| 4717 <ulink url="http://dvdauthor.sourceforge.net/">dvdauthor</ulink> | |
| 4718 to create discs that will play on a standard set-top player. | |
| 4719 </para> | |
| 4720 | |
| 4721 <para> | |
| 4722 The DVD, SVCD, and VCD formats are subject to heavy constraints. | |
| 4723 Only a small selection of encoded picture sizes and aspect ratios are | |
| 4724 available. | |
| 4725 If your movie does not already meet these requirements, you may have | |
| 4726 to scale, crop or add black borders to the picture to make it | |
| 4727 compliant. | |
| 4728 </para> | |
| 4729 | |
| 4730 | |
| 4731 <sect3 id="menc-feat-vcd-dvd-constraints-resolution"> | |
| 4732 <title>Format Constraints</title> | |
| 4733 | |
| 4734 <informaltable frame="all"> | |
| 4735 <tgroup cols="9"> | |
| 4736 <thead> | |
| 4737 <row> | |
| 4738 <entry>Format</entry> | |
| 4739 <entry>Resolution</entry> | |
| 4740 <entry>V. Codec</entry> | |
| 4741 <entry>V. Bitrate</entry> | |
| 4742 <entry>Sample Rate</entry> | |
| 4743 <entry>A. Codec</entry> | |
| 4744 <entry>A. Bitrate</entry> | |
| 4745 <entry>FPS</entry> | |
| 4746 <entry>Aspect</entry> | |
| 4747 </row> | |
| 4748 </thead> | |
| 4749 <tbody> | |
| 4750 <row> | |
| 4751 <entry>NTSC DVD</entry> | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4752 <entry>720x480, 704x480, 352x480, 352x240</entry> |
| 25279 | 4753 <entry>MPEG-2</entry> |
| 4754 <entry>9800 kbps</entry> | |
| 4755 <entry>48000 Hz</entry> | |
| 4756 <entry>AC-3,PCM</entry> | |
| 4757 <entry>1536 kbps (max)</entry> | |
| 4758 <entry>30000/1001, 24000/1001</entry> | |
| 4759 <entry>4:3, 16:9 (only for 720x480)</entry> | |
| 4760 </row> | |
| 4761 <row> | |
| 4762 <entry>NTSC DVD</entry> | |
| 4763 <entry>352x240<footnote id='fn-rare-resolutions'><para> | |
| 4764 These resolutions are rarely used for DVDs because | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4765 they are fairly low quality.</para></footnote></entry> |
| 25279 | 4766 <entry>MPEG-1</entry> |
| 4767 <entry>1856 kbps</entry> | |
| 4768 <entry>48000 Hz</entry> | |
| 4769 <entry>AC-3,PCM</entry> | |
| 4770 <entry>1536 kbps (max)</entry> | |
| 4771 <entry>30000/1001, 24000/1001</entry> | |
| 4772 <entry>4:3, 16:9</entry> | |
| 4773 </row> | |
| 4774 <row> | |
| 4775 <entry>NTSC SVCD</entry> | |
| 4776 <entry>480x480</entry> | |
| 4777 <entry>MPEG-2</entry> | |
| 4778 <entry>2600 kbps</entry> | |
| 4779 <entry>44100 Hz</entry> | |
| 4780 <entry>MP2</entry> | |
| 4781 <entry>384 kbps (max)</entry> | |
| 4782 <entry>30000/1001</entry> | |
| 4783 <entry>4:3</entry> | |
| 4784 </row> | |
| 4785 <row> | |
| 4786 <entry>NTSC VCD</entry> | |
| 4787 <entry>352x240</entry> | |
| 4788 <entry>MPEG-1</entry> | |
| 4789 <entry>1150 kbps</entry> | |
| 4790 <entry>44100 Hz</entry> | |
| 4791 <entry>MP2</entry> | |
| 4792 <entry>224 kbps</entry> | |
| 4793 <entry>24000/1001, 30000/1001</entry> | |
| 4794 <entry>4:3</entry> | |
| 4795 </row> | |
| 4796 <row> | |
| 4797 <entry>PAL DVD</entry> | |
| 4798 <entry>720x576, 704x576, 352x576, 352x288</entry> | |
| 4799 <entry>MPEG-2</entry> | |
| 4800 <entry>9800 kbps</entry> | |
| 4801 <entry>48000 Hz</entry> | |
| 4802 <entry>MP2,AC-3,PCM</entry> | |
| 4803 <entry>1536 kbps (max)</entry> | |
| 4804 <entry>25</entry> | |
| 4805 <entry>4:3, 16:9 (only for 720x576)</entry> | |
| 4806 </row> | |
| 4807 <row> | |
| 4808 <entry>PAL DVD</entry> | |
| 4809 <entry>352x288<footnoteref linkend='fn-rare-resolutions'/></entry> | |
| 4810 <entry>MPEG-1</entry> | |
| 4811 <entry>1856 kbps</entry> | |
| 4812 <entry>48000 Hz</entry> | |
| 4813 <entry>MP2,AC-3,PCM</entry> | |
| 4814 <entry>1536 kbps (max)</entry> | |
| 4815 <entry>25</entry> | |
| 4816 <entry>4:3, 16:9</entry> | |
| 4817 </row> | |
| 4818 <row> | |
| 4819 <entry>PAL SVCD</entry> | |
| 4820 <entry>480x576</entry> | |
| 4821 <entry>MPEG-2</entry> | |
| 4822 <entry>2600 kbps</entry> | |
| 4823 <entry>44100 Hz</entry> | |
| 4824 <entry>MP2</entry> | |
| 4825 <entry>384 kbps (max)</entry> | |
| 4826 <entry>25</entry> | |
| 4827 <entry>4:3</entry> | |
| 4828 </row> | |
| 4829 <row> | |
| 4830 <entry>PAL VCD</entry> | |
| 4831 <entry>352x288</entry> | |
| 4832 <entry>MPEG-1</entry> | |
| 4833 <entry>1152 kbps</entry> | |
| 4834 <entry>44100 Hz</entry> | |
| 4835 <entry>MP2</entry> | |
| 4836 <entry>224 kbps</entry> | |
| 4837 <entry>25</entry> | |
| 4838 <entry>4:3</entry> | |
| 4839 </row> | |
| 4840 </tbody> | |
| 4841 </tgroup> | |
| 4842 </informaltable> | |
| 4843 | |
| 4844 <para> | |
| 4845 If your movie has 2.35:1 aspect (most recent action movies), you will | |
| 4846 have to add black borders or crop the movie down to 16:9 to make a DVD or VCD. | |
| 4847 If you add black borders, try to align them at 16-pixel boundaries in | |
| 4848 order to minimize the impact on encoding performance. | |
| 4849 Thankfully DVD has sufficiently excessive bitrate that you do not have | |
| 4850 to worry too much about encoding efficiency, but SVCD and VCD are | |
| 4851 highly bitrate-starved and require effort to obtain acceptable quality. | |
| 4852 </para> | |
| 4853 </sect3> | |
| 4854 | |
| 4855 | |
| 4856 <sect3 id="menc-feat-vcd-dvd-constraints-gop"> | |
| 4857 <title>GOP Size Constraints</title> | |
| 4858 | |
| 4859 <para> | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4860 DVD, VCD, and SVCD also constrain you to relatively low |
| 25279 | 4861 GOP (Group of Pictures) sizes. |
| 4862 For 30 fps material the largest allowed GOP size is 18. | |
| 4863 For 25 or 24 fps, the maximum is 15. | |
| 4864 The GOP size is set using the <option>keyint</option> option. | |
| 4865 </para> | |
| 4866 </sect3> | |
| 4867 | |
| 4868 | |
| 4869 <sect3 id="menc-feat-vcd-dvd-constraints-bitrate"> | |
| 4870 <title>Bitrate Constraints</title> | |
| 4871 | |
| 4872 <para> | |
| 4873 VCD video is required to be CBR at 1152 kbps. | |
| 4874 This highly limiting constraint also comes along with an extremly low vbv | |
| 4875 buffer size of 327 kilobits. | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4876 SVCD allows varying video bitrates up to 2500 kbps, and a somewhat less |
| 25279 | 4877 restrictive vbv buffer size of 917 kilobits is allowed. |
| 4878 DVD video bitrates may range anywhere up to 9800 kbps (though typical | |
| 4879 bitrates are about half that), and the vbv buffer size is 1835 kilobits. | |
| 4880 </para> | |
| 4881 </sect3> | |
| 4882 </sect2> | |
| 4883 | |
| 4884 <!-- ********** --> | |
| 4885 | |
| 4886 <sect2 id="menc-feat-vcd-dvd-output"> | |
| 4887 <title>Output Options</title> | |
| 4888 | |
| 4889 <para> | |
| 4890 <application>MEncoder</application> has options to control the output | |
| 4891 format. | |
| 4892 Using these options we can instruct it to create the correct type of | |
| 4893 file. | |
| 4894 </para> | |
| 4895 | |
| 4896 <para> | |
| 4897 The options for VCD and SVCD are called xvcd and xsvcd, because they | |
| 4898 are extended formats. | |
| 4899 They are not strictly compliant, mainly because the output does not | |
| 4900 contain scan offsets. | |
| 4901 If you need to generate an SVCD image, you should pass the output file to | |
| 4902 <ulink url="http://www.gnu.org/software/vcdimager/vcdimager.html">vcdimager</ulink>. | |
| 4903 </para> | |
| 4904 | |
| 4905 <para> | |
| 4906 VCD: | |
| 4907 <screen>-of mpeg -mpegopts format=xvcd</screen> | |
| 4908 </para> | |
| 4909 | |
| 4910 <para> | |
| 4911 SVCD: | |
| 4912 <screen>-of mpeg -mpegopts format=xsvcd</screen> | |
| 4913 </para> | |
| 4914 | |
| 4915 <para> | |
| 4916 DVD (with timestamps on every frame, if possible): | |
| 4917 <screen>-of mpeg -mpegopts format=dvd:tsaf</screen> | |
| 4918 </para> | |
| 4919 | |
| 4920 <para> | |
| 4921 DVD with NTSC Pullup: | |
| 4922 <screen>-of mpeg -mpegopts format=dvd:tsaf:telecine -ofps 24000/1001</screen> | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4923 This allows 24000/1001 fps progressive content to be encoded at 30000/1001 |
| 25279 | 4924 fps whilst maintaing DVD-compliance. |
| 4925 </para> | |
| 4926 | |
| 4927 | |
| 4928 <sect3 id="menc-feat-vcd-dvd-output-aspect"> | |
| 4929 <title>Aspect Ratio</title> | |
| 4930 | |
| 4931 <para> | |
| 4932 The aspect argument of <option>-lavcopts</option> is used to encode | |
| 4933 the aspect ratio of the file. | |
| 4934 During playback the aspect ratio is used to restore the video to the | |
| 4935 correct size. | |
| 4936 </para> | |
| 4937 | |
| 4938 <para> | |
| 4939 16:9 or "Widescreen" | |
| 4940 <screen>-lavcopts aspect=16/9</screen> | |
| 4941 </para> | |
| 4942 | |
| 4943 <para> | |
| 4944 4:3 or "Fullscreen" | |
| 4945 <screen>-lavcopts aspect=4/3</screen> | |
| 4946 </para> | |
| 4947 | |
| 4948 <para> | |
| 4949 2.35:1 or "Cinemascope" NTSC | |
| 4950 <screen>-vf scale=720:368,expand=720:480 -lavcopts aspect=16/9</screen> | |
| 4951 To calculate the correct scaling size, use the expanded NTSC width of | |
| 4952 854/2.35 = 368 | |
| 4953 </para> | |
| 4954 | |
| 4955 <para> | |
| 4956 2.35:1 or "Cinemascope" PAL | |
| 4957 <screen>-vf scale=720:432,expand=720:576 -lavcopts aspect=16/9</screen> | |
| 4958 To calculate the correct scaling size, use the expanded PAL width of | |
| 4959 1024/2.35 = 432 | |
| 4960 </para> | |
| 4961 </sect3> | |
| 4962 | |
| 4963 | |
| 4964 <sect3 id="menc-feat-vcd-dvd-a-v-sync"> | |
| 4965 <title>Maintaining A/V sync</title> | |
| 4966 | |
| 4967 <para> | |
| 4968 In order to maintain audio/video synchronization throughout the encode, | |
| 4969 <application>MEncoder</application> has to drop or duplicate frames. | |
| 4970 This works rather well when muxing into an AVI file, but is almost | |
| 4971 guaranteed to fail to maintain A/V sync with other muxers such as MPEG. | |
| 4972 This is why it is necessary to append the | |
| 4973 <option>harddup</option> video filter at the end of the filter chain | |
| 4974 to avoid this kind of problem. | |
| 4975 You can find more technical information about <option>harddup</option> | |
| 4976 in the section | |
| 4977 <link linkend="menc-feat-dvd-mpeg4-muxing-filter-issues">Improving muxing and A/V sync reliability</link> | |
| 4978 or in the manual page. | |
| 4979 </para> | |
| 4980 </sect3> | |
| 4981 | |
| 4982 | |
| 4983 <sect3 id="menc-feat-vcd-dvd-output-srate"> | |
| 4984 <title>Sample Rate Conversion</title> | |
| 4985 | |
| 4986 <para> | |
| 4987 If the audio sample rate in the original file is not the same as | |
| 4988 required by the target format, sample rate conversion is required. | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
4989 This is achieved using the <option>-srate</option> option and |
| 25279 | 4990 the <option>-af lavcresample</option> audio filter together. |
| 4991 </para> | |
| 4992 | |
| 4993 <para> | |
| 4994 DVD: | |
| 4995 <screen>-srate 48000 -af lavcresample=48000</screen> | |
| 4996 </para> | |
| 4997 | |
| 4998 <para> | |
| 4999 VCD and SVCD: | |
| 5000 <screen>-srate 44100 -af lavcresample=44100</screen> | |
| 5001 </para> | |
| 5002 </sect3> | |
| 5003 </sect2> | |
| 5004 | |
| 5005 <!-- ********** --> | |
| 5006 | |
| 5007 <sect2 id="menc-feat-vcd-dvd-lavc"> | |
| 5008 <title>Using libavcodec for VCD/SVCD/DVD Encoding</title> | |
| 5009 | |
| 5010 <sect3 id="menc-feat-vcd-dvd-lavc-intro"> | |
| 5011 <title>Introduction</title> | |
| 5012 | |
| 5013 <para> | |
| 5014 <systemitem class="library">libavcodec</systemitem> can be used to | |
| 5015 create VCD/SVCD/DVD compliant video by using the appropriate options. | |
| 5016 </para> | |
| 5017 </sect3> | |
| 5018 | |
| 5019 | |
| 5020 <sect3 id="menc-feat-vcd-dvd-lavc-options"> | |
| 5021 <title>lavcopts</title> | |
| 5022 | |
| 5023 <para> | |
| 5024 This is a list of fields in <option>-lavcopts</option> that you may | |
| 5025 be required to change in order to make a complaint movie for VCD, SVCD, | |
| 5026 or DVD: | |
| 5027 </para> | |
| 5028 | |
| 5029 <itemizedlist> | |
| 5030 <listitem><para> | |
| 5031 <emphasis role="bold">acodec</emphasis>: | |
| 5032 <option>mp2</option> for VCD, SVCD, or PAL DVD; | |
| 5033 <option>ac3</option> is most commonly used for DVD. | |
| 5034 PCM audio may also be used for DVD, but this is mostly a big waste of | |
| 5035 space. | |
| 5036 Note that MP3 audio is not compliant for any of these formats, but | |
| 5037 players often have no problem playing it anyway. | |
| 5038 </para></listitem> | |
| 5039 <listitem><para> | |
| 5040 <emphasis role="bold">abitrate</emphasis>: | |
| 5041 224 for VCD; up to 384 for SVCD; up to 1536 for DVD, but commonly | |
| 5042 used values range from 192 kbps for stereo to 384 kbps for 5.1 channel | |
| 5043 sound. | |
| 5044 </para></listitem> | |
| 5045 <listitem><para> | |
| 5046 <emphasis role="bold">vcodec</emphasis>: | |
| 5047 <option>mpeg1video</option> for VCD; | |
| 5048 <option>mpeg2video</option> for SVCD; | |
| 5049 <option>mpeg2video</option> is usually used for DVD but you may also use | |
| 5050 <option>mpeg1video</option> for CIF resolutions. | |
| 5051 </para></listitem> | |
| 5052 <listitem><para> | |
| 5053 <emphasis role="bold">keyint</emphasis>: | |
| 5054 Used to set the GOP size. | |
| 5055 18 for 30fps material, or 15 for 25/24 fps material. | |
| 5056 Commercial producers seem to prefer keyframe intervals of 12. | |
|
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28476
diff
changeset
|
5057 It is possible to make this much larger and still retain compatibility |
| 25279 | 5058 with most players. |
| 5059 A <option>keyint</option> of 25 should never cause any problems. | |
| 5060 </para></listitem> | |
| 5061 <listitem><para> | |
| 5062 <emphasis role="bold">vrc_buf_size</emphasis>: | |
| 5063 327 for VCD, 917 for SVCD, and 1835 for DVD. | |
| 5064 </para></listitem> | |
| 5065 <listitem><para> | |
| 5066 <emphasis role="bold">vrc_minrate</emphasis>: | |
| 5067 1152, for VCD. May be left alone for SVCD and DVD. | |
| 5068 </para></listitem> | |
| 5069 <listitem><para> | |
| 5070 <emphasis role="bold">vrc_maxrate</emphasis>: | |
| 5071 1152 for VCD; 2500 for SVCD; 9800 for DVD. | |
| 5072 For SVCD and DVD, you might wish to use lower values depending on your | |
| 5073 own personal preferences and requirements. | |
| 5074 </para></listitem> | |
| 5075 <listitem><para> | |
| 5076 <emphasis role="bold">vbitrate</emphasis>: | |
| 5077 1152 for VCD; | |
| 5078 up to 2500 for SVCD; | |
| 5079 up to 9800 for DVD. | |
| 5080 For the latter two formats, vbitrate should be set based on personal | |
| 5081 preference. | |
| 5082 For instance, if you insist on fitting 20 or so hours on a DVD, you | |
| 5083 could use vbitrate=400. | |
| 5084 The resulting video quality would probably be quite bad. | |
| 5085 If you are trying to squeeze out the maximum possible quality on a DVD, | |
| 5086 use vbitrate=9800, but be warned that this could constrain you to less | |
| 5087 than an hour of video on a single-layer DVD. | |
| 5088 </para></listitem> | |
| 5089 <listitem><para> | |
| 5090 <emphasis role="bold">vstrict</emphasis>: | |
| 5091 <option>vstrict</option>=0 should be used to create DVDs. | |
| 5092 Without this option, <application>MEncoder</application> creates a | |
| 5093 stream that cannot be correctly decoded by some standalone DVD | |
| 5094 players. | |
| 5095 </para></listitem> | |
| 5096 </itemizedlist> | |
| 5097 </sect3> | |
| 5098 | |
| 5099 | |
| 5100 <sect3 id="menc-feat-vcd-dvd-lavc-examples"> | |
| 5101 <title>Examples</title> | |
| 5102 | |
| 5103 <para> | |
| 5104 This is a typical minimum set of <option>-lavcopts</option> for | |
| 5105 encoding video: | |
| 5106 </para> | |
| 5107 <para> | |
| 5108 VCD: | |
| 5109 <screen> | |
| 5110 -lavcopts vcodec=mpeg1video:vrc_buf_size=327:vrc_minrate=1152:\ | |
| 5111 vrc_maxrate=1152:vbitrate=1152:keyint=15:acodec=mp2 | |
| 5112 </screen> | |
| 5113 </para> | |
| 5114 | |
| 5115 <para> | |
| 5116 SVCD: | |
| 5117 <screen> | |
| 5118 -lavcopts vcodec=mpeg2video:vrc_buf_size=917:vrc_maxrate=2500:vbitrate=1800:\ | |
| 5119 keyint=15:acodec=mp2 | |
| 5120 </screen> | |
| 5121 </para> | |
| 5122 | |
| 5123 <para> | |
| 5124 DVD: | |
| 5125 <screen> | |
| 5126 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\ | |
| 5127 keyint=15:vstrict=0:acodec=ac3 | |
| 5128 </screen> | |
| 5129 </para> | |
| 5130 </sect3> | |
| 5131 | |
| 5132 | |
| 5133 <sect3 id="menc-feat-vcd-dvd-lavc-advanced"> | |
| 5134 <title>Advanced Options</title> | |
| 5135 | |
| 5136 <para> | |
| 5137 For higher quality encoding, you may also wish to add quality-enhancing | |
| 5138 options to lavcopts, such as <option>trell</option>, | |
| 5139 <option>mbd=2</option>, and others. | |
| 5140 Note that <option>qpel</option> and <option>v4mv</option>, while often | |
| 5141 useful with MPEG-4, are not usable with MPEG-1 or MPEG-2. | |
| 5142 Also, if you are trying to make a very high quality DVD encode, it may | |
| 5143 be useful to add <option>dc=10</option> to lavcopts. | |
| 5144 Doing so may help reduce the appearance of blocks in flat-colored areas. | |
| 5145 Putting it all together, this is an example of a set of lavcopts for a | |
| 5146 higher quality DVD: | |
| 5147 </para> | |
| 5148 | |
| 5149 <para> | |
| 5150 <screen> | |
| 5151 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=8000:\ | |
| 5152 keyint=15:trell:mbd=2:precmp=2:subcmp=2:cmp=2:dia=-10:predia=-10:cbp:mv0:\ | |
| 5153 vqmin=1:lmin=1:dc=10:vstrict=0 | |
| 5154 </screen> | |
| 5155 </para> | |
| 5156 </sect3> | |
| 5157 </sect2> | |
| 5158 | |
| 5159 <!-- ********** --> | |
| 5160 | |
| 5161 <sect2 id="menc-feat-vcd-dvd-audio"> | |
| 5162 <title>Encoding Audio</title> | |
| 5163 | |
| 5164 <para> | |
| 5165 VCD and SVCD support MPEG-1 layer II audio, using one of | |
| 5166 <systemitem class="library">toolame</systemitem>, | |
| 5167 <systemitem class="library">twolame</systemitem>, | |
| 5168 or <systemitem class="library">libavcodec</systemitem>'s MP2 encoder. | |
| 5169 The libavcodec MP2 is far from being as good as the other two libraries, | |
| 5170 however it should always be available to use. | |
| 5171 VCD only supports constant bitrate audio (CBR) whereas SVCD supports | |
| 5172 variable bitrate (VBR), too. | |
| 5173 Be careful when using VBR because some bad standalone players might not | |
| 5174 support it too well. | |
| 5175 </para> | |
| 5176 | |
| 5177 <para> | |
| 5178 For DVD audio, <systemitem class="library">libavcodec</systemitem>'s | |
| 5179 AC-3 codec is used. | |
| 5180 </para> | |
| 5181 | |
| 5182 | |
| 5183 <sect3 id="menc-feat-vcd-dvd-audio-toolame"> | |
| 5184 <title>toolame</title> | |
| 5185 | |
| 5186 <para> | |
| 5187 For VCD and SVCD: | |
| 5188 <screen>-oac toolame -toolameopts br=224</screen> | |
| 5189 </para> | |
| 5190 </sect3> | |
| 5191 | |
| 5192 | |
| 5193 <sect3 id="menc-feat-vcd-dvd-audio-twolame"> | |
| 5194 <title>twolame</title> | |
| 5195 | |
| 5196 <para> | |
| 5197 For VCD and SVCD: | |
| 5198 <screen>-oac twolame -twolameopts br=224</screen> | |
| 5199 </para> | |
| 5200 </sect3> | |
| 5201 | |
| 5202 | |
| 5203 <sect3 id="menc-feat-vcd-dvd-audio-lavc"> | |
| 5204 <title>libavcodec</title> | |
| 5205 | |
| 5206 <para> | |
| 5207 For DVD with 2 channel sound: | |
| 5208 <screen>-oac lavc -lavcopts acodec=ac3:abitrate=192</screen> | |
| 5209 </para> | |
| 5210 | |
| 5211 <para> | |
| 5212 For DVD with 5.1 channel sound: | |
| 5213 <screen>-channels 6 -oac lavc -lavcopts acodec=ac3:abitrate=384</screen> | |
| 5214 </para> | |
| 5215 | |
| 5216 <para> | |
| 5217 For VCD and SVCD: | |
| 5218 <screen>-oac lavc -lavcopts acodec=mp2:abitrate=224</screen> | |
| 5219 </para> | |
| 5220 </sect3> | |
| 5221 </sect2> | |
| 5222 | |
| 5223 <!-- ********** --> | |
| 5224 | |
| 5225 <sect2 id="menc-feat-vcd-dvd-all"> | |
| 5226 <title>Putting it all Together</title> | |
| 5227 | |
| 5228 <para> | |
| 5229 This section shows some complete commands for creating VCD/SVCD/DVD | |
| 5230 compliant videos. | |
| 5231 </para> | |
| 5232 | |
| 5233 | |
| 5234 <sect3 id="menc-feat-vcd-dvd-all-pal-dvd"> | |
| 5235 <title>PAL DVD</title> | |
| 5236 | |
| 5237 <para> | |
| 5238 <screen> | |
| 5239 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \ | |
| 5240 -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 \ | |
| 5241 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\ | |
| 5242 keyint=15:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 25 \ | |
| 5243 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
| 5244 </screen> | |
| 5245 </para> | |
| 5246 </sect3> | |
| 5247 | |
| 5248 | |
| 5249 <sect3 id="menc-feat-vcd-dvd-all-ntsc-dvd"> | |
| 5250 <title>NTSC DVD</title> | |
| 5251 | |
| 5252 <para> | |
| 5253 <screen> | |
| 5254 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \ | |
| 5255 -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 \ | |
| 5256 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\ | |
| 5257 keyint=18:vstrict=0:acodec=ac3:abitrate=192:aspect=16/9 -ofps 30000/1001 \ | |
| 5258 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
| 5259 </screen> | |
| 5260 </para> | |
| 5261 </sect3> | |
| 5262 | |
| 5263 | |
| 5264 <sect3 id="menc-feat-vcd-dvd-all-pal-ac3-copy"> | |
| 5265 <title>PAL AVI Containing AC-3 Audio to DVD</title> | |
| 5266 | |
| 5267 <para> | |
| 5268 If the source already has AC-3 audio, use -oac copy instead of re-encoding it. | |
| 5269 <screen> | |
| 5270 mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \ | |
| 5271 -vf scale=720:576,harddup -ofps 25 \ | |
| 5272 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:\ | |
| 5273 keyint=15:vstrict=0:aspect=16/9 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
| 5274 </screen> | |
| 5275 </para> | |
| 5276 </sect3> | |
| 5277 | |
| 5278 | |
| 5279 <sect3 id="menc-feat-vcd-dvd-all-ntsc-ac3-copy"> | |
| 5280 <title>NTSC AVI Containing AC-3 Audio to DVD</title> | |
| 5281 | |
| 5282 <para> | |
| 5283 If the source already has AC-3 audio, and is NTSC @ 24000/1001 fps: | |
| 5284 <screen> | |
| 5285 mencoder -oac copy -ovc lavc -of mpeg -mpegopts format=dvd:tsaf:telecine \ | |
| 5286 -vf scale=720:480,harddup -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:\ | |
| 5287 vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:aspect=16/9 -ofps 24000/1001 \ | |
| 5288 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
| 5289 </screen> | |
| 5290 </para> | |
| 5291 </sect3> | |
| 5292 | |
| 5293 | |
| 5294 <sect3 id="menc-feat-vcd-dvd-all-pal-svcd"> | |
| 5295 <title>PAL SVCD</title> | |
| 5296 | |
| 5297 <para> | |
| 5298 <screen> | |
| 5299 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd -vf \ | |
| 5300 scale=480:576,harddup -srate 44100 -af lavcresample=44100 -lavcopts \ | |
| 5301 vcodec=mpeg2video:mbd=2:keyint=15:vrc_buf_size=917:vrc_minrate=600:\ | |
| 5302 vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 25 \ | |
| 5303 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
| 5304 </screen> | |
| 5305 </para> | |
| 5306 </sect3> | |
| 5307 | |
| 5308 | |
| 5309 <sect3 id="menc-feat-vcd-dvd-all-ntsc-svcd"> | |
| 5310 <title>NTSC SVCD</title> | |
| 5311 | |
| 5312 <para> | |
| 5313 <screen> | |
| 5314 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xsvcd -vf \ | |
| 5315 scale=480:480,harddup -srate 44100 -af lavcresample=44100 -lavcopts \ | |
| 5316 vcodec=mpeg2video:mbd=2:keyint=18:vrc_buf_size=917:vrc_minrate=600:\ | |
| 5317 vbitrate=2500:vrc_maxrate=2500:acodec=mp2:abitrate=224 -ofps 30000/1001 \ | |
| 5318 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
| 5319 </screen> | |
| 5320 </para> | |
| 5321 </sect3> | |
| 5322 | |
| 5323 | |
| 5324 <sect3 id="menc-feat-vcd-dvd-all-pal-vcd"> | |
| 5325 <title>PAL VCD</title> | |
| 5326 | |
| 5327 <para> | |
| 5328 <screen> | |
| 5329 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \ | |
| 5330 scale=352:288,harddup -srate 44100 -af lavcresample=44100 -lavcopts \ | |
| 5331 vcodec=mpeg1video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:\ | |
| 5332 vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 25 \ | |
| 5333 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
| 5334 </screen> | |
| 5335 </para> | |
| 5336 </sect3> | |
| 5337 | |
| 5338 | |
| 5339 <sect3 id="menc-feat-vcd-dvd-all-ntsc-vcd"> | |
| 5340 <title>NTSC VCD</title> | |
| 5341 | |
| 5342 <para> | |
| 5343 <screen> | |
| 5344 mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=xvcd -vf \ | |
| 5345 scale=352:240,harddup -srate 44100 -af lavcresample=44100 -lavcopts \ | |
| 5346 vcodec=mpeg1video:keyint=18:vrc_buf_size=327:vrc_minrate=1152:\ | |
| 5347 vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 -ofps 30000/1001 \ | |
| 5348 -o <replaceable>movie.mpg</replaceable> <replaceable>movie.avi</replaceable> | |
| 5349 </screen> | |
| 5350 </para> | |
| 5351 </sect3> | |
| 5352 </sect2> | |
| 5353 </sect1> | |
| 5354 </chapter> |
