23827
|
1 <?xml version="1.0" encoding="utf-8"?>
|
|
2 <!-- synced with r23342 -->
|
|
3 <chapter id="mencoder">
|
|
4 <title>Utilizzo base di <application>MEncoder</application></title>
|
|
5
|
|
6 <para>
|
|
7 Per la lista completa delle opzioni disponibili ed esempi per
|
23829
|
8 <application>MEncoder</application>, leggi per favore la pagina di manuale. Per
|
|
9 una serie di esempi pronti all'uso e guide dettagliate sull'utilizzo di
|
|
10 svariati parametri di codifica leggi le
|
23827
|
11 <ulink url="../../tech/encoding-tips.txt">indicazioni per la codifica</ulink>
|
|
12 che sono stati selezionati da vari thread sulla mailing list MPlayer-users.
|
|
13 Cerca
|
|
14 <ulink url="http://lists.mplayerhq.hu/pipermail/mencoder-users/">qui</ulink>
|
|
15 negli archivi e soprattutto per cose più vecchie, anche
|
|
16 <ulink url="http://lists.mplayerhq.hu/pipermail/mplayer-users/">qui</ulink> per
|
|
17 una buona serie di discussioni riguardanti tutti gli aspetti e i problemi
|
|
18 relativi alla codifica con <application>MEncoder</application>.
|
|
19 </para>
|
|
20
|
|
21
|
|
22 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
23
|
|
24
|
|
25 <sect1 id="menc-feat-selecting-codec">
|
|
26 <title>Selezionare codec e formati contenitore</title>
|
|
27
|
|
28 <para>
|
|
29 I codec audio e video per la codifica vengono selezionati rispettivamente con
|
|
30 le opzioni <option>-oac</option> e <option>-ovc</option>.
|
23829
|
31 Esegui per esempio:
|
23827
|
32 <screen>mencoder -ovc help</screen>
|
|
33 per elencare tutti i codec video supportati dalla versione di
|
23829
|
34 <application>MEncoder</application> sul tuo sistema.
|
23827
|
35 Sono disponibili le scelte seguenti:
|
|
36 </para>
|
|
37
|
|
38 <para>
|
|
39 Codec audio:
|
|
40 <informaltable frame="all">
|
|
41 <tgroup cols="2">
|
|
42 <thead>
|
|
43 <row><entry>Nome codec audio</entry><entry>Descrizione</entry></row>
|
|
44 </thead>
|
|
45 <tbody>
|
|
46 <row>
|
|
47 <entry>mp3lame</entry>
|
23829
|
48 <entry>codifica in MP3 VBR, ABR o CBR MP3 tramite LAME</entry>
|
23827
|
49 </row>
|
|
50 <row>
|
|
51 <entry>lavc</entry>
|
|
52 <entry>usa uno dei codec audio di
|
|
53 <link linkend="menc-feat-enc-libavcodec-audio-codecs"><systemitem class="library">libavcodec</systemitem></link></entry>
|
|
54 </row>
|
|
55 <row>
|
|
56 <entry>faac</entry>
|
|
57 <entry>codificatore audio FAAC AAC</entry>
|
|
58 </row>
|
|
59 <row>
|
|
60 <entry>toolame</entry>
|
|
61 <entry>codificatore MPEG Audio Layer 2</entry>
|
|
62 </row>
|
|
63 <row>
|
|
64 <entry>twolame</entry>
|
|
65 <entry>codificatore MPEG Audio Layer 2 basato su tooLAME</entry>
|
|
66 </row>
|
|
67 <row>
|
|
68 <entry>pcm</entry>
|
|
69 <entry>audio PCM non compresso</entry>
|
|
70 </row>
|
|
71 <row>
|
|
72 <entry>copy</entry>
|
|
73 <entry>non ricodifica, copia solo il flusso compresso</entry>
|
|
74 </row>
|
|
75 </tbody>
|
|
76 </tgroup>
|
|
77 </informaltable>
|
|
78 </para>
|
|
79
|
|
80 <para>
|
|
81 Codec video:
|
|
82 <informaltable frame="all">
|
|
83 <tgroup cols="2">
|
|
84 <thead>
|
|
85 <row><entry>Nome codec video</entry><entry>Descrizione</entry></row>
|
|
86 </thead>
|
|
87 <tbody>
|
|
88 <row>
|
|
89 <entry>lavc</entry>
|
|
90 <entry>usa uno dei codec video di <link linkend="menc-feat-enc-libavcodec-video-codecs"><systemitem class="library">libavcodec</systemitem></link></entry>
|
|
91 </row>
|
|
92 <row>
|
|
93 <entry>xvid</entry>
|
|
94 <entry>Xvid, codec MPEG-4 Advanced Simple Profile (ASP)</entry>
|
|
95 </row>
|
|
96 <row>
|
|
97 <entry>x264</entry>
|
|
98 <entry>x264, codec MPEG-4 Advanced Video Coding (AVC), AKA H.264</entry>
|
|
99 </row>
|
|
100 <row>
|
|
101 <entry>nuv</entry>
|
|
102 <entry>nuppel video, utilizzato da alcune applicazioni in tempo reale</entry>
|
|
103 </row>
|
|
104 <row>
|
|
105 <entry>raw</entry>
|
|
106 <entry>fotogrammi video non compressi</entry>
|
|
107 </row>
|
|
108 <row>
|
|
109 <entry>copy</entry>
|
|
110 <entry>non ricodifica, copia solo il flusso compresso</entry>
|
|
111 </row>
|
|
112 <row>
|
|
113 <entry>frameno</entry>
|
|
114 <entry>usato per codifica a 3 passaggi (non consigliato)</entry>
|
|
115 </row>
|
|
116 </tbody>
|
|
117 </tgroup>
|
|
118 </informaltable>
|
|
119 </para>
|
|
120
|
|
121 <para>
|
|
122 I formati contenitore di uscita si selezionano con l'opzione
|
|
123 <option>-of</option>.
|
|
124 Scrivi:
|
|
125 <screen>mencoder -of help</screen>
|
|
126 per elencare tutti i contenitori supportati dalla versione di
|
23829
|
127 <application>MEncoder</application> sul tuo sistema.
|
23827
|
128 Sono disponibili le scelte seguenti:
|
|
129 </para>
|
|
130
|
|
131 <para>
|
|
132 Formati contenitore:
|
|
133 <informaltable frame="all">
|
|
134 <tgroup cols="2">
|
|
135 <thead>
|
|
136 <row><entry>Nome formato contenitore</entry><entry>Descrizione</entry></row>
|
|
137 </thead>
|
|
138 <tbody>
|
|
139 <row>
|
|
140 <entry>lavf</entry>
|
|
141 <entry>uno dei contenitori supportati da
|
|
142 <systemitem class="library">libavformat</systemitem></entry>
|
|
143 </row>
|
|
144 <row>
|
|
145 <entry>avi</entry>
|
|
146 <entry>Audio-Video Interleaved</entry>
|
|
147 </row>
|
|
148 <row>
|
|
149 <entry>mpeg</entry>
|
|
150 <entry>MPEG-1 e MPEG-2 PS</entry>
|
|
151 </row>
|
|
152 <row>
|
|
153 <entry>rawvideo</entry>
|
|
154 <entry>flusso video grezzo (nessun mux - solo un flusso video)</entry>
|
|
155 </row>
|
|
156 <row>
|
|
157 <entry>rawaudio</entry>
|
|
158 <entry>flusso audio grezzo (nessun mux - solo un flusso audio)</entry>
|
|
159 </row>
|
|
160 </tbody>
|
|
161 </tgroup>
|
|
162 </informaltable>
|
|
163 Il contenitore AVI è il formato contenitore nativo per
|
|
164 <application>MEncoder</application>, il che significa che è quello meglio
|
|
165 gestito e quello per cui <application>MEncoder</application> è stato
|
|
166 progettato.
|
|
167 Come su specificato, si possono utilizzare altri formati contenitore, ma
|
|
168 potresti avere qualche problema utilizzandoli.
|
|
169 </para>
|
|
170
|
|
171 <para>
|
|
172 Contenitori <systemitem class="library">libavformat</systemitem>:
|
|
173 </para>
|
|
174
|
|
175 <para>
|
|
176 Se hai impostato <systemitem class="library">libavformat</systemitem> per fare
|
|
177 il mux del file di uscita (usando <option>-of lavf</option>), il giusto formato
|
23829
|
178 contenitore verrà determinato dall'estensione del file di uscita.
|
23827
|
179 Puoi forzare un formato contenitore specifico con l'opzione
|
|
180 <option>format</option> di <systemitem class="library">libavformat</systemitem>.
|
|
181
|
|
182 <informaltable frame="all">
|
|
183 <tgroup cols="2">
|
|
184 <thead>
|
|
185 <row><entry>nome contenitore <systemitem class="library">libavformat</systemitem></entry>
|
|
186 <entry>Descrizione</entry>
|
|
187 </row></thead>
|
|
188 <tbody>
|
|
189 <row>
|
|
190 <entry>mpg</entry>
|
|
191 <entry>MPEG-1 e MPEG-2 PS</entry>
|
|
192 </row>
|
|
193 <row>
|
|
194 <entry>asf</entry>
|
|
195 <entry>Advanced Streaming Format</entry>
|
|
196 </row>
|
|
197 <row>
|
|
198 <entry>avi</entry>
|
|
199 <entry>Audio-Video Interleaved</entry>
|
|
200 </row>
|
|
201 <row>
|
|
202 <entry>wav</entry>
|
|
203 <entry>Audio Waveform</entry>
|
|
204 </row>
|
|
205 <row>
|
|
206 <entry>swf</entry>
|
|
207 <entry>Macromedia Flash</entry>
|
|
208 </row>
|
|
209 <row>
|
|
210 <entry>flv</entry>
|
|
211 <entry>Macromedia Flash video</entry>
|
|
212 </row>
|
|
213 <row>
|
|
214 <entry>rm</entry>
|
|
215 <entry>RealMedia</entry>
|
|
216 </row>
|
|
217 <row>
|
|
218 <entry>au</entry>
|
|
219 <entry>SUN AU</entry>
|
|
220 </row>
|
|
221 <row>
|
|
222 <entry>nut</entry>
|
23829
|
223 <entry>contenitore "aperto" NUT (sperimentale e non ancora spec-compliant)</entry>
|
23827
|
224 </row>
|
|
225 <row>
|
|
226 <entry>mov</entry>
|
|
227 <entry>QuickTime</entry>
|
|
228 </row>
|
|
229 <row>
|
|
230 <entry>mp4</entry>
|
|
231 <entry>formato MPEG-4</entry>
|
|
232 </row>
|
|
233 <row>
|
|
234 <entry>dv</entry>
|
|
235 <entry>contenitore Sony Digital Video</entry>
|
|
236 </row>
|
|
237 </tbody>
|
|
238 </tgroup>
|
|
239 </informaltable>
|
|
240 Come puoi notare, <systemitem class="library">libavformat</systemitem> permette
|
|
241 a <application>MEncoder</application> di fare il mux in una buona quantità
|
|
242 di contenitori.
|
|
243 Sfortunatamente, dato che <application>MEncoder</application> non è stato
|
|
244 progettato dall'inizio per supportare formati contenitore diversi da AVI,
|
|
245 dovresti essere piuttosto paranoici riguardo al file risultante.
|
23830
|
246 Assicurati per favore che la sincronizzazione audio/video sia a posto e che il
|
|
247 file possa essere riprodotto correttamente da altri programmi oltre a
|
23827
|
248 <application>MPlayer</application>.
|
|
249 </para>
|
|
250
|
|
251 <example id="encode_to_macromedia_flash_format">
|
|
252 <title>codificare nel formato Macromedia Flash</title>
|
|
253 <para>
|
|
254 Creare un video Macromedia Flash che sia riproducibile in un browser internet
|
|
255 con il plugin Macromedia Flash:
|
|
256 <screen>
|
|
257 mencoder <replaceable>input.avi</replaceable> -o <replaceable>output.flv</replaceable> -of lavf \
|
|
258 -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc \
|
|
259 -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3
|
|
260 </screen>
|
|
261 </para>
|
|
262 </example>
|
|
263
|
|
264 </sect1>
|
|
265
|
|
266
|
|
267 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
268
|
|
269
|
|
270 <sect1 id="menc-feat-selecting-input">
|
|
271 <title>Selezionare il file in ingresso o il dispositivo</title>
|
|
272
|
|
273 <para>
|
|
274 <application>MEncoder</application> può codificare da file o direttamente da
|
|
275 un disco DVD o VCD.
|
23829
|
276 Includi semplicemente nella riga comando il nome file per codificare dal file
|
|
277 stesso, oppure <option>dvd://</option><replaceable>numero_titolo</replaceable>
|
|
278 o <option>vcd://</option><replaceable>numero_traccia</replaceable> per
|
|
279 codificare da un titolo DVD o da una traccia VCD.
|
|
280 Se hai già copiato un DVD sul tuo disco fisso (puoi usare uno strumento come
|
23827
|
281 <application>dvdbackup</application>, disponibile per la maggior parte dei
|
|
282 sistemi) e desideri codificare da tale copia, dovresti ancora usare la sintassi
|
|
283 <option>dvd://</option>, insieme con <option>-dvd-device</option> seguita dal
|
|
284 percorso della radice del DVD copiato.
|
|
285
|
|
286 Le opzioni <option>-dvd-device</option> e <option>-cdrom-device</option>
|
|
287 possono anche essere usate per reimpostare i percorsi dei dispositivi al fine
|
|
288 di leggere direttamente dal disco, se i valori di default
|
|
289 <filename>/dev/dvd</filename> e <filename>/dev/cdrom</filename> non funzionano
|
|
290 sul tuo sistema.
|
|
291 </para>
|
|
292
|
|
293 <para>
|
|
294 Durante la codifica da DVD, spesso si vogliono selezionare un capitolo o una
|
|
295 serie di capitoli da codificare.
|
|
296 Per questo fine puoi usare l'opzione <option>-chapter</option>.
|
|
297 Per esempio, <option>-chapter</option> <replaceable>1-4</replaceable>
|
|
298 codificherà solo i capitoli dall'1 al 4 dal DVD.
|
|
299 Questo è particolarmente utile se vuoi fare una codifica in 1400 MB destinata
|
|
300 a due CD, visto che puoi esser sicuro che il punto di divisione sia proprio tra
|
|
301 un capitolo e l'altro invece che a metà di una scena.
|
|
302 </para>
|
|
303
|
|
304 <para>
|
|
305 Se hai una scheda di acquisizione TV supportata, puoi anche codificare dal
|
|
306 dispositivo di ingresso TV.
|
|
307 Usa <option>tv://</option><replaceable>numero_canale</replaceable> come
|
|
308 nome file e <option>-tv</option> per configurare varie opzioni di acquisizione.
|
|
309 L'ingresso DVB funziona in modo simile.
|
|
310 </para>
|
|
311 </sect1>
|
|
312
|
|
313
|
|
314 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
315
|
|
316
|
|
317 <sect1 id="menc-feat-mpeg4">
|
|
318 <title>Codificare MPEG-4 ("DivX") in due passaggi</title>
|
|
319
|
|
320 <para>
|
|
321 La definizione viene dal fatto che questo metodo codifica il file
|
|
322 <emphasis>due volte</emphasis>. La prima codifica (dubbed pass) genera alcuni
|
|
323 file temporanei (<filename>*.log</filename>) con una dimensione di pochi
|
23829
|
324 megabyte, non cancellarli dopo il primo passaggio (puoi cancellare l'AVI o
|
|
325 meglio ancora non creare alcun video ridirezionandolo verso
|
|
326 <filename>/dev/null</filename>).
|
|
327 Nel secondo passaggio viene creato il secondo file di output, usando i dati
|
|
328 del bitrate presi dai file temporanei. Il file risultante avrà una qualità
|
|
329 dell'immagine decisamente migliore. Se questa è la prima volta che senti
|
|
330 parlare di quasta cosa ti conviene leggere qualcuna delle guide disponibili su
|
|
331 internet.
|
23827
|
332 </para>
|
|
333
|
|
334 <example id="copy_audio_track">
|
|
335 <title>copiare la traccia audio</title>
|
|
336 <para>
|
|
337 La codifica in due passaggi della seconda traccia di un DVD in un AVI MPEG-4
|
|
338 ("DivX") copiando la traccia audio.
|
|
339 <screen>
|
|
340 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o /dev/null
|
|
341 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 \
|
|
342 -oac copy -o <replaceable>output.avi</replaceable>
|
|
343 </screen>
|
|
344 </para>
|
|
345 </example>
|
|
346
|
|
347 <example id="encode_audio_track">
|
|
348 <title>codificare la traccia audio</title>
|
|
349 <para>
|
|
350 La codifica in due passaggi della seconda traccia di un DVD in un AVI MPEG-4
|
|
351 ("DivX") codificando la traccia audio in MP3.
|
23829
|
352 Fai attenzione se usi questo metodo, dato che in alcuni casi può portare
|
23827
|
353 desincronizzazione audio/video.
|
|
354 <screen>
|
|
355 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 \
|
|
356 -oac mp3lame -lameopts vbr=3 -o /dev/null
|
|
357 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 \
|
|
358 -oac mp3lame -lameopts vbr=3 -o <replaceable>output.avi</replaceable>
|
|
359 </screen>
|
|
360 </para>
|
|
361 </example>
|
|
362 </sect1>
|
|
363
|
|
364
|
|
365 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
366
|
|
367
|
|
368 <sect1 id="menc-feat-handheld-psp">
|
|
369 <title>Codificare nel formato video per Sony PSP</title>
|
|
370
|
|
371 <para>
|
|
372 <application>MEncoder</application> fornisce la codifica in formato video Sony
|
|
373 PSP, ma, relativamente alla revisione del software PSP, i vincoli possono
|
|
374 essere diverse.
|
|
375 Dovresti accertarti di rispettare i seguenti vincoli:
|
|
376 <itemizedlist>
|
|
377 <listitem><para>
|
23829
|
378 <emphasis role="bold">Bitrate</emphasis>: non dovrebbe oltrepassare i
|
23827
|
379 1500kbps, tuttavia, versioni precedenti supportavano quasi ogni frequenza a
|
|
380 patto che l'intestazione non dicesse che era troppo alta.
|
|
381 </para></listitem>
|
|
382 <listitem><para>
|
|
383 <emphasis role="bold">Dimensioni</emphasis>: la larghezza e l'altezza del
|
|
384 video PSP dovrebbero essere multipli di 16 e il prodotto larghezza * altezza
|
|
385 dovrebbe essere <= 64000.
|
23829
|
386 In alcune circostanze, potrebbe essere possibile che la PSP riproduca
|
23827
|
387 risoluzioni più grandi.
|
|
388 </para></listitem>
|
|
389 <listitem><para>
|
|
390 <emphasis role="bold">Audio</emphasis>: la frequenza dovrebbe essere 24kHz
|
|
391 per video MPEG-4, e 48kHz per H.264.
|
|
392 </para></listitem>
|
|
393 </itemizedlist>
|
|
394 </para>
|
|
395
|
|
396 <example id="encode_for_psp">
|
|
397 <title>codificare per PSP</title>
|
|
398 <para>
|
|
399 <screen>
|
|
400 mencoder -ofps 30000/1001 -af lavcresample=24000 -vf harddup -of lavf \
|
|
401 -oac lavc -ovc lavc -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=aac \
|
|
402 -lavfopts format=psp:i_certify_that_my_video_stream_does_not_use_b_frames \
|
|
403 <replaceable>input.video</replaceable> -o <replaceable>output.psp</replaceable>
|
|
404 </screen>
|
|
405 Nota che puoi impostare il titolo del video con
|
|
406 <option>-info name=<replaceable>TitoloFilmato</replaceable></option>.
|
|
407 </para>
|
|
408 </example>
|
|
409 </sect1>
|
|
410
|
|
411
|
|
412 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
413
|
|
414
|
|
415 <sect1 id="menc-feat-mpeg">
|
|
416 <title>Codificare in formato MPEG</title>
|
|
417
|
|
418 <para>
|
23829
|
419 <application>MEncoder</application> può generare file nel formato di output
|
23827
|
420 MPEG (MPEG-PS).
|
|
421 Di solito, quando stai usando video MPEG-1 o MPEG-2, è perché stai codificando
|
|
422 per un formato vincolato come SVCD, VCD, o DVD.
|
|
423 Le richieste specifiche per questi formati sono spiegate nella sezione
|
|
424 <link linkend="menc-feat-vcd-dvd">creazione di VCD e DVD</link>.
|
|
425 </para>
|
|
426
|
|
427 <para>
|
|
428 Per modificare il formato file di uscita di <application>MEncoder</application>,
|
|
429 usa l'opzione <option>-of mpeg</option>.
|
|
430 </para>
|
|
431
|
|
432 <informalexample>
|
|
433 <para>
|
|
434 Esempio:
|
|
435 <screen>
|
|
436 mencoder <replaceable>input.avi</replaceable> -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video \
|
|
437 -oac copy <replaceable>altre_opzioni</replaceable> -o <replaceable>output.mpg</replaceable>
|
|
438 </screen>
|
|
439 Creare un file MPEG-1 che possa essere riprodotto da sistemi con un supporto
|
|
440 multimediale minimale, come l'installazione di default di Windows:
|
|
441 <screen>
|
|
442 mencoder <replaceable>input.avi</replaceable> -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 \
|
|
443 -o <replaceable>output.mpg</replaceable> -oac lavc -lavcoptc acodec=mp2:abitrate=224 -ovc lavc \
|
|
444 -lavcopts vcodec=mpeg1video:vbitrate=1152:keyint=15:mbd=2:aspect=4/3
|
|
445 </screen>
|
|
446 Lo stesso, ma usando il muxer MPEG di
|
|
447 <systemitem class="library">libavformat</systemitem>:
|
|
448 <screen>
|
|
449 mencoder <replaceable>input.avi</replaceable> -o <replaceable>VCD.mpg</replaceable> -ofps 25 -vf scale=352:288,harddup -of lavf \
|
|
450 -lavfopts format=mpg:i_certify_that_my_video_stream_does_not_use_b_frames \
|
|
451 -oac lavc -lavcopts acodec=mp2:abitrate=224 -ovc lavc \
|
|
452 -lavcopts vcodec=mpeg1video:vrc_buf_size=327:keyint=15:vrc_maxrate=1152:vbitrate=1152:vmax_b_frames=0
|
|
453 </screen>
|
|
454 </para>
|
|
455 </informalexample>
|
|
456
|
|
457 <note><title>Consiglio:</title>
|
|
458 <para>
|
|
459 Se per qualche motivo la qualità video del secondo passaggio non ti soddisfa,
|
23829
|
460 puoi rilanciare la tua codifica video con un diverso bitrate di uscita,
|
|
461 sempre che tu abbia tenuto i file con le statistiche del passaggio precedente.
|
23827
|
462 Questo è possbilie dato che l'obiettivo principale del file delle statistiche
|
|
463 è registrarsi la complessità di ciascun frame, che non dipende direttamente
|
23829
|
464 dal bitrate. Dovresti tuttavia essere consapevole che otterrai i risultati
|
|
465 migliori se tutti i passaggi sono eseguiti con bitrate non troppo diversi tra
|
23827
|
466 loro.
|
|
467 </para>
|
|
468 </note>
|
|
469 </sect1>
|
|
470
|
|
471
|
|
472 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
473
|
|
474
|
|
475 <sect1 id="menc-feat-rescale">
|
|
476 <title>Ridimensionare filmati</title>
|
|
477
|
|
478 <para>
|
|
479 Spesso emerge la necessità di ridimensionare le immagini del filmato.
|
|
480 Le ragioni possono essere molte: diminuire la dimensione del file, la banda di
|
|
481 rete, etc... Molte persone ridimensionano anche quando convertono DVD o CVD in
|
|
482 AVI DivX. Se desideri ridimensionare, leggi la sezione
|
|
483 <link linkend="aspect">Preservare il rapporto di aspetto</link>.
|
|
484 </para>
|
|
485
|
|
486 <para>
|
|
487 Il processo di ridimensionamento è gestito dal filtro video
|
|
488 <literal>scale</literal>:
|
|
489 <option>-vf scale=<replaceable>larghezza</replaceable>:<replaceable>altezza</replaceable></option>.
|
|
490 La sua qualità può essere impostata con l'opzione <option>-sws</option>.
|
|
491 Se non è specificato, <application>MEncoder</application> userà 2: bicubico.
|
|
492 </para>
|
|
493
|
|
494 <para>
|
|
495 Uso:
|
|
496 <screen>
|
|
497 mencoder <replaceable>input.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell \
|
|
498 -vf scale=640:480 -o <replaceable>output.avi</replaceable>
|
|
499 </screen>
|
|
500 </para>
|
|
501 </sect1>
|
|
502
|
|
503
|
|
504 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
505
|
|
506
|
|
507 <sect1 id="menc-feat-streamcopy">
|
|
508 <title>Copia dei flussi</title>
|
|
509
|
|
510 <para>
|
|
511 <application>MEncoder</application> può gestire i flussi in ingresso in due
|
|
512 modi: <emphasis role="bold">codifica</emphasis> o
|
|
513 <emphasis role="bold">copia</emphasis>. Questa sezione tratta la
|
|
514 <emphasis role="bold">copia</emphasis>.
|
|
515 </para>
|
|
516
|
|
517 <itemizedlist>
|
|
518 <listitem><para>
|
|
519 <emphasis role="bold">Flussi video</emphasis> (opzione <option>-ovc copy</option>):
|
|
520 si possono fare delle cose carine :) Come infilare (senza converzione!) video
|
|
521 FLI o VIVO o MPEG-1 in un file AVI! Di sicuro solo
|
|
522 <application>MPlayer</application> può riprodurre file siffatti :)
|
|
523 E probabilmente non ha alcuna utilità. Razionalmente: la copia dei flussi
|
|
524 video può essere utile per esempio quando si deve codificare solo il flusso
|
|
525 audio (come da PCM non compresso a MP3).
|
|
526 </para></listitem>
|
|
527 <listitem><para>
|
|
528 <emphasis role="bold">Flussi audio</emphasis> (opzione <option>-oac copy</option>):
|
|
529 direttamente. E' possibile prendere un file audio esterno (MP3, WAV) e farne
|
|
530 il mux nel flusso di uscita. Usa l'opzione
|
|
531 <option>-audiofile <replaceable>nomefile</replaceable></option> per farlo.
|
|
532 </para></listitem>
|
|
533 </itemizedlist>
|
|
534
|
|
535 <para>
|
|
536 Usare <option>-oac copy</option> per copiare da un formato contenitore ad un
|
|
537 altro potrebbe richiedere l'utilizzo di <option>-fafmttag</option> per
|
|
538 conservare l'etichetta del formato audio del file di partenza.
|
|
539 Per esempio, se stai convertendo un file NSV con audio AAC a un contenitore AVI,
|
|
540 l'etichetta del formato audio sarà sbagliata e bisognerà modificarla.
|
|
541 Per una lista delle etichette dei formati audio, controlla
|
|
542 <filename>codecs.conf</filename>.
|
|
543 </para>
|
|
544
|
|
545 <para>
|
|
546 Esempio:
|
|
547 <screen>
|
|
548 mencoder <replaceable>input.nsv</replaceable> -oac copy -fafmttag 0x706D \
|
|
549 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -o <replaceable>output.avi</replaceable>
|
|
550 </screen>
|
|
551 </para>
|
|
552 </sect1>
|
|
553
|
|
554
|
|
555 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
556
|
|
557
|
|
558 <sect1 id="menc-feat-enc-images">
|
|
559 <title>Codificare file immagine multipli (JPEG, PNG, TGA, etc.)</title>
|
|
560
|
|
561 <para>
|
|
562 <application>MEncoder</application> è in grado di creare filmati da uno o più
|
|
563 file immagine JPEG, PNG, TGA o altri. Con una semplioce copia fotogrammi può
|
|
564 creare file MJPEG (Motion JPEG), MPNG (Motion PNG) o MTGA (Motion TGA).
|
|
565 </para>
|
|
566
|
|
567 <orderedlist>
|
|
568 <title>Spiegazione del processo:</title>
|
|
569 <listitem><para>
|
|
570 <application>MEncoder</application> <emphasis>decodifica</emphasis> le
|
|
571 immagini in entrata con <systemitem class="library">libjpeg</systemitem>
|
|
572 (decodificando PNG, userà <systemitem class="library">libpng</systemitem>).
|
|
573 </para></listitem>
|
|
574 <listitem><para>
|
|
575 <application>MEncoder</application> passa poi le immagini decodificate al
|
|
576 compressore video scelto (DivX4, Xvid, FFmpeg msmpeg4, etc.).
|
|
577 </para></listitem>
|
|
578 </orderedlist>
|
|
579
|
|
580 <formalpara>
|
|
581 <title>Esempi</title>
|
|
582 <para>
|
|
583 La spiegazione dell'opzione <option>-mf</option> è nella pagina man.
|
|
584
|
|
585 <informalexample>
|
|
586 <para>
|
|
587 Creare un file MPEG-4 da tutti i file JPEG nella directory corrente:
|
|
588 <screen>
|
|
589 mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc \
|
|
590 -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o <replaceable>output.avi</replaceable>
|
|
591 </screen>
|
|
592 </para>
|
|
593 </informalexample>
|
|
594
|
|
595 <informalexample>
|
|
596 <para>
|
|
597 Creare un file MPEG-4 da alcuni file JPEG nella directory corrente:
|
|
598 <screen>
|
|
599 mencoder mf://<replaceable>frame001.jpg,frame002.jpg</replaceable> -mf w=800:h=600:fps=25:type=jpg \
|
|
600 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o <replaceable>output.avi</replaceable>
|
|
601 </screen>
|
|
602 </para>
|
|
603 </informalexample>
|
|
604
|
|
605 <informalexample>
|
|
606 <para>
|
|
607 Creare un file MPEG-4 da una lista definita di file JPEG (lista.txt nella
|
|
608 directory corrente contiene la lista dei file da usare come sorgente, uno per
|
|
609 riga):
|
|
610 <screen>
|
|
611 mencoder mf://<replaceable>@lista.txt</replaceable> -mf w=800:h=600:fps=25:type=jpg \
|
|
612 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o <replaceable>output.avi</replaceable>
|
|
613 </screen>
|
|
614 </para>
|
|
615 </informalexample>
|
|
616
|
|
617 Puoi mescolare diversi tipi di immagine, senza considerare il metodo che usi
|
|
618 — nomi file singoli, wildcard o file da una lista — posto ovviamente
|
|
619 che abbiano la stessa dimensione.
|
|
620 Per cui puoi per es. prendere il fotogramma dei titoli da un file PNG e poi
|
|
621 fare una presentazione delle tue foto in JPEG.
|
|
622
|
|
623 <informalexample>
|
|
624 <para>
|
|
625 Creare un file Motion JPEG (MJPEG) da tutti i file JPEG nella directory
|
|
626 corrente:
|
|
627 <screen>
|
|
628 mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc copy -oac copy -o <replaceable>output.avi</replaceable>
|
|
629 </screen>
|
|
630 </para>
|
|
631 </informalexample>
|
|
632
|
|
633 <informalexample>
|
|
634 <para>
|
|
635 Creare un file non compresso da tutti i file PNG nella directory corrente:
|
|
636 <screen>
|
|
637 mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc raw -oac copy -o <replaceable>output.avi</replaceable>
|
|
638 </screen>
|
|
639 </para>
|
|
640 </informalexample>
|
|
641
|
|
642 <note><para>
|
|
643 La larghezza deve essere un intero multipli di 4, è una limitazione del
|
|
644 formato grezzo RAW RGB AVI.
|
|
645 </para></note>
|
|
646
|
|
647 <informalexample>
|
|
648 <para>
|
|
649 Creare un file Motion PNG (MPNG) da tutti i file PNG nella directory corrente:
|
|
650 <screen>
|
|
651 mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc copy -oac copy -o <replaceable>output.avi</replaceable><!--
|
|
652 --></screen>
|
|
653 </para>
|
|
654 </informalexample>
|
|
655
|
|
656 <informalexample>
|
|
657 <para>
|
|
658 Creare un file Motion TGA (MTGA) da tutti i file TGA nella directory corrente:
|
|
659 <screen>
|
|
660 mencoder mf://*.tga -mf w=800:h=600:fps=25:type=tga -ovc copy -oac copy -o <replaceable>output.avi</replaceable><!--
|
|
661 --></screen>
|
|
662 </para>
|
|
663 </informalexample>
|
|
664 </para>
|
|
665 </formalpara>
|
|
666 </sect1>
|
|
667
|
|
668
|
|
669 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
670
|
|
671
|
|
672 <sect1 id="menc-feat-extractsub">
|
|
673 <title>Estrarre sottotitoli DVD in un file VOBsub</title>
|
|
674
|
|
675 <para>
|
|
676 <application>MEncoder</application> è in grado di estrarre i sottotitoli da un
|
|
677 DVD in file formattati VOBsub. Essi sono composti da una coppia di file che
|
|
678 terminano in <filename>.idx</filename> e <filename>.sub</filename> e sono
|
|
679 solitamente compressi in un singolo archivio <filename>.rar</filename>.
|
|
680 <application>MPlayer</application> può riprodurli con le opzioni
|
|
681 <option>-vobsub</option> e <option>-vobsubid</option>.
|
|
682 </para>
|
|
683
|
|
684 <para>
|
|
685 Specifica il nome di base (per es. senza l'estensione <filename>.idx</filename>
|
|
686 o <filename>.sub</filename>) del file di uscita con <option>-vobsubout</option>
|
|
687 e l'indice per questo sottotitolo nel file risultante con
|
|
688 <option>-vobsuboutindex</option>.
|
|
689 </para>
|
|
690
|
|
691 <para>
|
|
692 Se i dati in entrata non arrivano da un DVD usa <option>-ifo</option> per
|
|
693 indicare il file <filename>.ifo</filename> che serve per costruire il
|
|
694 risultante file <filename>.idx</filename>.
|
|
695 </para>
|
|
696
|
|
697 <para>
|
|
698 Se i dati in entrata non arrivano da un DVD e non hai il file
|
|
699 <filename>.ifo</filename> dovrai usare l'opzione <option>-vobsubid</option> per
|
|
700 impostare l'id della lingua da scrivere nel file <filename>.idx</filename>.
|
|
701 </para>
|
|
702
|
|
703 <para>
|
|
704 Se esistono già i file <filename>.idx</filename> e <filename>.sub</filename>
|
|
705 ogni esecuzione aggiungerà il sottotitolo selezionato. Perciò dovresti
|
|
706 cancellarli prima di iniziare.
|
|
707 </para>
|
|
708
|
|
709 <example id="copying_two_subtitles_from_a_dvd_while_doing_two_pass_encoding">
|
|
710 <title>Copiare due sottotitoli da un DVD durante la codifica in due passaggi</title>
|
|
711 <screen>
|
|
712 rm <replaceable>sottotitoli.idx</replaceable> <replaceable>sottotitoli.sub</replaceable>
|
|
713 mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 \
|
|
714 -vobsubout <replaceable>sottotitoli</replaceable> -vobsuboutindex 0 -sid 2
|
|
715 mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 \
|
|
716 -vobsubout <replaceable>sottotitoli</replaceable> -vobsuboutindex 1 -sid 5<!--
|
|
717 --></screen>
|
|
718 </example>
|
|
719
|
|
720 <example id="copying_a_french_subtitle_from_an_mpeg_file">
|
|
721 <title>Copiare i sottotitoli francesi da un file MPEG</title>
|
|
722 <screen>
|
|
723 rm <replaceable>sottotitoli.idx</replaceable> <replaceable>sottotitoli.sub</replaceable>
|
|
724 mencoder <replaceable>film.mpg</replaceable> -ifo <replaceable>film.ifo</replaceable> -vobsubout <replaceable>sottotitoli</replaceable> -vobsuboutindex 0 \
|
|
725 -vobsuboutid fr -sid 1 -nosound -ovc copy
|
|
726 </screen>
|
|
727 </example>
|
|
728 </sect1>
|
|
729
|
|
730
|
|
731 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
|
|
732
|
|
733
|
|
734 <sect1 id="aspect">
|
|
735 <title>Preservare il rapporto di aspetto</title>
|
|
736
|
|
737 <para>
|
|
738 I file dei DVD e dei VCD (per es. MPEG-1/2) contengono un valore del rapporto
|
|
739 d'aspetto che instruisce il riproduttore su come ridimensionare il flusso video,
|
|
740 così gli umani non avranno teste a uovo (es.: 480x480 + 4:3 = 640x480).
|
|
741 Tuttavia, codificando in file AVI (DivX), devi fare attenzione che
|
|
742 l'intestazione AVI non salva questo valore. Ridimensionare il film è disgustoso
|
|
743 e una perdita di tempo, ci deve essere un modo migliore!
|
|
744 </para>
|
|
745
|
|
746 <para>C'è</para>
|
|
747
|
|
748 <para>
|
|
749 MPEG-4 ha un caratteristica unica: il flusso video può contenere il rapporto
|
|
750 di aspetto che serve. Sì, proprio come i MPEG-1/2 (DVD, SVCD) e H.263.
|
|
751 Tristemente, ci sono pochi riproduttori oltre ad
|
|
752 <application>MPlayer</application> che gestiscono questo attributo MPEG-4.
|
|
753 </para>
|
|
754
|
|
755 <para>
|
|
756 This feature can be used only with
|
|
757 Questa caratteristica può essere usata solo con il codec
|
|
758 <systemitem>mpeg4</systemitem> di
|
|
759 <link linkend="ffmpeg"><systemitem class="library">libavcodec</systemitem></link>.
|
|
760 Ricorda: anche se <application>MPlayer</application> riprodurrà correttamente
|
|
761 il file generato, altri riproduttori potrebbero usare il rapporto di aspetto
|
|
762 sbagliato.
|
|
763 </para>
|
|
764
|
|
765 <para>
|
|
766 Devi assolutamente tagliare le bande nere sopra e sotto all'immagine del film.
|
|
767 Vedi la pagina man per l'utilizzo dei filtri <systemitem>cropdetect</systemitem>
|
|
768 e <systemitem>crop</systemitem>.
|
|
769 </para>
|
|
770
|
|
771 <para>
|
|
772 Uso
|
|
773 <screen>mencoder <replaceable>svcd-di-esempio.mpg</replaceable> -vf crop=714:548:0:14 -oac copy -ovc lavc \
|
|
774 -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect -o <replaceable>output.avi</replaceable></screen>
|
|
775 </para>
|
|
776 </sect1>
|
|
777
|
|
778 </chapter>
|