Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > c152d44cf90e046b661655b5995890a5 > files > 946

mplayer-doc-1.0-1.rc2.18.2mdv2009.0.i586.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>7.1. Video codecs</title><link rel="stylesheet" href="default.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="MPlayer - 电影播放器"><link rel="up" href="codecs.html" title="第 7 章 Codecs"><link rel="prev" href="codecs.html" title="第 7 章 Codecs"><link rel="next" href="audio-codecs.html" title="7.2. Audio codecs"><link rel="preface" href="howtoread.html" title="如何阅读此文档"><link rel="chapter" href="intro.html" title="第 1 章 介绍"><link rel="chapter" href="install.html" title="第 2 章 Installation"><link rel="chapter" href="usage.html" title="第 3 章 Usage"><link rel="chapter" href="cd-dvd.html" title="第 4 章 CD/DVD用法"><link rel="chapter" href="faq.html" title="第 5 章 Frequently Asked Questions"><link rel="chapter" href="containers.html" title="第 6 章 Containers"><link rel="chapter" href="codecs.html" title="第 7 章 Codecs"><link rel="chapter" href="video.html" title="第 8 章 Video output devices"><link rel="chapter" href="audio.html" title="第 9 章 音频输出设备"><link rel="chapter" href="tv.html" title="第 10 章 TV"><link rel="chapter" href="radio.html" title="第 11 章 广播电台"><link rel="chapter" href="ports.html" title="第 12 章 Ports"><link rel="chapter" href="mencoder.html" title="第 13 章 MEncoder的基础用法"><link rel="chapter" href="encoding-guide.html" title="第 14 章 Encoding with MEncoder"><link rel="appendix" href="bugreports.html" title="附录 A. 如何报告错误"><link rel="appendix" href="bugs.html" title="附录 B. 已知错误"><link rel="appendix" href="skin.html" title="附录 C. MPlayer skin format"><link rel="appendix" href="history.html" title="附录 D. 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">上一页</a> </td><th width="60%" align="center">第 7 章 Codecs</th><td width="20%" align="right"> <a accesskey="n" href="audio-codecs.html">下一页</a></td></tr></table><hr></div><div class="sect1" lang="zh-CN"><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 class="ulink" 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 class="ulink" 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><p>
  <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
</p></li><li><p>
  native decoders for <span class="bold"><strong>all DivX variants,
  3ivX, M$ MPEG-4</strong></span> v1, v2 and other MPEG-4 variants
</p></li><li><p>
  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
</p></li><li><p>
  native <span class="bold"><strong>Sorenson 1 (SVQ1)</strong></span> decoder
</p></li><li><p>
  native <span class="bold"><strong>Sorenson 3 (SVQ3)</strong></span> decoder
</p></li><li><p>
  <span class="bold"><strong>3ivx</strong></span> v1, v2 decoder
</p></li><li><p>
  Cinepak and <span class="bold"><strong>Intel Indeo</strong></span> codecs
  (3.1,3.2,4.1,5.0)
</p></li><li><p>
  <span class="bold"><strong>MJPEG</strong></span>, AVID, VCR2, ASV2 and other hardware
  formats
</p></li><li><p>
  VIVO 1.0, 2.0, I263 and other <span class="bold"><strong>H.263(+)</strong></span>
  variants
</p></li><li><p>
  FLI/FLC
</p></li><li><p>
  <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
</p></li><li><p>
  native decoder for HuffYUV
</p></li><li><p>
  Various old simple RLE-like formats
</p></li></ul></div><p>
If you have a Win32 codec not listed here which is not supported yet,
please read the <a class="link" 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="zh-CN"><div class="titlepage"><div><div><h3 class="title"><a name="ffmpeg"></a>7.1.1. FFmpeg/libavcodec</h3></div></div></div><p>
<a class="ulink" 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 
<a class="ulink" href="http://ffmpeg.org/ffmpeg-doc.html#SEC19" target="_top">video</a>
and <a class="ulink" href="http://ffmpeg.org/ffmpeg-doc.html#SEC20" target="_top">audio</a>
codecs please visit the FFmpeg homepage.
</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="zh-CN"><div class="titlepage"><div><div><h3 class="title"><a name="xvid"></a>7.1.2. Xvid</h3></div></div></div><p>
<a class="ulink" 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="id2564109"></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 class="ulink" 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 class="command"><strong>./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="zh-CN"><div class="titlepage"><div><div><h3 class="title"><a name="codec-x264"></a>7.1.3. <code class="systemitem">x264</code></h3></div></div></div><div class="sect3" lang="zh-CN"><div class="titlepage"><div><div><h4 class="title"><a name="codec-x264-whatis"></a>7.1.3.1. What is <code class="systemitem">x264</code>?</h4></div></div></div><p>
<a class="ulink" 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><li><p>Interlacing</p></li></ul></div></div><div class="sect3" lang="zh-CN"><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 class="ulink" 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="zh-CN"><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 class="ulink" 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="zh-CN"><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 <tt class="filename">./configure</tt> 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">上一页</a> </td><td width="20%" align="center"><a accesskey="u" href="codecs.html">上一级</a></td><td width="40%" align="right"> <a accesskey="n" href="audio-codecs.html">下一页</a></td></tr><tr><td width="40%" align="left" valign="top">第 7 章 Codecs </td><td width="20%" align="center"><a accesskey="h" href="index.html">起始页</a></td><td width="40%" align="right" valign="top"> 7.2. Audio codecs</td></tr></table></div></body></html>