summaryrefslogtreecommitdiffstats
path: root/DOCS/xml/en/codecs.xml
blob: 3a5fb575275a154f1d3f043317de69d271778c44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter id="codecs">
<title>Codecs</title>

<sect1 id="video-codecs">
<title>Video codecs</title>

<para>
The <ulink url="../../codecs-status.html">codec status table</ulink> is a
complete list of all supported codecs, regenerated daily.
Some binary codecs for use with MPlayer are available in the
<ulink url="http://www.mplayerhq.hu/design7/dload.html#binary_codecs">download section</ulink>
of our homepage.
</para>

<para>
If you have a Win32 codec which is not supported yet,
please read the <link linkend="codec-importing">codec importing HOWTO</link>
and help us add support for it.
</para>

<!-- ********** -->

<sect2 id="ffmpeg" xreflabel="FFmpeg/libavcodec">
<title>FFmpeg/libavcodec</title>

<para>
<ulink url="http://ffmpeg.org">FFmpeg</ulink> contains
<systemitem class="library">libavcodec</systemitem>, the leading
open source video and audio codec library. It is capable
of decoding most multimedia formats, usually at higher speeds
than the alternatives, and aims to add support for
the rest of them eventually. It is the default decoder for
the majority of codecs that <application>MPlayer</application>
supports. Encoding is also possible for some formats and
supported in <application>MEncoder</application>.
</para>

<para>
For a complete list of supported 
<ulink url="http://ffmpeg.mplayerhq.hu/general.html#SEC6">video</ulink>
and <ulink url="http://ffmpeg.mplayerhq.hu/general.html#SEC7">audio</ulink>
codecs please visit the FFmpeg homepage.
</para>

<para>
<application>MPlayer</application> contains
<systemitem class="library">libavcodec</systemitem>.
Just run <filename>./configure</filename> and compile.
</para>
</sect2>

<!-- ********** -->

<sect2 id="xvid">
<title>Xvid</title>

<para>
<ulink url="http://www.xvid.org">Xvid</ulink> is a free software MPEG-4 ASP
compliant video codec. Note that Xvid is not necessary to decode Xvid-encoded
video. <systemitem class="library">libavcodec</systemitem> is used by
default as it offers better speed.
</para>

<procedure>
<title>Installing <systemitem class="library">Xvid</systemitem></title>
<para>
  Like most open source software, it is available in two flavors:
  <ulink url="http://www.xvid.org/downloads.html">official releases</ulink>
  and the CVS version.
  The CVS version is usually stable enough to use, as most of the time it
  features fixes for bugs that exist in releases.
  Here is what to do to make <systemitem class="library">Xvid</systemitem>
  CVS work with <application>MEncoder</application>:
</para>
<step><para>
  <screen>cvs -z3 -d:pserver:anonymous@cvs.xvid.org:/xvid login</screen>
</para></step>
<step><para>
  <screen>cvs -z3 -d:pserver:anonymous@cvs.xvid.org:/xvid co xvidcore</screen>
</para></step>
<step><para>
  <screen>cd xvidcore/build/generic</screen>
</para></step>
<step><para>
  <screen>./bootstrap.sh &amp;&amp; ./configure</screen>
  You may have to add some options (examine the output of
  <command>./configure --help</command>).
</para></step>
<step><para>
  <screen>make &amp;&amp; make install</screen>
</para></step>
<step><para>
  Recompile <application>MPlayer</application>.
</para></step>
</procedure>
</sect2>

<!-- ********** -->

<sect2 id="codec-x264">
<title><systemitem class="library">x264</systemitem></title>

<para>
<ulink url="http://developers.videolan.org/x264.html"><systemitem class="library">x264</systemitem></ulink>
is a library for creating H.264 video.
<application>MPlayer</application> sources are updated whenever
an <systemitem class="library">x264</systemitem> API change
occurs, so it is always suggested to use
<application>MPlayer</application> from Subversion.
</para>

<para>
If you have a GIT client installed, the latest x264
sources can be gotten with this command:
<screen>git clone git://git.videolan.org/x264.git</screen>

Then build and install in the standard way:
<screen>./configure &amp;&amp; make &amp;&amp; make install</screen>

Now rerun <filename>./configure</filename> for
<application>MPlayer</application> to pick up
<systemitem class="library">x264</systemitem> support.
</para>
</sect2>
</sect1>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<sect1 id="audio-codecs">
<title>Audio codecs</title>


<sect2 id="swac3">
<title>Software AC-3 decoding</title>

<para>
This is the default decoder used for files with AC-3 audio.
</para>

<para>
The AC-3 decoder can create audio output mixes for 2, 4, or 6 speakers.
When configured for 6 speakers, this decoder provides separate output of
all the AC-3 channels to the sound driver, allowing for full "surround
sound" experience without the external AC-3 decoder required to use the
hwac3 codec.
</para>

