Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > a42e22ddf1d70fb02e9f62289d71cafa > files > 877

mplayer-doc-1.0-1.rc4.0.r31086.3.1mdv2010.2.i586.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>7.1. TV input</title><link rel="stylesheet" href="default.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="MPlayer - 电影播放器"><link rel="up" href="tv.html" title="第 7 章 TV"><link rel="prev" href="tv.html" title="第 7 章 TV"><link rel="next" href="tv-teletext.html" title="7.2. Teletext"><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="advaudio.html" title="第 4 章 Advanced audio usage"><link rel="chapter" href="cd-dvd.html" title="第 5 章 CD/DVD用法"><link rel="chapter" href="video.html" title="第 6 章 Video output devices"><link rel="chapter" href="tv.html" title="第 7 章 TV"><link rel="chapter" href="radio.html" title="第 8 章 广播电台"><link rel="chapter" href="ports.html" title="第 9 章 Ports"><link rel="chapter" href="mencoder.html" title="第 10 章 MEncoder的基础用法"><link rel="chapter" href="encoding-guide.html" title="第 11 章 Encoding with MEncoder"><link rel="chapter" href="faq.html" title="第 12 章 Frequently Asked Questions"><link rel="appendix" href="bugreports.html" title="附录 A. 如何报告错误"><link rel="appendix" href="skin.html" title="附录 B. MPlayer skin format"><link rel="subsection" href="tv-input.html#tv-compilation" title="7.1.1. Compilation"><link rel="subsection" href="tv-input.html#tv-tips" title="7.1.2. Usage tips"><link rel="subsection" href="tv-input.html#tv-examples" title="7.1.3. Examples"></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. TV input</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="tv.html">上一页</a> </td><th width="60%" align="center">第 7 章 TV</th><td width="20%" align="right"> <a accesskey="n" href="tv-teletext.html">下一页</a></td></tr></table><hr></div><div class="sect1" title="7.1. TV input"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tv-input"></a>7.1. TV input</h2></div></div></div><p>
This section is about how to enable <span class="bold"><strong>watching/grabbing
from V4L compatible TV tuner</strong></span>. See the man page for a description
of TV options and keyboard controls.
</p><div class="sect2" title="7.1.1. Compilation"><div class="titlepage"><div><div><h3 class="title"><a name="tv-compilation"></a>7.1.1. Compilation</h3></div></div></div><div class="procedure"><ol class="procedure" type="1"><li class="step" title="步骤 1"><p>
  First, you have to recompile. <tt class="filename">./configure</tt> will
  autodetect kernel headers of v4l stuff and the existence of
  <tt class="filename">/dev/video*</tt> entries. If they exist, TV support will
  be built (see  the output of <tt class="filename">./configure</tt>).
</p></li><li class="step" title="步骤 2"><p>
  Make sure your tuner works with another TV software in Linux, for
  example <span class="application">XawTV</span>.
</p></li></ol></div></div><div class="sect2" title="7.1.2. Usage tips"><div class="titlepage"><div><div><h3 class="title"><a name="tv-tips"></a>7.1.2. Usage tips</h3></div></div></div><p>
The full listing of the options is available on the manual page.
Here are just a few tips:

</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
  Use the <tt class="option">channels</tt> option. An example:
  </p><pre class="screen">-tv channels=26-MTV1,23-TV2</pre><p>
  Explanation: Using this option, only the 26 and 23 channels will be usable,
  and there will be a nice OSD text upon channel switching, displaying the
  channel's name. Spaces in the channel name must be replaced by the
  "_" character.
</p></li><li class="listitem"><p>
  Choose some sane image dimensions. The dimensions of the resulting image
  should be divisible by 16.
</p></li><li class="listitem"><p>
  If you capture the video with the vertical resolution higher than half
  of the full resolution (i.e. 288 for PAL or 240 for NTSC), then the
  'frames' you get will really be interleaved pairs of fields.
  Depending on what you want to do with the video you may leave it in
  this form, destructively deinterlace, or break the pairs apart into
  individual fields.
  </p><p>
  Otherwise you'll get a movie which is distorted during
  fast-motion scenes and the bitrate controller will be probably even unable
  to retain the specified bitrate as the interlacing artifacts produce high
  amount of detail and thus consume lot of bandwidth. You can enable
  deinterlacing with <tt class="option">-vf pp=DEINT_TYPE</tt>.
  Usually <tt class="option">pp=lb</tt> does a good job, but it can be matter of
  personal preference.
  See other deinterlacing algorithms in the manual and give it a try.
  </p></li><li class="listitem"><p>
  Crop out the dead space. When you capture the video, the areas at the edges
  are usually black or contain some noise. These again consume lots of
  unnecessary bandwidth. More precisely it's not the black areas themselves
  but the sharp transitions between the black and the brighter video image
  which do but that's not important for now. Before you start capturing,
  adjust the arguments of the <tt class="option">crop</tt> option so that all the
  crap at the margins is cropped out. Again, don't forget to keep the resulting
  dimensions sane.
