11722
|
1 <?xml version="1.0" encoding="iso-8859-2"?>
|
19102
|
2 <!-- synced with r18255 -->
|
19027
|
3 <!-- Opiekun: Qba -->
|
11722
|
4 <chapter id="mencoder">
|
19027
|
5 <title>Podstawy używania <application>MEncodera</application></title>
|
11722
|
6
|
|
7 <para>
|
|
8 Pełna lista dostępnych opcji <application>MEncodera</application> oraz
|
19027
|
9 przykłady znajdują się na stronie man. W pliku
|
|
10 <ulink url="../../tech/encoding-tips.txt">encoding-tips</ulink>
|
|
11 znajduje się dużo przykładów i przewodników skompletowanych z wielu wątków
|
|
12 listy dyskusyjnej MPlayer-users.
|
|
13 W <ulink url="http://mplayerhq.hu/pipermail/mplayer-users/">archiwum</ulink>
|
11722
|
14 znajdziesz mnóstwo dyskusji o aspektach i problemach związanych z kodowaniem
|
|
15 przy pomocy <application>MEncodera</application>.
|
|
16 </para>
|
|
17
|
19027
|
18 <sect1 id="menc-feat-selecting-codec">
|
|
19 <title>Wybieranie kodeka i formatu</title>
|
|
20
|
|
21 <para>
|
|
22 Kodeki audio i video stosowane przy kodowaniu są wybierane odpowiednio
|
|
23 opcjami <option>-oac</option> i <option>-ovc</option>.
|
|
24 Napisz na przykład:
|
|
25 <screen>mencoder -ovc help</screen>
|
|
26 by uzyskać listę wszystkich kodeków video obsługiwanych przez
|
|
27 <application>MEncodera</application> na Twoim komputerze.
|
|
28 Dostępne są następujące:
|
|
29 </para>
|
|
30 <para>
|
|
31 Kodeki audio:
|
|
32
|
|
33 <informaltable frame="all">
|
|
34 <tgroup cols="2">
|
|
35 <thead>
|
|
36 <row><entry>Nazwa kodeka audio</entry><entry>Opis</entry></row>
|
|
37 </thead>
|
|
38 <tbody>
|
|
39 <row>
|
|
40 <entry>mp3lame</entry>
|
|
41 <entry>Kodowanie na MP3 VBR, ABR lub przy użyciu LAME</entry>
|
|
42 </row>
|
|
43 <row>
|
|
44 <entry>lavc</entry>
|
|
45 <entry>Używa jednego z kodeków audio z <link linkend="menc-feat-enc-libavcodec-audio-codecs"><systemitem class="library">libavcodec</systemitem></link>
|
|
46 </entry>
|
|
47 </row>
|
|
48 <row>
|
|
49 <entry>faac</entry>
|
|
50 <entry>Koder audio FAAC AAC</entry>
|
|
51 </row>
|
|
52 <row>
|
|
53 <entry>toolame</entry>
|
|
54 <entry>Koder MPEG Audio Layer 2</entry>
|
|
55 </row>
|
|
56 <row>
|
|
57 <entry>twolame</entry>
|
|
58 <entry>Koder MPEG Audio Layer 2 encoder oparty na tooLAME</entry>
|
|
59 </row>
|
|
60 <row>
|
|
61 <entry>pcm</entry>
|
|
62 <entry>Nieskompresowany dźwięk PCM</entry>
|
|
63 </row>
|
|
64 <row>
|
|
65 <entry>copy</entry>
|
|
66 <entry>Nie przekodowywuj, tylko przekopiuj zakodowane ramki</entry>
|
|
67 </row>
|
|
68 </tbody>
|
|
69 </tgroup>
|
|
70 </informaltable>
|
|
71 </para>
|
|
72
|
|
73 <para>
|
|
74 Kodeki video:
|
|
75 <informaltable frame="all">
|
|
76 <tgroup cols="2">
|
|
77 <thead>
|
|
78 <row><entry>Nazwa kodeka video</entry><entry>Opis</entry></row>
|
|
79 </thead>
|
|
80 <tbody>
|
|
81 <row>
|
|
82 <entry>lavc</entry>
|
|
83 <entry>Używa jednego z kodeków video z <link linkend="menc-feat-enc-libavcodec-video-codecs"><systemitem class="library">libavcodec</systemitem></link>
|
|
84 </entry>
|
|
85 </row>
|
|
86 <row>
|
|
87 <entry>xvid</entry>
|
|
88 <entry>XviD, kodek MPEG-4 Advanced Simple Profile (ASP)</entry>
|
|
89 </row>
|
|
90 <row>
|
|
91 <entry>x264</entry>
|
|
92 <entry>x264, MPEG-4 Advanced Video Coding (AVC), zwany kodekiem H.264</entry>
|
|
93 </row>
|
|
94 <row>
|
|
95 <entry>nuv</entry>
|
|
96 <entry>nuppel video, używany przez niektóre aplikacje czasu rzeczywistego</entry>
|
|
97 </row>
|
|
98 <row>
|
|
99 <entry>raw</entry>
|
|
100 <entry>Nieskompresowane klatki video</entry>
|
|
101 </row>
|
|
102 <row>
|
|
103 <entry>copy</entry>
|
|
104 <entry>Nie przekodowywuj, tylko przekopiuj zakodowane ramki</entry>
|
|
105 </row>
|
|
106 <row>
|
|
107 <entry>frameno</entry>
|
|
108 <entry>Używany do kodowania trójprzebiegowego (nie zalecane)</entry>
|
|
109 </row>
|
|
110 </tbody>
|
|
111 </tgroup>
|
|
112 </informaltable>
|
|
113 </para>
|
|
114 <para>
|
|
115 Format wyjściowy wybiera się opcją <option>-of</option>.
|
|
116 Napisz:
|
|
117 <screen>mencoder -of help</screen>
|
|
118 by otrzymać listę wszystkich formatów obsługiwanych przez
|
|
119 <application>MEncodera</application> na Twoim komputerze.
|
|
120 </para>
|
|
121 <para>
|
|
122 Formaty przechowywania:
|
|
123 <informaltable frame="all">
|
|
124 <tgroup cols="2">
|
|
125 <thead>
|
|
126 <row><entry>Nazwa formatu</entry><entry>Opis</entry></row>
|
|
127 </thead>
|
|
128 <tbody>
|
|
129 <row>
|
|
130 <entry>lavf</entry>
|
|
131 <entry>Jeden z formatów obsługiwanych przez
|
|
132 <systemitem class="library">libavformat</systemitem></entry>
|
|
133 </row>
|
|
134 <row>
|
|
135 <entry>avi</entry>
|
|
136 <entry>Audio-Video Interleaved (Przeplecione Audio-Video)</entry>
|
|
137 </row>
|
|
138 <row>
|
|
139 <entry>mpeg</entry>
|
|
140 <entry>MPEG-1 i MPEG-2 PS</entry>
|
|
141 </row>
|
|
142 <row>
|
|
143 <entry>rawvideo</entry>
|
|
144 <entry>surowy strumień video (bez muxowania - tylko jeden strumień video)</entry>
|
|
145 </row>
|
|
146 <row>
|
|
147 <entry>rawaudio</entry>
|
|
148 <entry>surowy strumień audio (bez muxowania - tylko jeden strumień audio)</entry>
|
|
149 </row>
|
|
150 </tbody>
|
|
151 </tgroup>
|
|
152 </informaltable>
|
|
153 Format AVI jest podstawowym formatem <application>MEncodera</application>,
|
|
154 co oznacza że jest najlepiej obsługiwany i że
|
|
155 <application>MEncoder</application> był projektowany z myślą o nim.
|
|
156 Jak napisano wcześniej, można używać innych formatów, ale możesz napotkać
|
|
157 przy tym problemy.
|
|
158 </para>
|
11722
|
159
|
|
160 <para>
|
19027
|
161 <systemitem class="library">libavformat</systemitem> containers:
|
|
162 </para>
|
|
163 <para>
|
|
164 Jeśli chcesz żeby <systemitem class="library">libavformat</systemitem>
|
|
165 dokonywał muksowania zbioru wyjściowego (przy użyciu opcji
|
|
166 <option>-of lavf</option>), stosowny format zostanie ustalony na podstawie
|
|
167 rozszerzenia pliku wyjściowego.
|
|
168 Możesz wymusić konkretny format opcją <option>format</option> biblioteki
|
|
169 <systemitem class="library">libavformat</systemitem>.
|
|
170
|
|
171 <informaltable frame="all">
|
|
172 <tgroup cols="2">
|
|
173 <thead>
|
|
174 <row><entry><systemitem class="library">libavformat</systemitem> container name</entry><entry>Description</entry></row>
|
|
175 </thead>
|
|
176 <tbody>
|
|
177 <row>
|
|
178 <entry>mpg</entry>
|
|
179 <entry>MPEG-1 i MPEG-2 PS</entry>
|
|
180 </row>
|
|
181 <row>
|
|
182 <entry>asf</entry>
|
|
183 <entry>Advanced Streaming Format (Zaawansowany format strumieniowy)</entry>
|
|
184 </row>
|
|
185 <row>
|
|
186 <entry>avi</entry>
|
|
187 <entry>Audio-Video Interleaved</entry>
|
|
188 </row>
|
|
189 <row>
|
|
190 <entry>wav</entry>
|
|
191 <entry>Waveform Audio</entry>
|
|
192 </row>
|
|
193 <row>
|
|
194 <entry>swf</entry>
|
|
195 <entry>Macromedia Flash</entry>
|
|
196 </row>
|
|
197 <row>
|
|
198 <entry>flv</entry>
|
|
199 <entry>Macromedia Flash video</entry>
|
|
200 </row>
|
|
201 <row>
|
|
202 <entry>rm</entry>
|
|
203 <entry>RealMedia</entry>
|
|
204 </row>
|
|
205 <row>
|
|
206 <entry>au</entry>
|
|
207 <entry>SUN AU</entry>
|
|
208 </row>
|
|
209 <row>
|
|
210 <entry>nut</entry>
|
|
211 <entry>Otwarty format NUT (eksperymentalny i jeszcze bez specyfikacji)</entry>
|
|
212 </row>
|
|
213 <row>
|
|
214 <entry>mov</entry>
|
|
215 <entry>QuickTime</entry>
|
|
216 </row>
|
|
217 <row>
|
|
218 <entry>mp4</entry>
|
|
219 <entry>MPEG-4 format</entry>
|
|
220 </row>
|
|
221 <row>
|
|
222 <entry>dv</entry>
|
|
223 <entry>format Sony Digital Video</entry>
|
|
224 </row>
|
|
225 </tbody>
|
|
226 </tgroup>
|
|
227 </informaltable>
|
|
228 Jak widzisz, <systemitem class="library">libavformat</systemitem> pozwala
|
|
229 <application>MEncoderowi</application> tworzyć sporą ilość różnych formatów.
|
|
230 Niestety, ponieważ <application>MEncoder</application> nie był tworzony
|
|
231 z myślą o innych formatach niż AVI, powinieneś popadać w paranoję na temat
|
|
232 wynikowych plików.
|
|
233 Dokładnie sprawdź czy jest prawidłowa synchronizacja audio/video i czy plik
|
|
234 może zostać prawidłowo odtworzony przez odtwarzacze inne niż
|
|
235 <application>MPlayer</application>.
|
|
236 </para>
|
|
237
|
|
238 <informalexample>
|
|
239 <para>Przykład:</para>
|
|
240 <para>
|
|
241 Tworzenie zbioru Macromedia Flash video, nadającego się do odtwarzania
|
|
242 w przeglądarce sieci z wtyczką Macromedia Flash:
|
|
243 <screen>
|
|
244 mencoder <replaceable>wejście.avi</replaceable> -o <replaceable>wyjście.flv</replaceable> -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc \
|
|
245 -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 \
|
|
246 -srate 22050
|
|
247 </screen>
|
|
248 </para>
|
|
249 </informalexample>
|
|
250
|
|
251 </sect1>
|
|
252
|
|
253
|
|
254 <sect1 id="menc-feat-selecting-input">
|
|
255 <title>Wybieranie źródłowego zbioru lub urządzenia</title>
|
|
256
|
|
257 <para>
|
|
258 <application>MEncoder</application> może kodoważ ze zbiorów lub bezpośrednio
|
|
259 z dysku DVD lub VCD.
|
|
260 Po prostu podaj nazwę zbioru w wierszu poleceń żeby kodować ze zbioru, albo
|
|
261 <option>dvd://</option><replaceable>numertytułu</replaceable> lub
|
|
262 <option>vcd://</option><replaceable>numerścieżki</replaceable> by nagrywać
|
|
263 z tytułu DVD albo ścieżki VCD.
|
|
264 Jeśli już skopiowałeś DVD na twardy dysk (możesz na przykład użyć narzędzia
|
|
265 takiego jak <application>dvdbackup</application>, dostępnego na większości
|
|
266 systemów), wciąż powinieneś używać składni <option>dvd://</option>, razem
|
|
267 z opcją <option>-dvd-device</option> po której następuje ścieżka do
|
|
268 skopiowanego DVD.
|
|
269
|
|
270 Opcji <option>-dvd-device</option> i <option>-cdrom-device</option> możesz
|
|
271 też używać by podać własne ścieżki do węzłów urządzeń, jeśli domyślne
|
|
272 <filename>/dev/dvd</filename> i <filename>/dev/cdrom</filename> nie są
|
|
273 właściwe w Twoim systemie.
|
|
274 </para>
|
|
275 <para>
|
|
276 Przy kodowaniu z DVD, często pożądanym jest wybranie do kodowania rozdziału
|
|
277 lub zasięgu rozdziałów.
|
|
278 Możesz w tym celu użyć opcji <option>-chapters</option>, na przykład
|
|
279 <option>-chapters</option> <replaceable>1-4</replaceable> zakoduje z DVD
|
|
280 tylko rozdziały od 1 do 4.
|
|
281 Jest to zwłaszcza użyteczne gdy robisz kodowanie do wielkości 1400 MB,
|
|
282 przeznaczone na 2 CD, ponieważ możesz się upewnić że przerwa nastąpi
|
|
283 dokładnie na granicy rozdziałów a nie w środku sceny.
|
|
284 </para>
|
|
285 <para>
|
|
286 Jeśli masz obsługiwaną kartę przechwytywania TV, możesz też kodować z jej
|
|
287 urządzenia wejściowego.
|
|
288 Użyj opcji <option>tv://</option><replaceable>numerkanału</replaceable> jako
|
|
289 nazwy pliku, a opcją <option>-tv</option> skonfiguruj rozmaite ustawienia
|
|
290 przechwytywania.
|
|
291 Podobnie działa wejście z DVB.
|
|
292 </para>
|
|
293 </sect1>
|
|
294
|
|
295
|
|
296 <sect1 id="menc-feat-mpeg4">
|
|
297 <title>Kodowanie dwuprzebiegowe MPEG-4 ("DivX")</title>
|
|
298
|
|
299 <para>
|
|
300 Nazwa związana jest z faktem, iż przy użyciu tej metody plik kodowany jest
|
|
301 <emphasis>dwa razy</emphasis>.
|
11722
|
302 Pierwsze kodowanie (dubbed pass) tworzy pliki tymczasowe
|
19027
|
303 (<filename>*.log</filename>) o rozmiarze kilku megabajtów, nie kasuj ich od
|
|
304 razu (możesz natomiast skasować plik AVI a jeszcze lepiej nie tworzyć go
|
|
305 w ogóle poprzez zapisywanie w <filename>/dev/null</filename>).
|
|
306 W drugim przebiegu przy pomocy danych o bitrate z plików tymczasowych tworzony
|
|
307 jest plik wyjściowy drugiego przebiegu. Plik końcowy będzie miał o wiele lepszą
|
|
308 jakość w porównaniu ze standardowym 1-przebiegowym kodowaniem.
|
11722
|
309 Jeżeli pierwszy raz o tym słyszysz, powinieneś zajrzeć do któregoś z wielu
|
|
310 przewodników dostępnych w sieci.
|
|
311 </para>
|
|
312
|
14240
|
313 <example>
|
|
314 <title>kopiowanie ścieżki dźwiękowej</title>
|
11722
|
315 <para>
|
19027
|
316 Dwuprzebiegowe kodowanie DVD do MPEG-4 ("DivX") AVI z kopiowaniem ścieżki dźwiękowej.
|
11722
|
317 <screen>
|
19027
|
318 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o /dev/null
|
|
319 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 -oac copy -o <replaceable>output.avi</replaceable>
|
11722
|
320 </screen>
|
|
321 </para>
|
14240
|
322 </example>
|
11722
|
323
|
|
324 <example>
|
19027
|
325 <title>kodowanie ścieżki dźwiękowej</title>
|
11722
|
326 <para>
|
19027
|
327 Dwuprzebiegowe kodowanie DVD do MPEG-4 ("DivX") AVI z kodowaniem ścieżki dźwiękowej do MP3.
|
|
328 Uważaj stosując tę metodę, ponieważ w niektórych przypadkach może zaowocować
|
|
329 desynchronizacją audio/video.
|
11722
|
330 <screen>
|
19027
|
331 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac mp3lame -lameopts vbr=3 -o /dev/null
|
|
332 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 -oac mp3lame -lameopts vbr=3 -o <replaceable>output.avi</replaceable>
|
11722
|
333 </screen>
|
|
334 </para>
|
|
335 </example>
|
|
336 </sect1>
|
|
337
|
|
338 <sect1 id="menc-feat-mpeg">
|
|
339 <title>Kodowanie do formatu MPEG</title>
|
|
340 <para>
|
|
341 <application>MEncoder</application> może tworzyć pliki formatu MPEG (MPEG-PS).
|
19027
|
342 Zazwyczaj, jeśli używasz filmu MPEG-1 albo MPEG-2, to jest tak ponieważ
|
|
343 kodujesz na ograniczony format, taki jak SVCD, VCD albo DVD.
|
|
344 Specyficzne ograniczenia tych formatów są wyjaśnione w
|
|
345 <link linkend="menc-feat-vcd-dvd">przewodniku tworzenia VCD i DVD</link>.
|
11722
|
346 </para>
|
|
347
|
|
348 <para>
|
|
349 Aby zmienić wyjściowy format plików <application>MEncodera</application>, użyj opcji <option>-of mpeg</option>.
|
|
350 </para>
|
|
351
|
19027
|
352 <informalexample>
|
11722
|
353 <para>
|
|
354 Przykład:
|
|
355 <screen>
|
19027
|
356 mencoder <replaceable>wejscie.avi</replaceable> -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy <replaceable>inne_opcje</replaceable> -o <replaceable>wyjscie.mpg</replaceable>
|
|
357 </screen>
|
|
358 Tworzenie pliku MPEG-1, który można odtworzyć na systemach z minimalną obsługą
|
|
359 multimedialną, taką jak domyślne instalacje Windows:
|
|
360 <screen>
|
|
361 mencoder <replaceable>wejscie.avi</replaceable> -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 -o <replaceable>wyjscie.mpg</replaceable> -oac lavc -ovc lavc \
|
|
362 -lavcopts acodec=mp2:abitrate=224:vcodec=mpeg1video:vbitrate=1152:keyint=15:mbd=2:aspect=4/3
|
11722
|
363 </screen>
|
|
364 </para>
|
19027
|
365 </informalexample>
|
19100
|
366 <note><title>Wskazówka:</title>
|
|
367 <para>
|
|
368 Jeżeli z jakiegoś powodu nie satysfakcjonuje cię jakość wideo
|
|
369 z drugiego przebiegu, możesz ponownie uruchomić kodowanie
|
|
370 swojego wideo z inną docelową szybkością transmisji (bitrate),
|
|
371 zakładając, że zapisałeś statystyki pliku z poprzedniego przebiegu.
|
|
372 Jest to możliwe, ponieważ głównym celem pliku ze statystykami jest
|
|
373 zapamiętanie złożoności każdej z ramek, co nie zależy zbyt mocno
|
|
374 od szybkości transmisji. Weź jednak pod uwagę, że uzyskasz najlepsze
|
|
375 wyniki, jeżeli wszystkie przebiegi będą uruchomione z nieróżniącymi
|
|
376 się za bardzo docelowymi szybkościami transmisji.
|
|
377 </para>
|
|
378 </note>
|
19027
|
379
|
11722
|
380 </sect1>
|
|
381
|
|
382 <sect1 id="menc-feat-rescale">
|
|
383 <title>Przeskalowywanie filmów</title>
|
|
384
|
|
385 <para>
|
14240
|
386 Często zachodzi potrzeba zmiany wielkości obrazu. Powodów tego może być wiele:
|
|
387 zmniejszenie rozmiaru pliku, przepustowość sieci, itd. Większość ludzi stosuje
|
19027
|
388 przeskalowywanie nawet przy konwertowaniu płyt DVD, SVCD do DivX AVI. Jeżeli
|
14240
|
389 chcesz przeskalowywać, przeczytaj sekcję o <link linkend="aspect">zachowywaniu proporcji obrazu</link>.
|
11722
|
390 </para>
|
|
391
|
|
392 <para>
|
19027
|
393 Proces skalowania obsługiwany jest przez filtr video <literal>scale</literal>:
|
11722
|
394 <option>-vf scale=<replaceable>szerokość</replaceable>:<replaceable>wysokość</replaceable></option>.
|
|
395 Jego jakość może być ustawiona parametrem <option>-sws</option>.
|
14240
|
396 Jeśli nie jest on podany <application>MEncoder</application> użyje wartości 2: bicubic.
|
11722
|
397 </para>
|
|
398
|
|
399 <para>
|
|
400 Przykład:
|
|
401 <screen>
|
19027
|
402 mencoder <replaceable>wejscie.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -vf scale=640:480 -o <replaceable>wyjscie.avi</replaceable>
|
11722
|
403 </screen>
|
|
404 </para>
|
|
405 </sect1>
|
|
406
|
|
407
|
|
408 <sect1 id="menc-feat-streamcopy">
|
|
409 <title>Kopiowanie strumienia</title>
|
|
410
|
|
411 <para>
|
|
412 <application>MEncoder</application> obsługuje strumienie wejściowe na dwa sposoby:
|
|
413 <emphasis role="bold">koduje</emphasis> lub <emphasis role="bold">kopiuje</emphasis>
|
|
414 je. Ta sekcja jest o <emphasis role="bold">kopiowaniu</emphasis>.
|
|
415 </para>
|
|
416
|
|
417 <itemizedlist>
|
|
418 <listitem><para>
|
|
419 <emphasis role="bold">Strumień video</emphasis> (opcja <option>-ovc copy</option>):
|
14240
|
420 można ładne rzeczy wyczyniać:) Jak wstawianie (nie konwertowanie) FLI, VIDO lub MPEG-1 video w plik AVI!
|
11722
|
421 Oczywiście tylko <application>MPlayer</application> potrafi odtwarzać takie pliki :) I prawdopodobnie nie ma
|
14240
|
422 dla tego żadnego sensownego zastosowania. Poważniej: kopiowanie strumieni video może być przydatne
|
19027
|
423 wtedy, gdy np. tylko strumień audio ma być zakodowany (np. PCM do MP3).
|
11722
|
424 </para></listitem>
|
|
425 <listitem><para>
|
|
426 <emphasis role="bold">Strumień audio</emphasis> (opcja <option>-oac copy</option>):
|
19027
|
427 prosto i przystępnie. Możliwe jest wmiksowanie zewnętrznego źródła (MP3, WAV)
|
|
428 do strumienia wyjściowego. Użyj w tym celu opcji
|
|
429 <option>-audiofile <replaceable>nazwa_pliku</replaceable></option>.
|
11722
|
430 </para></listitem>
|
|
431 </itemizedlist>
|
|
432
|
|
433 <para>
|
19027
|
434 Używanie <option>-oac copy</option> do kopiowania z jednego formatu
|
|
435 przechowywania do innego może wymagać użycia <option>-fafmttag</option> żeby
|
|
436 utrzymać znacznik formatu audio z oryginalnego zbioru.
|
|
437 Na przykład jeśli konwertujesz zbiór NSV z audio zakodowanym AAC do formatu
|
|
438 AVI, to znacznik formatu audio będzie nieprawidłowy i musi zostać zmieniony.
|
|
439 Listę znaczników formatów audio znajdziesz w pliku
|
|
440 <filename>codecs.conf</filename>.
|
11722
|
441 </para>
|
|
442
|
|
443 <para>
|
19027
|
444 Przykład:
|
|
445 <screen>
|
|
446 mencoder <replaceable>wejście.nsv</replaceable> -oac copy -fafmttag 0x706D -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -o <replaceable>wyjście.avi</replaceable>
|
|
447 </screen>
|
11722
|
448 </para>
|
|
449
|
|
450 </sect1>
|
|
451
|
|
452
|
19027
|
453
|
11722
|
454 <sect1 id="menc-feat-enc-images">
|
19027
|
455 <title>Kodowanie z wielu wejściowych plików obrazkowych (JPEG, PNG, TGA, SGI)</title>
|
11722
|
456
|
|
457 <para>
|
|
458 <application>MEncoder</application> jest w stanie stworzyć film z jednego
|
|
459 lub wielu plików JPEG, PNG lub TGA. Poprzez proste kopiowanie ramek może stworzyć pliki MJPEG
|
14240
|
460 (Motion (ruchomy - przypis tłumacza) JPEG), MPNG (Motion PNG) lub MTGA (Motion TGA).
|
11722
|
461 </para>
|
|
462
|
|
463 <orderedlist>
|
|
464 <title>Jak to działa:</title>
|
|
465 <listitem><para>
|
|
466 <application>MEncoder</application> <emphasis>dekoduje</emphasis> wejściowy obrazek/obrazki z pomocą biblioteki
|
|
467 <systemitem class="library">libjpeg</systemitem> (w przypadku dekodowania PNG, skorzysta z
|
|
468 <systemitem class="library">libpng</systemitem>).
|
|
469 </para></listitem>
|
|
470 <listitem><para>
|
|
471 Potem <application>MEncoder</application> kompresuje zdekodowane pliki podanym kompresorem
|
14240
|
472 (DivX4, XviD, FFmpeg msmpeg4, itd.).
|
11722
|
473 </para></listitem>
|
|
474 </orderedlist>
|
|
475
|
|
476 <formalpara>
|
|
477 <title>Przykłady</title>
|
|
478 <para>
|
|
479 Opis i sposób działania funkcji <option>-mf</option> znajdują się na stronie man.
|
|
480
|
|
481 <informalexample>
|
|
482 <para>
|
14240
|
483 Tworzenie pliku MPEG-4 ze wszystkich plików JPEG w aktualnym katalogu:
|
11722
|
484 <screen>
|
19027
|
485 mencoder mf://<replaceable>ramka001.jpg,ramka002.jpg</replaceable> -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o <replaceable>wyjście.avi</replaceable>
|
|
486 </screen>
|
|
487 </para>
|
|
488 </informalexample>
|
|
489
|
|
490 <informalexample>
|
|
491 <para>
|
|
492 Tworzenie plików MPEG-4 z jawnie podanej listy plików JPEG (list.txt w aktualnym
|
|
493 katalogu, zawiera listę plików, które mają zostać użyte jako źródło, po jednym w każdej linii):
|
|
494 <screen>
|
|
495 mencoder mf://<replaceable>@list.txt</replaceable> -mf w=800:h=600:fps=25:type=jpg \
|
|
496 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o <replaceable>wyjscie.avi</replaceable>
|
14240
|
497 </screen>
|
11722
|
498 </para>
|
|
499 </informalexample>
|
|
500
|
|
501 <informalexample>
|
|
502 <para>
|
14240
|
503 Tworzenie pliku MPEG-4 z wybranych plików JPEG w aktualnym katalogu:
|
11722
|
504 <screen>
|
19027
|
505 mencoder mf://<replaceable>klatka001.jpg,klatka002.jpg</replaceable> -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o <replaceable>wyjscie.avi</replaceable>
|
14240
|
506 </screen>
|
11722
|
507 </para>
|
|
508 </informalexample>
|
|
509
|
|
510 <informalexample>
|
|
511 <para>
|
14240
|
512 Tworzenie pliku Motion JPEG (MJPEG) ze wszystkich plików JPEG w aktualnym katalogu:
|
11722
|
513 <screen>
|
19027
|
514 mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc copy -ovc copy -o <replaceable>wyjście.avi</replaceable>
|
|
515 </screen>
|
11722
|
516 </para>
|
|
517 </informalexample>
|
|
518
|
|
519 <informalexample>
|
|
520 <para>
|
|
521 Tworzenie nieskompresowanego pliku ze wszystkich plików PNG w aktualnym katalogu:
|
|
522 <screen>
|
19027
|
523 mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc raw -oac copy -o <replaceable>output.avi</replaceable>
|
|
524 </screen>
|
11722
|
525 </para>
|
|
526 </informalexample>
|
|
527
|
19027
|
528 <note><title>Informacja:</title><para>
|
|
529 Szerokość musi być liczbą podzielną przez 4, takie są ograniczenia formatu RAW RGB AVI.
|
11722
|
530 </para></note>
|
|
531
|
|
532 <informalexample>
|
|
533 <para>
|
|
534 Tworzenie pliku Motion PNG (MPNG) ze wszystkich plików PNG w aktualnym katalogu:
|
14240
|
535 <screen>mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc copy -oac copy -o <replaceable>wyjscie.avi</replaceable> <!--
|
|
536 --></screen>
|
11722
|
537 </para>
|
|
538 </informalexample>
|
|
539
|
|
540 <informalexample>
|
|
541 <para>
|
|
542 Tworzenie pliku Motion TGA (MTGA) ze wszystkich plików TGA w aktualnym katalogu:
|
|
543 <screen>
|
14240
|
544 mencoder mf://*.tga -mf w=800:h=600:fps=25:type=tga -ovc copy -oac copy -o <replaceable>wyjscie.avi</replaceable><!--
|
|
545 --></screen>
|
11722
|
546 </para>
|
|
547 </informalexample>
|
|
548
|
|
549 </para>
|
|
550 </formalpara>
|
|
551 </sect1>
|
|
552
|
|
553
|
|
554 <sect1 id="menc-feat-extractsub">
|
19027
|
555 <title>Wydobywanie napisów z DVD do pliku VOBsub</title>
|
11722
|
556
|
|
557 <para>
|
|
558 <application>MEncoder</application> jest w stanie wyciągnąć napisy z DVD do pliku
|
14240
|
559 w formacie VOBsub. Tworzy je para plików z rozszerzeniem
|
11722
|
560 <filename>.idx</filename> i <filename>.sub</filename>, które są zazwyczaj spakowane do
|
|
561 pojedyńczego archiwum <filename>.rar</filename>.
|
|
562 <application>MPlayer</application> może je odtwarzać z opcjami
|
|
563 <option>-vobsub</option> i <option>-vobsubid</option>.
|
|
564 </para>
|
|
565
|
|
566 <para>
|
|
567 Podajesz nazwę bazową (tzn. bez rozszerzenia <filename>.idx</filename> lub
|
19027
|
568 <filename>.sub</filename>) pliku wyjściowego opcją
|
|
569 <option>-vobsubout</option> oraz indeks dla tego pliku opcją <option>-vobsuboutindex</option>.
|
11722
|
570 </para>
|
|
571
|
|
572 <para>
|
14240
|
573 Jeżeli źródłem nie jest DVD powinieneś użyć opcji <option>-ifo</option>, aby
|
11722
|
574 wskazać plik <filename>.ifo</filename> potrzebny do stworzenia pliku wynikowego
|
|
575 <filename>.idx</filename>.
|
|
576 </para>
|
|
577
|
|
578 <para>
|
|
579 Jeżeli źródłem nie jest DVD i nie masz pliku <filename>.ifo</filename>, będziesz musiał użyć opcji
|
|
580 <option>-vobsubid</option>, aby podać id języka, które będzie umieszczone w pliku
|
|
581 <filename>.idx</filename>.
|
|
582 </para>
|
|
583
|
|
584 <para>
|
14240
|
585 Każde uruchomienie dołączy do istniejących napisów, jeżeli pliki <filename>.idx</filename>
|
11722
|
586 i <filename>.sub</filename> istnieją. Więc powinieneś je usunąć przed uruchomieniem.
|
|
587 </para>
|
|
588
|
|
589 <example>
|
14510
|
590 <title>Kopiowanie dwóch napisów z DVD podczas dwu-przebiegowego kodowania</title>
|
11722
|
591 <screen>
|
|
592 rm subtitles.idx subtitles.sub
|
14240
|
593 mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -vobsubout subtitles -vobsuboutindex 0 -sid 2
|
19027
|
594 mencoder dvd://1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vpass=2 -vobsubout subtitles -vobsuboutindex 1 -sid 5<!--
|
14240
|
595 --></screen>
|
11722
|
596 </example>
|
|
597
|
|
598 <example>
|
|
599 <title>Kopiowanie francuskich napisów z pliku MPEG</title>
|
|
600 <screen>
|
|
601 rm napisy.idx napisy.sub
|
19027
|
602 mencoder <replaceable>film.mpg</replaceable> -ifo <replaceable>film.ifo</replaceable> -vobsubout napisy -vobsuboutindex 0 -vobsuboutid fr -sid 1 -nosound -ovc copy<!--
|
11722
|
603 --></screen>
|
|
604 </example>
|
|
605
|
|
606 </sect1>
|
|
607
|
|
608 <sect1 id="aspect">
|
|
609 <title>Utrzymywanie proporcji obrazu (aspect ratio)</title>
|
|
610 <para>
|
19027
|
611 Pliki DVD i SVCD (tzn. MPEG-1/2) zawierają informacje o proporcji obrazu, która
|
|
612 opisuje, jak odtwarzacz ma skalować strumień video, żeby ludzie nie byli jajogłowi
|
|
613 (np.: 480x480 + 4:3 = 640x480).
|
14240
|
614 Jednak przy kodowaniu plików AVI (DivX) musisz być świadom, że nagłówek AVI nie przechowuje
|
11722
|
615 tej wartości. Przeskalowywanie jest obrzydliwe i czasochłonne, musi być jakiś lepszy sposób!
|
|
616 </para>
|
|
617
|
|
618 <para>Jest</para>
|
|
619
|
|
620 <para>
|
14240
|
621 MPEG-4 posiada unikalną cechę: strumień video może posiadać swoją wartość proporcji obrazu.
|
19100
|
622 Tak, dokładnie jak pliki MPEG-1/2 (DVD, SVCD) i H.263. Niestety, istnieje tylko kilka
|
|
623 odtwarzaczy wideo, pomijając <application>MPlayera</application>, które
|
|
624 obsługują tą cechę MPEG-4.
|
11722
|
625 </para>
|
|
626
|
|
627 <para>
|
14240
|
628 Możliwość ta może być jedynie używana z kodekiem <systemitem>mpeg4</systemitem>
|
11862
|
629 z biblioteki <link linkend="ffmpeg"><systemitem class="library">libavcodec</systemitem></link>.
|
|
630 Pamiętaj: chociaż <application>MPlayer</application>
|
|
631 poprawnie odtworzy stworzone pliki, inne odtwarzacze
|
19100
|
632 mogą użyć złych proporcji obrazu (aspect ratio).
|
11722
|
633 </para>
|
|
634
|
|
635 <para>
|
|
636 Z pewnością powinieneś wyciąć czarne pasy nad i pod obrazem.
|
19027
|
637 Zobacz jak używać filtrów <systemitem>cropdetect</systemitem>
|
|
638 i <systemitem>crop</systemitem> na stronie man.
|
11722
|
639 </para>
|
|
640
|
|
641 <para>
|
|
642 Sposób użycia:
|
19027
|
643 <screen>mencoder <replaceable>przykładowy-svcd.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:autoaspect -vf crop=714:548:0:14 -oac copy -o <replaceable>wyjście.avi</replaceable></screen>
|
11722
|
644 </para>
|
|
645 </sect1>
|
|
646
|
|
647 </chapter>
|