<para>
Use the <option>-channels</option> option to select the number of output
channels.  Use <option>-channels 2</option> for a stereo downmix.  For a 4
channel downmix (Left Front, Right Front, Left Surround and Right Surround
outputs), use <option>-channels 4</option>.  In this case, any center
channel will be mixed equally to the front channels.
<option>-channels 6</option> will output all the AC-3 channels as they are
encoded - in the order Left, Right, Left Surround, Right Surround, Center and
LFE.
</para>

<para>
The default number of output channels is 2.
</para>

<para>
To use more than 2 output channels, you will need to use OSS, and have a
sound card that supports the appropriate number of output channels via the
SNDCTL_DSP_CHANNELS ioctl.  An example of a suitable driver is emu10k1
(used by Soundblaster Live! cards) from August 2001 or newer (ALSA CVS is
also supposed to work).
</para>
</sect2>

<!-- ********** -->

<sect2 id="hwac3">
<title>Hardware AC-3 decoding</title>

<para>
You need an AC-3 capable sound card, with digital out (S/PDIF). The card's
driver must properly support the AFMT_AC3 format (C-Media does).  Connect
your AC-3 decoder to the S/PDIF output, and use the <option>-ac
hwac3</option> option. It is experimental but known to work with C-Media
cards and Soundblaster Live! + ALSA (but not OSS) drivers and DXR3/Hollywood+
MPEG decoder cards.
</para>
</sect2>

<!-- ********** -->

<sect2 id="libmad">
<title><systemitem class="library">libmad</systemitem> support</title>

<para>
<ulink url="http://www.underbit.com/products/mad/"><systemitem class="library">libmad</systemitem></ulink>
is a multiplatform, integer (internally 24bit PCM) only
MPEG audio decoding library. It does not handle broken files well, and it
sometimes has problems with seeking, but it may perform better on FPU-less
(such as <link linkend="arm">ARM</link>)
platform than <systemitem class="library">mp3lib</systemitem>.
</para>

<para>
If you have a proper installation of
<systemitem class="library">libmad</systemitem>,
<filename>./configure</filename> will notice and support for MPEG audio
decoding via <systemitem class="library">libmad</systemitem> will be built
automatically.
</para>
</sect2>

<!-- ********** -->

<sect2 id="hwmpa">
<title>Hardware MPEG audio codec</title>

<para>
This codec (selected by <option>-ac hwmpa</option>) passes through MPEG audio
packets to hardware decoders, such as the ones found in full-featured DVB cards 
and DXR2 adapters.
Don't use it in combination with any other audio output device
(such as OSS and ALSA) that isn't able to decode it (you will hear
only white noise).
</para>
</sect2>

<!-- ********** -->

<sect2 id="aac">
<title>AAC codec</title>

<para>
An open source AAC decoder called FAAD2 is available from
<ulink url="http://www.audiocoding.com/downloads.html"/>.
<application>MPlayer</application> includes a copy of it in its source tree.
If you want to use the external library instead, install it and pass
<option>--enable-faad-external</option> to <filename>./configure</filename>.
</para>

<para>
FAAD2 binaries are not available from audiocoding.com, but you can (apt-)get
Debian packages from
<ulink url="http://www.debian-multimedia.org/">Christian Marillat</ulink>,
Mandrake/Mandriva RPMs from the <ulink url="http://plf.zarb.org">P.L.F</ulink>
and Fedora RPMs from <ulink url="http://rpm.livna.org/">Livna</ulink>.
</para>
<para>
If you choose to build from source, you do not need all of FAAD2 to decode
AAC files, libfaad is enough. Build it like this:
<screen>
cd faad2/
sh bootstrap
./configure
cd libfaad
make
make install
</screen>
</para>
</sect2>

<!-- ********** -->

<sect2 id="amr">
<title>AMR codecs</title>

<para>
Adaptive Multi-Rate speech codec is used in third generation (3G) mobile
phones.
Reference implementation is available from
<ulink url="http://www.3gpp.org">The 3rd Generation Partnership Project</ulink>
(free for private use).
To enable support, download and install support libraries for
<ulink url="http://www.penguin.cz/~utx/amr">AMR-NB and AMR-WB</ulink>
following the instructions on that page. Recompile MPlayer afterwards.
</para>
</sect2>

</sect1>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<sect1 id="codec-importing">
<title>Win32 codecs importing HOWTO</title>

<!-- TODO: a short paragraph of text would be nice here... -->

<sect2 id="vfw-codecs">
<title>VFW codecs</title>

