annotate DOCS/xml/en/mencoder.xml @ 10869:364d43cee33e

sync with HTML
author diego
date Mon, 15 Sep 2003 01:21:04 +0000
parents 3cabc04945c9
children 49b1a67e7381
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
1 <?xml version="1.0" encoding="iso-8859-1"?>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
2 <chapter id="mencoder">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
3 <title>Encoding with MEncoder</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
4
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
5 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
6 For the complete list of available <application>MEncoder</application> options
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
7 and examples, please see the man page. For a series of hands-on examples and
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
8 detailed guides on using several encoding parameters, read the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
9 <ulink url="../../tech/encoding-tips.txt">encoding-tips</ulink> that were
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
10 collected from several mailing list threads on mplayer-users. Search the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
11 <ulink url="http://mplayerhq.hu/pipermail/mplayer-users/">archives</ulink>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
12 for a wealth of discussions about all aspects of and problems related to
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
13 encoding with <application>MEncoder</application>.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
14 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
15
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
16 <sect1 id="menc-feat-divx4">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
17 <title>Encoding 2 or 3-pass MPEG-4 (&quot;DivX&quot;)</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
18
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
19 <formalpara>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
20 <title>2-pass encoding</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
21 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
22 The name comes from the fact that this method encodes the file <emphasis>twice</emphasis>.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
23 The first encoding (dubbed pass) creates some temporary files
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
24 (<filename>*.log</filename>) with a size of few megabytes, do not delete
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
25 them yet (you can delete the AVI). In the second pass, the 2-pass output
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
26 file is created, using the bitrate data from the temporary files. The
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
27 resulting file will have much better image quality. If this is the first
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
28 time you heard about this, you should consult some guides available on the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
29 Net.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
30 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
31 </formalpara>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
32
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
33 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
34 This example shows how to encode a DVD to a 2-pass MPEG-4 (&quot;DivX&quot;) AVI.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
35 Just two commands are needed:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
36 <screen>rm frameno.avi</screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
37 remove this file, which can come from a previous 3-pass encoding (it interferes
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
38 with current one)
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
39 <screen>
10184
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
40 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
41 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
42 </screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
43 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
44
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
45 <formalpara>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
46 <title>3-pass encoding</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
47 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
48 This is an extension of 2-pass encoding, where the audio encoding takes
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
49 place in a separate pass. This method enables estimation of recommended
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
50 video bitrate in order to fit on a CD. Also, the audio is encoded only
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
51 once, unlike in 2-pass mode. The schematics:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
52 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
53 </formalpara>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
54
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
55 <procedure>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
56 <step><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
57 Remove conflicting temporary file:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
58 <screen>rm frameno.avi</screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
59 </para></step>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
60 <step><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
61 <emphasis>First pass:</emphasis>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
62
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
63 <screen>mencoder <replaceable>file/DVD</replaceable> -ovc frameno -oac mp3lame -lameopts vbr=3 -o frameno.avi</screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
64
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
65 An audio-only avi file will be created, containing
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
66 <emphasis role="bold">only</emphasis> the requested audio stream. Don't forget
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
67 <option>-lameopts</option>, if you need to set it. If you were encoding a
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
68 long movie, <application>MEncoder</application> prints the recommended
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
69 bitrate values for 650Mb, 700Mb, and 800Mb destination sizes, after this
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
70 pass finishes.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
71 </para></step>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
72 <step><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
73 <emphasis>Second pass:</emphasis>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
74 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
75 mencoder <replaceable>file/DVD</replaceable> -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vpass=1:vbitrate=<replaceable>bitrate</replaceable><!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
76 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
77 This is the first pass of video encoding. Optionally specify the video
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
78 bitrate MEncoder printed at the end of the previous pass.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
79 </para></step>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
80 <step><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
81 <emphasis>Third pass:</emphasis>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
82 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
83 mencoder <replaceable>file/DVD</replaceable> -oac copy -pass 2 \
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
84 -ovc divx4 -divx4opts br=<replaceable>bitrate</replaceable>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
85 </screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
86 This is the second pass of video encoding. Specify the same bitrate
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
87 as in the previous pass unless you really know what you are doing.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
88 In this pass, audio from <filename>frameno.avi</filename> will be
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
89 inserted into the destination file...and it's all ready!
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
90 </para></step>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
91 </procedure>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
92
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
93 <example>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
94 <title>Example of 3-pass encoding</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
95 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
96 <screen>rm frameno.avi</screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
97 remove this file, which can come from a previous 3-pass encoding
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
98 (it interferes with current one)
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
99 <screen>
10184
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
100 mencoder dvd://2 -ovc frameno -o frameno.avi -oac mp3lame -lameopts vbr=3
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
101 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac copy -o movie.avi
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
102 mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac copy -o movie.avi
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
103 </screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
104 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
105 </example>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
106 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
107
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
108 <sect1 id="menc-feat-mpeg">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
109 <title>Encoding to MPEG format</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
110 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
111 <application>MEncoder</application> can create MPEG (MPEG-PS) format output
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
112 files. It's probably useful only with <link linkend="ffmpeg">libavcodec</link>'s
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
113 <emphasis>mpeg1video</emphasis> codec, because players - except
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
114 <application>MPlayer</application> - expect MPEG1 video, and MPEG1 layer 2 (MP2)
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
115 audio streams in MPEG files.
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
116 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
117
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
118 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
119 this feature is not very useful right now, aside that it probably has many bugs,
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
120 but the more importantly because MEncoder currently cannot encode MPEG1 layer 2
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
121 (MP2) audio, which all other players expect in MPEG files.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
122 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
123
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
124 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
125 To change MEncoder's output file format, use the <option>-of mpeg</option> option.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
126 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
127
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
128 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
129 Example:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
130 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
131 mencoder -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy <replaceable>other options</replaceable> media.avi -o output.mpg
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
132 </screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
133 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
134 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
135
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
136
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
137 <sect1 id="menc-feat-rescale">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
138 <title>Rescaling movies</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
139
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
140 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
141 Often the need to resize movie images' size emerges. Its reasons can be
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
142 many: decreasing file size, network bandwidth,etc. Most people even do
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
143 rescaling when converting DVDs or SVCDs to DivX AVI. This is <emphasis role="bold">bad</emphasis>.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
144 Instead of even you doing so, read the <link linkend="aspect">Preserving aspect ratio</link>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
145 section.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
146 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
147
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
148 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
149 The scaling process is handled by the <literal>scale</literal> video filter:
9677
142c42fa0986 sync with HTML
nicolas
parents: 9675
diff changeset
150 <option>-vf scale=<replaceable>width</replaceable>:<replaceable>height</replaceable></option>.
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
151 Its quality can be set with the <option>-sws</option> option.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
152 If it's not specified, <application>MEncoder</application> will use 0: fast
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
153 bilinear.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
154 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
155
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
156 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
157 Usage:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
158 <screen>
9677
142c42fa0986 sync with HTML
nicolas
parents: 9675
diff changeset
159 mencoder <replaceable>input.mpg</replaceable> -ovc lavc -lavcopts vcodec=mpeg4 -vf scale=640:480-o <replaceable>output.avi</replaceable>
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
160 </screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
161 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
162 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
163
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
164
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
165 <sect1 id="menc-feat-streamcopy">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
166 <title>Stream copying</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
167
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
168 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
169 <application>MEncoder</application> can handle input streams in two ways:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
170 <emphasis role="bold">encode</emphasis> or <emphasis role="bold">copy</emphasis>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
171 them. This section is about <emphasis role="bold">copying</emphasis>.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
172 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
173
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
174 <itemizedlist>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
175 <listitem><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
176 <emphasis role="bold">Video stream</emphasis> (option <option>-ovc copy</option>):
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
177 nice stuff can be done :) Like, putting (not converting!) FLI or VIVO or
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
178 MPEG1 video into an AVI file! Of course only
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
179 <application>MPlayer</application> can play such files :) And it probably
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
180 has no real life value at all. Rationally: video stream copying can be
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
181 useful for example when only the audio stream has to be encoded (like,
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
182 uncompressed PCM to MP3).
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
183 </para></listitem>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
184 <listitem><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
185 <emphasis role="bold">Audio stream</emphasis> (option <option>-oac copy</option>):
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
186 straightforward. It is possible to take an external audio file (MP3,
10429
diego
parents: 10184
diff changeset
187 WAV) and mux it into the output stream. Use the
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
188 <option>-audiofile <replaceable>filename</replaceable></option> option
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
189 for this.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
190 </para></listitem>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
191 </itemizedlist>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
192 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
193
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
194
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
195 <sect1 id="menc-feat-fix-avi">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
196 <title>Fixing AVIs with broken index or interleaving</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
197
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
198 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
199 Easiest thing. We simply copy the video and audio streams, and
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
200 <application>MEncoder</application> generates the index. Of course this cannot fix possible bugs in
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
201 the video and/or audio streams. It also fixes files with broken interleaving,
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
202 thus the <option>-ni</option> option won't be needed for them anymore.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
203 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
204
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
205 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
206 Command:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
207 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
208 mencoder -idx <replaceable>input.avi</replaceable> -ovc copy -oac copy -o <replaceable>output.avi</replaceable><!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
209 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
210 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
211
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
212
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
213 <sect2 id="menc-feat-appending">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
214 <title>Appending multiple AVI files</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
215
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
216 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
217 As a side-effect, the broken AVI fixer function enables MEncoder to append
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
218 2 (or more) AVI files:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
219 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
220
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
221 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
222 Command:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
223 <screen>cat 1.avi 2.avi | mencoder -noidx -ovc copy -oac copy -o output.avi -</screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
224 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
225
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
226 <note><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
227 This expects <filename>1.avi</filename> and <filename>2.avi</filename> to use
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
228 the same codecs, resolution, stream rate etc, and at least <filename>1.avi</filename>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
229 must not be broken. You may need to fix your input AVI files first, as described
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
230 <link linkend="menc-feat-fix-avi">above</link>.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
231 </para></note>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
232 </sect2>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
233 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
234
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
235 <sect1 id="menc-feat-enc-libavcodec">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
236 <title>Encoding with the libavcodec codec family</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
237
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
238 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
239 <link linkend="ffmpeg">libavcodec</link> provides simple encoding to a lot
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
240 of interesting video and audio formats (currently its audio codecs are
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
241 unsupported). You can encode to the following codecs (more or less up to date):
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
242
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
243 <informaltable frame="all">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
244 <tgroup cols="2">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
245 <thead>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
246 <row><entry>Codec name</entry><entry>Description</entry></row>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
247 </thead>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
248 <tbody>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
249 <row><entry>mjpeg</entry><entry>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
250 Motion JPEG
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
251 </entry></row>
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
252 <row><entry>ljpeg</entry><entry>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
253 Lossless JPEG
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
254 </entry></row>
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
255 <row><entry>h263</entry><entry>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
256 H263
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
257 </entry></row>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
258 <row><entry>h263p</entry><entry>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
259 H263 Plus
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
260 </entry></row>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
261 <row><entry>mpeg4</entry><entry>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
262 ISO standard MPEG-4 (DivX 5, XVID compatible)
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
263 </entry></row>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
264 <row><entry>msmpeg4</entry><entry>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
265 pre-standard MPEG-4 variant by MS, v3 (aka DivX3)
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
266 </entry></row>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
267 <row><entry>msmpeg4v2</entry><entry>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
268 pre-standard MPEG-4 by MS, v2 (used in old asf files)
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
269 </entry></row>
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
270 <row><entry>wmv1</entry><entry>
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
271 Windows Media Video, version 1 (aka WMV7)
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
272 </entry></row>
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
273 <row><entry>wmv2</entry><entry>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
274 Windows Media Video, version 2 (aka WMV8)
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
275 </entry></row>
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
276 <row><entry>rv10</entry><entry>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
277 an old RealVideo codec
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
278 </entry></row>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
279 <row><entry>mpeg1video</entry><entry>
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
280 MPEG1 video
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
281 </entry></row>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
282 <row><entry>mpeg2video</entry><entry>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
283 MPEG2 video
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
284 </entry></row>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
285 <row><entry>huffyuv</entry><entry>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
286 lossless compression
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
287 </entry></row>
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
288 <row><entry>asv1</entry><entry>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
289 ASUS Video v1
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
290 </entry></row>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
291 <row><entry>asv2</entry><entry>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
292 ASUS Video v2
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
293 </entry></row>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
294 <row><entry>ffv1</entry><entry>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
295 FFmpeg's lossless video codec
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
296 </entry></row>
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
297 </tbody>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
298 </tgroup>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
299 </informaltable>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
300
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
301 The first column contains the codec names that should be passed after the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
302 <literal>vcodec</literal> config, like: <option>-lavcopts vcodec=msmpeg4</option>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
303 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
304
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
305 <informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
306 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
307 An example, with MJPEG compression:
10184
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
308 <screen>mencoder dvd://2 -o title2.avi -ovc lavc -lavcopts vcodec=mjpeg -oac copy</screen>
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
309 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
310 </informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
311 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
312
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
313
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
314 <sect1 id="menc-feat-enc-images">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
315 <title>Encoding from multiple input image files (JPEGs,PNGs or TGAs)</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
316
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
317 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
318 <application>MEncoder</application> is capable of creating movies from one
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
319 or more JPEG, PNG or TGA files. With simple framecopy it can create MJPEG
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
320 (Motion JPEG), MPNG (Motion PNG) or MTGA (Motion TGA) files.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
321 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
322
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
323 <orderedlist>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
324 <title>Explanation of the process:</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
325 <listitem><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
326 <application>MEncoder</application> <emphasis>decodes</emphasis> the input image(s) with
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
327 <systemitem class="library">libjpeg</systemitem> (when decoding PNGs, it
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
328 will use <systemitem class="library">libpng</systemitem>).
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
329 </para></listitem>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
330 <listitem><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
331 <application>MEncoder</application> then feeds the decoded image to the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
332 chosen video compressor (DivX4, Xvid, ffmpeg msmpeg4, etc.).
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
333 </para></listitem>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
334 </orderedlist>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
335
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
336 <formalpara>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
337 <title>Examples</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
338 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
339 The explanation of the <option>-mf</option> option can be found below in
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
340 the man page.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
341
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
342 <informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
343 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
344 Creating a DivX4 file from all the JPEG files in the current dir:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
345 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
346 mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi \*.jpg<!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
347 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
348 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
349 </informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
350
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
351 <informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
352 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
353 Creating a DivX4 file from some JPEG files in the current dir:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
354 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
355 mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi frame001.jpg,frame002.jpg <!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
356 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
357 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
358 </informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
359
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
360 <informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
361 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
362 Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
363 dir:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
364 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
365 mencoder -mf on:w=800:h=600:fps=25 -ovc copy -o output.avi \*.jpg<!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
366 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
367 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
368 </informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
369
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
370 <informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
371 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
372 Creating an uncompressed file from all the PNG files in the current dir:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
373 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
374 mencoder -mf on:w=800:h=600:fps=25:type=png -ovc raw -o output.avi \*.png<!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
375 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
376 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
377 </informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
378
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
379 <note><para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
380 Width must be integer multiple of 4, it's a limitation of the RAW RGB AVI format.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
381 </para></note>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
382
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
383 <informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
384 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
385 Creating a Motion PNG (MPNG) file from all the PNG files in the current
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
386 dir:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
387 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
388 mencoder -mf on:w=800:h=600:fps=25:type=png -ovc copy -o output.avi \*.png<!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
389 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
390 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
391 </informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
392
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
393 <informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
394 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
395 Creating a Motion TGA (MTGA) file from all the TGA files in the current
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
396 dir:
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
397 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
398 mencoder -mf on:w=800:h=600:fps=25:type=tga -ovc copy -o output.avi \*.tga<!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
399 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
400 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
401 </informalexample>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
402
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
403 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
404 </formalpara>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
405 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
406
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
407
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
408 <sect1 id="menc-feat-extractsub">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
409 <title>Extracting DVD subtitles to Vobsub file</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
410
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
411 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
412 <application>MEncoder</application> is capable of extracting subtitles from
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
413 a DVD into Vobsub fomat files. They consist of a pair of files ending in
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
414 <filename>.idx</filename> and <filename>.sub</filename> and are usually
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
415 packaged in a single <filename>.rar</filename> archive.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
416 <application>MPlayer</application> can play these with the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
417 <option>-vobsub</option> and <option>-vobsubid</option> options.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
418 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
419
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
420 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
421 You specify the basename (i.e without the <filename>.idx</filename> or
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
422 <filename>.sub</filename> extension) of the output files with
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
423 <option>-vobsubout</option> and the index for this subtitle in the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
424 resulting files with <option>-vobsuboutindex</option>.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
425 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
426
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
427 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
428 If the input is not from a DVD you should use <option>-ifo</option> to
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
429 indicate the <filename>.ifo</filename> file needed to construct the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
430 resulting <filename>.idx</filename> file.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
431 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
432
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
433 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
434 If the input is not from a DVD and you do not have the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
435 <filename>.ifo</filename> file you will need to use the
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
436 <option>-vobsubid</option> option to let it know what language id to put in
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
437 the <filename>.idx</filename> file.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
438 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
439
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
440 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
441 Each run will append the running subtitle if the <filename>.idx</filename>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
442 and <filename>.sub</filename> files already exist. So you should remove any
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
443 before starting.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
444 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
445
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
446 <example>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
447 <title>Copying two subtitles from a DVD while doing 3-pass encoding</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
448 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
449 rm subtitles.idx subtitles.sub
10184
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
450 mencoder dvd://1 -vobsubout subtitles -vobsuboutindex 0 -sid 2 -o frameno.avi -ovc frameno
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
451 mencoder dvd://1 -oac copy -ovc divx4 -pass 1
b6c63ab184a4 Changed a few remaining -dvd and -vcd options to dvd:// and vcd://.
diego
parents: 10065
diff changeset
452 mencoder dvd://1 -oac copy -ovc divx4 -pass 2 -vobsubout subtitles -vobsuboutindex 1 -sid 5<!--
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
453 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
454 </example>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
455
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
456 <example>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
457 <title>Copying a french subtitle from an MPEG file</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
458 <screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
459 rm subtitles.idx subtitles.sub
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
460 mencoder movie.mpg -ifo movie.ifo -vobsubout subtitles -vobsuboutindex 0 -vobsuboutid fr -sid 1<!--
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
461 --></screen>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
462 </example>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
463
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
464 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
465
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
466 <sect1 id="aspect">
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
467 <title>Preserving aspect ratio</title>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
468 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
469 DVDs and SVCDs (i.e. MPEG1/2) files contain an aspect ratio value, which
10065
422876da049e Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents: 9677
diff changeset
470 describes how the player should scale the video stream, so humans won't
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
471 have egg heads (ex.: 480x480 + 4:3 = 640x480). However when encoding to AVI
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
472 (DivX) files, you have be aware that AVI headers don't store this value.
10065
422876da049e Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents: 9677
diff changeset
473 Rescaling the movie is disgusting and time consuming, there has to be a better
422876da049e Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents: 9677
diff changeset
474 way!
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
475 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
476
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
477 <para>There is</para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
478
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
479 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
480 MPEG4 has an unique feature: the video stream can contain its needed aspect
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
481 ratio. Yes, just like MPEG1/2 (DVD, SVCD) and H263 files. Regretfully, there are
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
482 <emphasis role="bold">no</emphasis> video players outside which support this
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
483 attribute of MPEG4, except <application>MPlayer</application>.
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
484 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
485
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
486 <para>
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
487 This feature can be used only with <link linkend="ffmpeg">libavcodec</link>'s
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
488 <systemitem>mpeg4</systemitem> codec. Keep in mind: although
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
489 <application>MPlayer</application> will correctly play the created file,
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
490 other players will use the wrong aspect ratio.
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
491 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
492
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
493 <para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
494 You seriously should crop the black bands over and below the movie image.
10065
422876da049e Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents: 9677
diff changeset
495 See the man page for the usage of the <systemitem>cropdetect</systemitem> and
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
496 <systemitem>crop</systemitem> filters.
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
497 </para>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
498
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
499 <para>
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
500 Usage
10065
422876da049e Error in the aspect ratio calculation, plus typos and rewordings.
diego
parents: 9677
diff changeset
501 <screen>mencoder sample-svcd.mpg -ovc lavc -lavcopts vcodec=mpeg4:autoaspect -vf crop=714:548:0:14 -oac copy -o output.avi</screen>
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
502 </para>
10869
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
503 </sect1>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
504
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
505 <sect1 id="custommatrices"><title>Custom inter/intra matrices</title>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
506
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
507 <para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
508 With this feature of <link linkend="ffmpeg">libavcodec</link> you are
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
509 able to set custom inter (I-frames/key frames) and intra (P-frames/predicted
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
510 frames) matrices. It is supported by many of the codecs:
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
511 <systemitem>mpeg1video</systemitem> and <systemitem>mpeg2video</systemitem>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
512 are reported as working.
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
513 </para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
514
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
515 <para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
516 A typical usage of this feature is to set the matrices preferred by the
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
517 <ulink url="http://www.kvcd.net/">KVCD</ulink> specifications.
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
518 </para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
519
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
520 <para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
521 The <emphasis role="bold">KVCD &quot;Notch&quot; Quantization Matrix:</emphasis>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
522 </para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
523
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
524 <para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
525 Intra:
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
526 <screen>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
527 8 9 12 22 26 27 29 34
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
528 9 10 14 26 27 29 34 37
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
529 12 14 18 27 29 34 37 38
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
530 22 26 27 31 36 37 38 40
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
531 26 27 29 36 39 38 40 48
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
532 27 29 34 37 38 40 48 58
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
533 29 34 37 38 40 48 58 69
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
534 34 37 38 40 48 58 69 79
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
535 </screen>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
536
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
537 Inter:
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
538 <screen>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
539 16 18 20 22 24 26 28 30
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
540 18 20 22 24 26 28 30 32
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
541 20 22 24 26 28 30 32 34
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
542 22 24 26 30 32 32 34 36
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
543 24 26 28 32 34 34 36 38
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
544 26 28 30 32 34 36 38 40
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
545 28 30 32 34 36 38 42 42
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
546 30 32 34 36 38 40 42 44
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
547 </screen>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
548 </para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
549
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
550 <para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
551 Usage:
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
552 <screen>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
553 $ mencoder input.avi -o output.avi -oac copy -ovc lavc -lavcopts inter_matrix=...:intra_matrix=...
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
554 </screen>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
555 </para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
556
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
557 <para>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
558 <screen>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
559 $ mencoder input.avi -ovc lavc -lavcopts
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
560 vcodec=mpeg2video:intra_matrix=8,9,12,22,26,27,29,34,9,10,14,26,27,29,34,37,
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
561 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,
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
562 29,34,37,38,40,48,58,29,34,37,38,40,48,58,69,34,37,38,40,48,58,69,79
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
563 :inter_matrix=16,18,20,22,24,26,28,30,18,20,22,24,26,28,30,32,20,22,24,26,
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
564 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,
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
565 36,38,40,28,30,32,34,36,38,42,42,30,32,34,36,38,40,42,44 -oac copy -o svcd.mpg
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
566 </screen>
364d43cee33e sync with HTML
diego
parents: 10429
diff changeset
567 </para>
9675
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
568 </sect1>
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
569
62c5a17038ba XML version of MPlayer's doc
nicolas
parents:
diff changeset
570 </chapter>