File: mpeg_decoders.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 (244 lines) | stat: -rw-r--r-- 20,255 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
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
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>8.3.MPEG decoders</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="video.html" title="Chapter8.Video output devices"><link rel="prev" href="output-trad.html" title="8.2.Video outputs for traditional video cards"><link rel="next" href="other.html" title="8.4.Other visualization hardware"><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="mpeg_decoders.html#dvb" title="8.3.1.DVB output and input"><link rel="subsection" href="mpeg_decoders.html#dxr2" title="8.3.2.DXR2"><link rel="subsection" href="mpeg_decoders.html#dxr3" title="8.3.3.DXR3/Hollywood+"></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">8.3.MPEG decoders</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="output-trad.html">Prev</a></td><th width="60%" align="center">Chapter8.Video output devices</th><td width="20%" align="right"><a accesskey="n" href="other.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="mpeg_decoders"></a>8.3.MPEG decoders</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="dvb"></a>8.3.1.DVB output and input</h3></div></div></div><p>
<span class="application">MPlayer</span> supports cards with the Siemens DVB chipset
from vendors like Siemens, Technotrend, Galaxis or Hauppauge. The latest DVB
drivers are available from the <a href="http://www.linuxtv.org" target="_top">Linux TV site</a>.
If you want to do software transcoding you should have at least a 1GHz CPU.
</p><p>
Configure should detect your DVB card. If it did not, force detection with
</p><pre class="screen">./configure --enable-dvb</pre><p>If you have ost headers at a non-standard path, set the path with</p><pre class="screen">./configure --with-extraincdir=<em class="replaceable"><code>DVB source directory</code></em>/ost/include
</pre><p>Then compile and install as usual.</p><p><b>USAGE.</b>
Hardware decoding (playing standard MPEG-1/2 files) can be done with this command:
</p><p>
</p><pre class="screen">mplayer -ao mpegpes -vo mpegpes <em class="replaceable"><code>file.mpg|vob</code></em></pre><p>
</p><p>
Software decoding or transcoding different formats to MPEG-1 can be achieved using
a command like this:
</p><pre class="screen">
mplayer -ao mpegpes -vo mpegpes <em class="replaceable"><code>yourfile.ext</code></em>
mplayer -ao mpegpes -vo mpegpes -vf expand <em class="replaceable"><code>yourfile.ext</code></em>
</pre><p>
Note that DVB cards only support heights 288 and 576 for PAL or 240 and 480 for
NTSC. You <span class="bold"><strong>must</strong></span> rescale for other heights by adding
<tt class="option">scale=width:height</tt> with the width and height you want to the
<tt class="option">-vf</tt> option. DVB cards accept various widths, like 720, 704,
640, 512, 480, 352 etc and do hardware scaling in horizontal direction, so you
do not need to scale horizontally in most cases. For a 512x384 (aspect 4:3)
MPEG-4 (DivX) try:
</p><pre class="screen">mplayer -ao mpegpes -vo mpegpes -vf scale=512:576</pre><p>If you have a widescreen movie and you do not want to scale it to full height,
you can use the <tt class="option">expand=w:h</tt> filter to add black bands. To view a
640x384 MPEG-4 (DivX), try:
</p><p>
</p><pre class="screen">mplayer -ao mpegpes -vo mpegpes -vf expand=640:576 <em class="replaceable"><code>file.avi</code></em>
</pre><p>
</p><p>
If your CPU is too slow for a full size 720x576 MPEG-4 (DivX), try downscaling:
</p><p>
</p><pre class="screen">mplayer -ao mpegpes -vo mpegpes -vf scale=352:576 <em class="replaceable"><code>file.avi</code></em>
</pre><p>
</p><p>If speed does not improve, try vertical downscaling, too:</p><p>
</p><pre class="screen">mplayer -ao mpegpes -vo mpegpes -vf scale=352:288 <em class="replaceable"><code>file.avi</code></em>
</pre><p>
</p><p>
For OSD and subtitles use the OSD feature of the expand filter. So, instead of
<tt class="option">expand=w:h</tt> or <tt class="option">expand=w:h:x:y</tt>, use
<tt class="option">expand=w:h:x:y:1</tt> (the 5th parameter <tt class="option">:1</tt>
at the end will enable OSD rendering). You may want to move the image up a bit
to get a bigger black zone for subtitles. You may also want to move subtitles up,
if they are outside your TV screen, use the <tt class="option">-subpos &lt;0-100&gt;</tt>
option to adjust this (<tt class="option">-subpos 80</tt> is a good choice).
</p><p>
In order to play non-25fps movies on a PAL TV or with a slow CPU, add the
<tt class="option">-framedrop</tt> option.
</p><p>
To keep the aspect ratio of MPEG-4 (DivX) files and get the optimal scaling
parameters (hardware horizontal scaling and software vertical scaling
while keeping the right aspect ratio), use the new dvbscale filter:
</p><pre class="screen">
for a  4:3 TV: -vf dvbscale,scale=-1:0,expand=-1:576:-1:-1:1
for a 16:9 TV: -vf dvbscale=1024,scale=-1:0,expand=-1:576:-1:-1:1
</pre><p><b>Digital TV (DVB input module).</b>You can use your DVB card for watching Digital TV.</p><p>
  You should have the programs <span><strong class="command">scan</strong></span> and
  <span><strong class="command">szap/tzap/czap/azap</strong></span> installed; they are all included in
  the drivers package.