</p></li><li class="listitem"><p>
  Watch out for CPU load. It shouldn't cross the 90% boundary for most of the
  time. If you have a large capture buffer, <span class="application">MEncoder</span>
  can survive an overload for few seconds but nothing more. It's better to
  turn off the 3D OpenGL screensavers and similar stuff.
</p></li><li class="listitem"><p>
  Don't mess with the system clock. <span class="application">MEncoder</span> uses the
  system clock for doing A/V sync. If you adjust the system clock (especially
  backwards in time), <span class="application">MEncoder</span> gets confused and you
  will lose frames. This is an important issue if you are hooked to a network
  and run some time synchronization software like NTP. You have to turn NTP
  off during the capture process if you want to capture reliably.
</p></li><li class="listitem"><p>
  Don't change the <tt class="option">outfmt</tt> unless you know what you are doing
  or your card/driver really doesn't support the default (YV12 colorspace).
  In the older versions of <span class="application">MPlayer</span>/
  <span class="application">MEncoder</span> it was necessary to specify the output
  format. This issue should be fixed in the current releases and
  <tt class="option">outfmt</tt> isn't required anymore, and the default suits the
  most purposes. For example, if you are capturing into DivX using
  <code class="systemitem">libavcodec</code> and specify
  <tt class="option">outfmt=RGB24</tt> in order to increase the quality of the captured
  images, the captured image will be actually later converted back into YV12 so
  the only thing you achieve is a massive waste of CPU power.
</p></li><li class="listitem"><p>
  There are several ways of capturing audio. You can grab the sound either using
  your sound card via an external cable connection between video card and
  line-in, or using the built-in ADC in the bt878 chip. In the latter case, you
  have to load the <span class="bold"><strong>btaudio</strong></span> driver. Read the
  <tt class="filename">linux/Documentation/sound/btaudio</tt> file (in the kernel
  tree, not <span class="application">MPlayer</span>'s) for some instructions on using
  this driver.
</p></li><li class="listitem"><p>
  If <span class="application">MEncoder</span> cannot open the audio device, make
  sure that it is really available. There can be some trouble with the sound
  servers like aRts (KDE) or ESD (GNOME). If you have a full duplex sound card
  (almost any decent card supports it today), and you are using KDE, try to
  check the "full duplex" option in the sound server preference menu.
</p></li></ul></div><p>
</p></div><div class="sect2" title="7.1.3. Examples"><div class="titlepage"><div><div><h3 class="title"><a name="tv-examples"></a>7.1.3. Examples</h3></div></div></div><div class="informalexample"><p>
Dummy output, to AAlib :)
</p><pre class="screen">mplayer -tv driver=dummy:width=640:height=480 -vo aa tv://</pre><p>
</p></div><div class="informalexample"><p>
Input from standard V4L:
</p><pre class="screen">
mplayer -tv driver=v4l:width=640:height=480:outfmt=i420 -vc rawi420 -vo xv tv://
</pre><p>
</p></div><div class="informalexample"><p>
A more sophisticated example. This makes <span class="application">MEncoder</span>
capture the full PAL image, crop the margins, and deinterlace the picture
using a linear blend algorithm. Audio is compressed with a constant bitrate
of 64kbps, using LAME codec. This setup is suitable for capturing movies.
</p><pre class="screen">
mencoder -tv driver=v4l:width=768:height=576 -oac mp3lame -lameopts cbr:br=64\
    -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 \
    -vf crop=720:544:24:16,pp=lb -o <em class="replaceable"><code>output.avi</code></em> tv://
</pre><p>
</p></div><div class="informalexample"><p>
This will additionally rescale the image to 384x288 and compresses the
video with the bitrate of 350kbps in high quality mode. The vqmax option
looses the quantizer and allows the video compressor to actually reach so
low bitrate even at the expense of the quality. This can be used for
capturing long TV series, where the video quality isn't so important.
</p><pre class="screen">
mencoder -tv driver=v4l:width=768:height=576 \
    -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=350:vhq:vqmax=31:keyint=300 \
    -oac mp3lame -lameopts cbr:br=48 -sws 1 -o <em class="replaceable"><code>output.avi</code></em>\
    -vf crop=720:540:24:18,pp=lb,scale=384:288 tv://
</pre><p>
It's also possible to specify smaller image dimensions in the
<tt class="option">-tv</tt> option and omit the software scaling but this approach
uses the maximum available information and is a little more resistant to noise.
The bt8x8 chips can do the pixel averaging only in the horizontal direction due
to a hardware limitation.
</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tv.html">上一页</a> </td><td width="20%" align="center"><a accesskey="u" href="tv.html">上一级</a></td><td width="40%" align="right"> <a accesskey="n" href="tv-teletext.html">下一页</a></td></tr><tr><td width="40%" align="left" valign="top">第 7 章 TV </td><td width="20%" align="center"><a accesskey="h" href="index.html">起始页</a></td><td width="40%" align="right" valign="top"> 7.2. Teletext</td></tr></table></div></body></html>