File: video-codecs.html

package info (click to toggle)
mplayer 1.0~rc1-12etch7
  • links: PTS
  • area: main
  • in suites: etch
  • size: 47,324 kB
  • ctags: 86,269
  • sloc: ansic: 580,415; xml: 107,529; sh: 7,643; makefile: 2,860; asm: 2,206; cpp: 1,034; objc: 865; awk: 234; perl: 82
file content (207 lines) | stat: -rw-r--r-- 15,686 bytes parent folder | download | duplicates (2)
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>7.1.Video codecs</title><link rel="stylesheet" href="default.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="MPlayer - The Movie Player"><link rel="up" href="codecs.html" title="Chapter7.Codecs"><link rel="prev" href="codecs.html" title="Chapter7.Codecs"><link rel="next" href="audio-codecs.html" title="7.2.Audio codecs"><link rel="preface" href="howtoread.html" title="How to read this documentation"><link rel="chapter" href="intro.html" title="Chapter1.Introduction"><link rel="chapter" href="install.html" title="Chapter2.Installation"><link rel="chapter" href="usage.html" title="Chapter3.Usage"><link rel="chapter" href="cd-dvd.html" title="Chapter4.CD/DVD usage"><link rel="chapter" href="faq.html" title="Chapter5.Frequently Asked Questions"><link rel="chapter" href="containers.html" title="Chapter6.Containers"><link rel="chapter" href="codecs.html" title="Chapter7.Codecs"><link rel="chapter" href="video.html" title="Chapter8.Video output devices"><link rel="chapter" href="audio.html" title="Chapter9.Audio output devices"><link rel="chapter" href="tv.html" title="Chapter10.TV"><link rel="chapter" href="radio.html" title="Chapter11.Radio"><link rel="chapter" href="ports.html" title="Chapter12.Ports"><link rel="chapter" href="mencoder.html" title="Chapter13.Basic usage of MEncoder"><link rel="chapter" href="encoding-guide.html" title="Chapter14.Encoding with MEncoder"><link rel="appendix" href="bugreports.html" title="AppendixA.How to report bugs"><link rel="appendix" href="bugs.html" title="AppendixB.Known bugs"><link rel="appendix" href="skin.html" title="AppendixC.MPlayer skin format"><link rel="appendix" href="history.html" title="AppendixD.History"><link rel="subsection" href="video-codecs.html#ffmpeg" title="7.1.1.FFmpeg/libavcodec"><link rel="subsection" href="video-codecs.html#xvid" title="7.1.2.XviD"><link rel="subsection" href="video-codecs.html#codec-x264" title="7.1.3.x264"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.1.Video codecs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="codecs.html">Prev</a></td><th width="60%" align="center">Chapter7.Codecs</th><td width="20%" align="right"><a accesskey="n" href="audio-codecs.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="video-codecs"></a>7.1.Video codecs</h2></div></div></div><p>
The <a href="../../codecs-status.html" target="_top">codec status table</a> is a
complete list of all supported codecs, regenerated daily.
Some binary codecs for use with MPlayer are available in the
<a href="http://www.mplayerhq.hu/design7/dload.html#binary_codecs" target="_top">download section</a>
of our homepage.
</p><p>
The most important ones above all:
</p><div class="itemizedlist"><ul type="disc"><li>
  <span class="bold"><strong>MPEG-1</strong></span> (<span class="bold"><strong>VCD</strong></span>) and
  <span class="bold"><strong>MPEG-2</strong></span> (<span class="bold"><strong>DVD</strong></span>) video
  </li><li>
  native decoders for <span class="bold"><strong>all DivX variants,
  3ivX, M$ MPEG-4</strong></span> v1, v2 and other MPEG-4 variants
  </li><li>
  native decoder for <span class="bold"><strong>Windows Media Video 7/8</strong></span>
  (<span class="bold"><strong>WMV1/WMV2</strong></span>), and Win32 DLL decoder
  for <span class="bold"><strong>Windows Media Video 9</strong></span>
  (<span class="bold"><strong>WMV3</strong></span>), both used in <tt class="filename">.wmv</tt>
  files
  </li><li>
  native <span class="bold"><strong>Sorenson 1 (SVQ1)</strong></span> decoder
  </li><li>
  native <span class="bold"><strong>Sorenson 3 (SVQ3)</strong></span> decoder
  </li><li>
  <span class="bold"><strong>3ivx</strong></span> v1, v2 decoder
  </li><li>
  Cinepak and <span class="bold"><strong>Intel Indeo</strong></span> codecs (3.1,3.2,4.1,5.0)
  </li><li>
  <span class="bold"><strong>MJPEG</strong></span>, AVID, VCR2, ASV2 and other hardware
  formats
  </li><li>
  VIVO 1.0, 2.0, I263 and other <span class="bold"><strong>H.263(+)</strong></span> variants
  </li><li>
  FLI/FLC
  </li><li>
  <span class="bold"><strong>RealVideo 1.0 &amp; 2.0</strong></span> from
  <code class="systemitem">libavcodec</code>, and
  <span class="bold"><strong>RealVideo 3.0 &amp; 4.0</strong></span> codecs using RealPlayer
  libraries
  </li><li>
  native decoder for HuffYUV
  </li><li>
  Various old simple RLE-like formats
  </li></ul></div><p>