</p><p>
  Verify that your drivers are working properly with a program such as
  <a href="http://sf.net/projects/dvbtools/" target="_top"><span><strong class="command">dvbstream</strong></span></a>
  (that is the base of the DVB input module).
</p><p>
  Now you should compile a <tt class="filename">~/.mplayer/channels.conf</tt>
  file, with the syntax accepted by <span><strong class="command">szap/tzap/czap/azap</strong></span>, or
  have <span><strong class="command">scan</strong></span> compile it for you.
</p><p>
  If you have more than one card type (e.g. Satellitar, Terrestrial, Cable and ATSC)
  you can save your channels files as
  <tt class="filename">~/.mplayer/channels.conf.sat</tt>,
  <tt class="filename">~/.mplayer/channels.conf.ter</tt>,
  <tt class="filename">~/.mplayer/channels.conf.cbl</tt>,
  and <tt class="filename">~/.mplayer/channels.conf.atsc</tt>,
  respectively, so as to implicitly hint <span class="application">MPlayer</span>
  to use these files rather than <tt class="filename">~/.mplayer/channels.conf</tt>,
  and you only need to specify which card to use.
</p><p>
  Make sure that you have have <span class="emphasis"><em>only</em></span> Free to Air
  channels in your <tt class="filename">channels.conf</tt> file, or
  <span class="application">MPlayer</span> will try to skip to the next visible one,
  but it may take long if there are many consecutive encrypted channels.
</p><p>
  In your audio and video fields you can use an extended syntax:
  <tt class="option">...:pid[+pid]:...</tt> (for a maximum of 6 pids each);
  in this case <span class="application">MPlayer</span> will include in the
  stream all the indicated pids, plus pid 0 (that contains the PAT).
  You are encouraged to include in each row the PMT pid for the
  corresponding channel (if you know it).
  Other possible uses are: televideo pid, second audio track, etc.
</p><p>
  If <span class="application">MPlayer</span> complains frequently about
  </p><pre class="screen">Too many video/audio packets in the buffer</pre><p> or
  if you notice a growing desynchronization between audio and
  video try to use the libavformat MPEG-TS demuxer by adding
  <tt class="option">-demuxer lavf -lavfdopts probesize=128</tt>
  to your command line.
</p><p>
  To show the first of the channels present in your list, run
</p><pre class="screen">
  mplayer dvb://
</pre><p>
  If you want to watch a specific channel, such as R1, run
</p><pre class="screen">
  mplayer dvb://R1
</pre><p>
  If you have more than one card you also need to specify the number of the card
  where the channel is visible (e.g. 2) with the syntax:
</p><pre class="screen">
  mplayer dvb://2@R1
</pre><p>
  To change channels press the <span class="keycap"><b>h</b></span> (next) and
  <span class="keycap"><b>k</b></span> (previous) keys, or use the
  <a href="fonts-osd.html#osdmenu" title="2.6.3.OSD menu">OSD menu</a>.
</p><p>
  If your <tt class="filename">~/.mplayer/menu.conf</tt> contains a
  <code class="literal">&lt;dvbsel&gt;</code> entry, such as the one in the example
  file <tt class="filename">etc/dvb-menu.conf</tt> (that you can use to overwrite
  <tt class="filename">~/.mplayer/menu.conf</tt>), the main menu will show a
  sub-menu entry that will permit you to choose one of the channels present
  in your <tt class="filename">channels.conf</tt>, possibly preceded by a menu
  with the list of cards available if more than one is usable by
  <span class="application">MPlayer</span>.