<para>
VFW (Video for Windows) is the old Video API for Windows. Its codecs have
the <filename>.DLL</filename> or (rarely) <filename>.DRV</filename>
extension.  If <application>MPlayer</application> fails at playing your AVI
with this kind of message:
<screen>UNKNOWN video codec: HFYU (0x55594648)</screen>
It means your AVI is encoded with a codec which has the HFYU fourcc (HFYU =
HuffYUV codec, DIV3 = DivX Low Motion, etc.). Now that you know this, you
have to find out which DLL Windows loads in order to play this file. In our
case, the <filename>system.ini</filename> contains this information in a
line that reads:
<programlisting>VIDC.HFYU=huffyuv.dll</programlisting>
</para>

<para>
So you need the <filename>huffyuv.dll</filename> file. Note that the audio
codecs are specified by the MSACM prefix:
<programlisting>msacm.l3acm=L3codeca.acm</programlisting>
</para>

<para>
This is the MP3 codec.  Now that you have all the necessary information
(fourcc, codec file, sample AVI), submit your codec support request by
mail, and upload these files to the FTP site:
<systemitem role="url">ftp://upload.mplayerhq.hu/MPlayer/incoming/<replaceable>&lt;codecname&gt;</replaceable>/</systemitem>
</para>

<note><para>
On Windows NT/2000/XP search for this info in the registry,
e.g. search for "VIDC.HFYU". To find out how to do this, look at
the old DirectShow method below.
</para></note>
</sect2>

<!-- ********** -->

<sect2 id="dshow-codecs">
<title>DirectShow codecs</title>

<para>
DirectShow is the newer Video API, which is even worse than its predecessor.
Things are harder with DirectShow, since
<itemizedlist>
<listitem><para>
  <filename>system.ini</filename> does not contain the needed information,
  instead it is stored in the registry and
</para></listitem>
<listitem><para>
  we need the GUID of the codec.
</para></listitem>
</itemizedlist>
</para>

<procedure>
<title>New Method:</title>
<para>
Using <application>Microsoft GraphEdit</application> (fast)
</para>
<step><para>
  Get <application>GraphEdit</application> from either DirectX SDK or
  <ulink url="http://doom9.net">doom9</ulink>.
</para></step>
<step><para>
  Start <command>graphedit.exe</command>.
</para></step>
<step><para>
  From the menu select
  <menuchoice><guimenu>Graph</guimenu>
  <guisubmenu>Insert Filters</guisubmenu></menuchoice>.
</para></step>
<step><para>
  Expand item <systemitem>DirectShow Filters</systemitem>.
</para></step>
<step><para>
  Select the right codec name and expand item.
</para></step>
<step><para>
  In the entry <systemitem>DisplayName</systemitem> look at the text in
  winged brackets after the backslash and write it down (five dash-delimited
  blocks, the GUID).
</para></step>
<step><para>
  The codec binary is the file specified in the
  <systemitem>Filename</systemitem> entry.
</para></step>
</procedure>

<note><para>
If there is no <systemitem>Filename</systemitem> and
<systemitem>DisplayName</systemitem> contains something like
<systemitem>device:dmo</systemitem>, then it is a DMO-Codec.
</para></note>

<procedure>
<title>Old Method:</title>
<para>
Take a deep breath and start searching the registry...
</para>
<step><para>
  Start <command>regedit</command>.
</para></step>
<step><para>
  Press <keycombo><keycap>Ctrl</keycap><keycap>F</keycap></keycombo>, disable
  the first two checkboxes, and enable the third. Type in the fourcc of the
  codec (e.g. <userinput>TM20</userinput>).
</para></step>
<step><para>
  You should see a field which contains the path and the filename (e.g.
  <filename>C:\WINDOWS\SYSTEM\TM20DEC.AX</filename>).
</para></step>
<step><para>
  Now that you have the file, we need the GUID. Try searching again, but
  now search for the codec's name, not the fourcc. Its name can be acquired
  when Media Player is playing the file, by checking
  <menuchoice><guimenu>File</guimenu> <guisubmenu>Properties</guisubmenu>
  <guimenuitem>Advanced</guimenuitem></menuchoice>.
  If not, you are out of luck. Try guessing (e.g. search for TrueMotion).
</para></step>
<step><para>
  If the GUID is found you should see a <guilabel>FriendlyName</guilabel>
  and a <guilabel>CLSID</guilabel> field. Write down the 16 byte CLSID,
  this is the GUID we need.
</para></step>
</procedure>

<note><para>
If searching fails, try enabling all the checkboxes. You may have
false hits, but you may get lucky...
</para></note>

<para>
Now that you have all the necessary information (fourcc, GUID, codec file,
sample AVI), submit your codec support request by mail, and upload these files
to the FTP site:
<systemitem role="url">ftp://upload.mplayerhq.hu/MPlayer/incoming/<replaceable>&lt;codecname&gt;</replaceable>/</systemitem>
</para>

<para>
If you want to add a codec yourself, read
<ulink url="http://www.mplayerhq.hu/MPlayer/DOCS/tech/codecs.conf.txt">DOCS/tech/codecs.conf.txt</ulink>.
</para>

</sect2>
</sect1>

</chapter>