If you have a Win32 codec not listed here which is not supported yet,
please read the <a href="codec-importing.html" title="7.3.Win32 codecs importing HOWTO">codec importing HOWTO</a>
and help us add support for it.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="ffmpeg"></a>7.1.1.FFmpeg/libavcodec</h3></div></div></div><p>
<a href="http://ffmpeg.org" target="_top">FFmpeg</a> contains
<code class="systemitem">libavcodec</code>, 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 <span class="application">MPlayer</span>
supports. Encoding is also possible for some formats and
supported in <span class="application">MEncoder</span>.
</p><p>
For a complete list of supported codecs please visit the FFmpeg homepage.
Supported <a href="http://ffmpeg.org/ffmpeg-doc.html#SEC19" target="_top">video</a>
and <a href="http://ffmpeg.org/ffmpeg-doc.html#SEC20" target="_top">audio</a> codecs.
</p><p>
<span class="application">MPlayer</span> contains
<code class="systemitem">libavcodec</code>.
Just run <tt class="filename">configure</tt> and compile.
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="xvid"></a>7.1.2.XviD</h3></div></div></div><p>
<a href="http://www.xvid.org" target="_top">XviD</a> is a free software MPEG-4 ASP
compliant video codec, which features two pass encoding and full MPEG-4 ASP
support, making it a lot more efficient than the well-known DivX codec.
It yields very good video quality and good performance due to CPU
optimizations for most modern processors.
</p><p>
It began as a forked development of the OpenDivX codec.
This happened when ProjectMayo changed OpenDivX to closed source
DivX4, and the non-ProjectMayo people working on OpenDivX got angry,
then started XviD. So both projects have the same origin.
</p><p>
Note that XviD is not necessary to decode XviD-encoded video.
<code class="systemitem">libavcodec</code> is used by
default as it offers better speed.
</p><div class="procedure"><a name="id2550152"></a><p class="title"><b>Installing <code class="systemitem">XviD</code></b></p><p>
  Like most open source software, it is available in two flavors:
  <a href="http://www.xvid.org/downloads.html" target="_top">official releases</a>
  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 <code class="systemitem">XviD</code>
  CVS work with <span class="application">MEncoder</span> (you need at least
  <span class="application">autoconf</span> 2.50,
  <span class="application">automake</span> and <span class="application">libtool</span>):
</p><ol type="1"><li><p>
  </p><pre class="screen">cvs -z3 -d:pserver:anonymous@cvs.xvid.org:/xvid login</pre><p>
  </p></li><li><p>
  </p><pre class="screen">cvs -z3 -d:pserver:anonymous@cvs.xvid.org:/xvid co xvidcore</pre><p>
</p></li><li><p>
  </p><pre class="screen">cd xvidcore/build/generic</pre><p>
  </p></li><li><p>
  </p><pre class="screen">./bootstrap.sh</pre><p>
  </p></li><li><p>
  </p><pre class="screen">./configure</pre><p>
  You may have to add some options (examine the output of
  <span><strong class="command">./configure --help</strong></span>).
  </p></li><li><p>
  </p><pre class="screen">make &amp;&amp; make install</pre><p>
  </p></li><li><p>
  If you specified <tt class="option">--enable-divxcompat</tt>,
  copy <tt class="filename">../../src/divx4.h</tt> to
  <tt class="filename">/usr/local/include/</tt>.
  </p></li><li><p>
  Recompile <span class="application">MPlayer</span> with
  <tt class="option">--with-xvidlibdir=<em class="replaceable"><code>/path/to/</code></em>libxvidcore.a</tt>
  <tt class="option">--with-xvidincdir=<em class="replaceable"><code>/path/to/</code></em>xvid.h</tt>.
  </p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="codec-x264"></a>7.1.3.x264</h3></div></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="codec-x264-whatis"></a>7.1.3.1.What is x264?</h4></div></div></div><p>
  <a href="http://developers.videolan.org/x264.html" target="_top"><code class="systemitem">x264</code></a>
  is a library for
  creating H.264 video streams.
  It is not 100% complete, but currently it has at least some kind
  of support for most of the H.264 features which impact quality.
  There are also many advanced features in the H.264 specification
  which have nothing to do with video quality per se; many of these
  are not yet implemented in
  <code class="systemitem">x264</code>.