</p><p>
  If you want to save a program to disk you can use
</p><pre class="screen">
  mplayer -dumpfile r1.ts -dumpstream dvb://R1
</pre><p>
  If you want to record it in a different format (re-encoding it) instead
  you can run a command such as
</p><pre class="screen">
  mencoder -o r1.avi -ovc xvid -xvidencopts bitrate=800 -oac mp3lame -lameopts cbr:br=128 -pp=ci dvb://R1
</pre><p>
  Read the man page for a list of options that you can pass to the
  DVB input module.
</p><p><b>FUTURE.</b>
If you have questions or want to hear feature announcements and take part in
discussions on this subject, join our
<a href="http://lists.mplayerhq.hu/mailman/listinfo/mplayer-dvb" target="_top">MPlayer-DVB</a>
mailing list. Please remember that the list language is English.
</p><p>
In the future you may expect the ability to display OSD and subtitles using
the native OSD feature of DVB cards, as well as more fluent playback of
non-25fps movies and realtime transcoding between MPEG-2 and MPEG-4 (partial
decompression).
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="dxr2"></a>8.3.2.DXR2</h3></div></div></div><p><span class="application">MPlayer</span> supports hardware accelerated playback
  with the Creative DXR2 card.</p><p>
First of all you will need properly installed DXR2 drivers. You can find
the drivers and installation instructions at the
<a href="http://dxr2.sf.net/" target="_top">DXR2 Resource Center</a> site.
</p><div class="variablelist"><p class="title"><b>USAGE</b></p><dl><dt><span class="term"><tt class="option">-vo dxr2</tt></span></dt><dd><p>Enable TV output.</p></dd><dt><span class="term"><tt class="option">-vo dxr2:x11</tt> or <tt class="option">-vo dxr2:xv</tt></span></dt><dd><p>Enable Overlay output in X11.</p></dd><dt><span class="term"><tt class="option">-dxr2 &lt;option1:option2:...&gt;</tt></span></dt><dd><p>This option is used to control the DXR2 driver.</p></dd></dl></div><p>
The overlay chipset used on the DXR2 is of pretty bad quality but the
default settings should work for everybody. The OSD may be usable with the
overlay (not on TV) by drawing it in the colorkey. With the default colorkey
settings you may get variable results, usually you will see the colorkey
around the characters or some other funny effect. But if you properly adjust
the colorkey settings you should be able to get acceptable results.
</p><p>Please see the man page for available options.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="dxr3"></a>8.3.3.DXR3/Hollywood+</h3></div></div></div><p>
<span class="application">MPlayer</span> supports hardware accelerated playback
with the Creative DXR3 and Sigma Designs Hollywood Plus cards. These cards
both use the em8300 MPEG decoder chip from Sigma Designs.
</p><p>
First of all you will need properly installed DXR3/H+ drivers, version 0.12.0
or later. You can find the drivers and installation instructions at the
<a href="http://dxr3.sf.net/" target="_top">DXR3 &amp; Hollywood Plus for Linux</a>
site. <tt class="filename">configure</tt> should detect your card automatically,
compilation should go without problems.
</p><div class="variablelist"><p class="title"><b>USAGE</b></p><dl><dt><span class="term"><tt class="option">-vo dxr3:prebuf:sync:norm=x:<em class="replaceable"><code>device</code></em></tt></span></dt><dd><p>
<tt class="option">overlay</tt> activates the overlay instead of TVOut. It requires
that you have a properly configured overlay setup to work right. The easiest
way to configure the overlay is to first run autocal. Then run mplayer with
dxr3 output and without overlay turned on, run dxr3view. In dxr3view you can
tweak the overlay settings and see the effects in realtime, perhaps this feature
will be supported by the <span class="application">MPlayer</span> GUI in the future.
When overlay is properly set up you will no longer need to use dxr3view.
<tt class="option">prebuf</tt> turns on prebuffering. Prebuffering is a feature of the
em8300 chip that enables it to hold more than one frame of video at a time. This
means that when you are running with prebuffering <span class="application">MPlayer</span>
will try to keep the video buffer filled with data at all times. If you are on
a slow machine <span class="application">MPlayer</span> will probably use close to,
or precisely 100% of CPU. This is especially common if you play pure MPEG streams
(like DVDs, SVCDs a.s.o.) since <span class="application">MPlayer</span> will not have
to reencode it to MPEG it will fill the buffer very fast.
With prebuffering video playback is <span class="bold"><strong>much</strong></span>
less sensitive to other programs hogging the CPU, it will not drop frames unless
applications hog the CPU for a long time.
When running without prebuffering the em8300 is much more sensitive to CPU load,
so it is highly suggested that you turn on <span class="application">MPlayer</span>'s
<tt class="option">-framedrop</tt> option to avoid further loss of sync.
<tt class="option">sync</tt> will turn on the new sync-engine. This is currently an
experimental feature. With the sync feature turned on the em8300's internal clock
will be monitored at all times, if it starts to deviate from
<span class="application">MPlayer</span>'s clock it will be reset causing the em8300 to
drop any frames that are lagging behind.
<tt class="option">norm=x</tt> will set the TV norm of the DXR3 card without the need
for external tools like em8300setup. Valid norms are 5 = NTSC, 4 = PAL-60,
3 = PAL. Special norms are 2 (auto-adjust using PAL/PAL-60) and 1 (auto-adjust
using PAL/NTSC) because they decide which norm to use by looking at the frame
rate of the movie. norm = 0 (default) does not change the current norm.
<tt class="option"><em class="replaceable"><code>device</code></em></tt> = device number to use if you have more than one em8300
card.
Any of these options may be left out.
<tt class="option">:prebuf:sync</tt> seems to work great when playing MPEG-4 (DivX) movies. People
have reported problems using the prebuf option when playing MPEG-1/2 files. You
might want to try running without any options first, if you have sync problems,
or DVD subtitle problems, give <tt class="option">:sync</tt> a try.
</p></dd><dt><span class="term"><tt class="option">-ao oss:/dev/em8300_ma-<em class="replaceable"><code>X</code></em></tt></span></dt><dd><p>
For audio output, where <em class="replaceable"><code>X</code></em> is the device number (0 if one card).
</p></dd><dt><span class="term"><tt class="option">-af resample=<em class="replaceable"><code>xxxxx</code></em></tt></span></dt><dd><p>
The em8300 cannot play back samplerates lower than 44100Hz. If the sample
rate is below 44100Hz select either 44100Hz or 48000Hz depending on which
one matches closest. I.e. if the movie uses 22050Hz use 44100Hz as
44100 / 2 = 22050, if it is 24000Hz use 48000Hz as 48000 / 2 = 24000 and so on.
This does not work with digital audio output (<tt class="option">-ac hwac3</tt>).
</p></dd><dt><span class="term"><tt class="option">-vf lavc/fame</tt></span></dt><dd><p>
To watch non-MPEG content on the em8300 (i.e. MPEG-4 (DivX) or RealVideo)
you have to specify an MPEG-1 video filter such as
<code class="systemitem">libavcodec</code> (lavc) or
<code class="systemitem">libfame</code> (fame). At
the moment lavc is both faster and gives better image quality, it is suggested
that you use that unless you have problems with it. See the man page for further
info about <tt class="option">-vf lavc/fame</tt>.
Using lavc is highly recommended. Currently there is no way of setting the fps
of the em8300 which means that it is fixed to 30000/1001 fps. Because of this it is
highly recommended that you use <tt class="option">-vf lavc=<em class="replaceable"><code>quality</code></em>:25</tt>
especially if you are using prebuffering. Then why 25 and not 30000/1001? Well, the
thing is that when you use 30000/1001 the picture becomes a bit jumpy. The reason for
this is unknown to us. If you set it to somewhere between 25 and 27 the picture
becomes stable. For now all we can do is accept this for a fact.
</p></dd><dt><span class="term"><tt class="option">-vf expand=-1:-1:-1:-1:1</tt></span></dt><dd><p>
Although the DXR3 driver can put some OSD onto the MPEG-1/2/4 video, it has
much lower quality than <span class="application">MPlayer</span>'s traditional OSD,
and has several refresh problems as well. The command line above will firstly
convert the input video to MPEG-4 (this is mandatory, sorry), then apply an
expand filter which won't expand anything (-1: default), but apply the normal
OSD onto the picture (that's what the "1" at the end does).
</p></dd><dt><span class="term"><tt class="option">-ac hwac3</tt></span></dt><dd><p>
The em8300 supports playing back AC3 audio (surround sound) through the
digital audio output of the card. See the <tt class="option">-ao oss</tt> option above,
it must be used to specify the DXR3's output instead of a sound card.
</p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="output-trad.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="video.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="other.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">8.2.Video outputs for traditional video cards</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">8.4.Other visualization hardware</td></tr></table></div></body></html>