</p><div class="itemizedlist"><p class="title"><b>Encoder features</b></p><ul type="disc"><li><p>CAVLC/CABAC</p></li><li><p>Multi-references</p></li><li><p>Intra: all macroblock types (16x16, 8x8, and 4x4 with
    all predictions)</p></li><li><p>Inter P: all partitions (from 16x16 down to
    4x4)</p></li><li><p>Inter B: partitions from 16x16 down to 8x8
    (including SKIP/DIRECT)</p></li><li><p>Ratecontrol: constant quantizer, constant bitrate,
    single or multipass ABR, optional VBV</p></li><li><p>Scene cut detection</p></li><li><p>Adaptive B-frame placement</p></li><li><p>B-frames as references / arbitrary frame
    order</p></li><li><p>8x8 and 4x4 adaptive spatial transform</p></li><li><p>Lossless mode</p></li><li><p>Custom quantization matrices</p></li><li><p>Parallel encoding of multiple slices</p></li></ul></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="codec-h264-whatis"></a>7.1.3.2.What is H.264?</h4></div></div></div><p>
  H.264 is one name for a new digital video codec jointly developed
  by the ITU and MPEG.
  It can also be correctly referred to by the cumbersome names of
  "ISO/IEC 14496-10" or "MPEG-4 Part 10".
  More frequently, it is referred to as "MPEG-4 AVC" or just "AVC".
</p><p>
  Whatever you call it, H.264 may be worth trying because it can
  typically match the quality of MPEG-4 ASP with 5%-30% less
  bitrate.
  Actual results will depend on both the source material and the
  encoder.
  The gains from using H.264 do not come for free: Decoding H.264
  streams seems to have steep CPU and memory requirements.
  For instance, on a 1733 MHz Athlon, a DVD-resolution 1500kbps H.264
  video requires around 35% CPU to decode.
  By comparison, decoding a DVD-resolution 1500kbps MPEG-4 ASP stream
  requires around 10% CPU.
  This means that decoding high-definition streams is almost out of
  the question for most users.
  It also means that even a decent DVD rip may sometimes stutter on
  processors slower than 2.0 GHz or so.
</p><p>
  At least with <code class="systemitem">x264</code>,
  encoding requirements are not much worse than what you are used to
  with MPEG-4 ASP.
  For instance, on a 1733 MHz Athlon a typical DVD encode would run
  at 5-15fps.
</p><p>
  This document is not intended to explain the details of H.264,
  but if you are interested in a brief overview, you may want to read
  <a href="http://www.cdt.luth.se/~peppar/kurs/smd151/spie04-h264OverviewPaper.pdf" target="_top">The H.264/AVC Advanced Video Coding Standard: Overview and Introduction to the Fidelity Range Extensions</a>.
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="codec-x264-playback"></a>7.1.3.3.How can I play H.264 videos with <span class="application">MPlayer</span>?</h4></div></div></div><p>
  <span class="application">MPlayer</span> uses
  <code class="systemitem">libavcodec</code>'s H.264
  decoder.
  <code class="systemitem">libavcodec</code> has had at
  least minimally usable H.264 decoding since around July 2004,
  however major changes and improvements have been implemented since
  that time, both in terms of more functionalities supported and in
  terms of improved CPU usage.
  Just to be certain, it is always a good idea to use a recent Subversion
  checkout.
</p><p>
  If you want a quick and easy way to know whether there have been
  recent changes to <code class="systemitem">libavcodec</code>'s
  H.264 decoding, you might keep an eye on 
  <a href="http://svn.mplayerhq.hu/ffmpeg/trunk/libavcodec/h264.c?view=log" target="_top">FFmpeg Subversion repository's web interface</a>.
</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="codec-x264-encode"></a>7.1.3.4.How can I encode videos using <span class="application">MEncoder</span> and <code class="systemitem">x264</code>?</h4></div></div></div><p>
  If you have the subversion client installed, the latest x264
  sources can be gotten with this command:
  </p><pre class="screen">
    svn co svn://svn.videolan.org/x264/trunk x264</pre><p>
  <span class="application">MPlayer</span> sources are updated whenever
  an <code class="systemitem">x264</code> API change
  occurs, so it is always suggested to use
  <span class="application">MPlayer</span> from Subversion as well.
  Perhaps this situation will change when and if an
  <code class="systemitem">x264</code> "release" occurs.
  Meanwhile, <code class="systemitem">x264</code> should
  be considered very unstable, in the sense that its programming
  interface is subject to change.
</p><p>
  <code class="systemitem">x264</code> is built and
  installed in the standard way:
  </p><pre class="screen">
    ./configure &amp;&amp; make &amp;&amp; sudo make install</pre><p>
  This installs libx264.a in /usr/local/lib and x264.h is placed in
  /usr/local/include.

  With the <code class="systemitem">x264</code> library
  and header placed in the standard locations, building
  <span class="application">MPlayer</span> with
  <code class="systemitem">x264</code> support is easy.
  Just run the standard:
  </p><pre class="screen">./configure &amp;&amp; make &amp;&amp; sudo make install</pre><p>
  The configure script will autodetect that you have satisfied the
  requirements for <code class="systemitem">x264</code>.
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="codecs.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="codecs.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="audio-codecs.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter7.Codecs</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">7.2.Audio codecs</td></tr></table></div></body></html>