Mercurial > mplayer.hg
comparison DOCS/xml/en/tvinput.xml @ 9675:62c5a17038ba
XML version of MPlayer's doc
author | nicolas |
---|---|
date | Sun, 23 Mar 2003 23:35:12 +0000 |
parents | |
children | 142c42fa0986 |
comparison
equal
deleted
inserted
replaced
9674:461f71ba8af4 | 9675:62c5a17038ba |
---|---|
1 <?xml version="1.0" encoding="iso-8859-1"?> | |
2 <sect1 id="tv-input" xreflabel="TV input"> | |
3 <title>TV input</title> | |
4 | |
5 <para> | |
6 This section is about how to enable <emphasis role="bold">watching/grabbing | |
7 from V4L compatible TV tuner</emphasis>. | |
8 </para> | |
9 | |
10 | |
11 <sect2 id="tv-compilation"> | |
12 <title>Compilation</title> | |
13 | |
14 <procedure> | |
15 <step><para> | |
16 First, you have to recompile. <filename>./configure</filename> will | |
17 autodetect kernel headers of v4l stuff and the existence of | |
18 <filename>/dev/video*</filename> entries. If they exist, TV support will | |
19 be built (see the output of <filename>./configure</filename>). | |
20 </para></step> | |
21 <step><para> | |
22 Make sure your tuner works with another TV software in Linux, for | |
23 example xawtv. | |
24 </para></step> | |
25 </procedure> | |
26 </sect2> | |
27 | |
28 <sect2 id="tv-tips"> | |
29 <title>Usage tips</title> | |
30 <para> | |
31 The full listing of the options is available on the manual page. | |
32 Here are just a few tips: | |
33 </para> | |
34 <itemizedlist> | |
35 <listitem> | |
36 <para> | |
37 Use the <option>channels</option> option. An example: | |
38 <screen>-tv on:channels=26-MTV1,23-TV2</screen> | |
39 Explanation: using this option, only the 26 and 23 channels will be usable, | |
40 and there will be a nice OSD text upon channel switching, displaying the | |
41 channel's name. Spaces in the channel name must be replaced by the | |
42 "_" character. | |
43 </para> | |
44 </listitem> | |
45 | |
46 <listitem> | |
47 <para> | |
48 Choose some sane image dimensions. The dimensions of the resulting image should | |
49 be divisible by 16. | |
50 </para> | |
51 </listitem> | |
52 | |
53 <listitem> | |
54 <para> | |
55 If you capture the video with the vertical resolution higher than half of | |
56 the full resolution (i.e. 288 for PAL or 240 for NTSC), make sure you turned | |
57 deinterlacing on. Otherwise you'll get a movie which is distorted during | |
58 fast-motion scenes and the bitrate controller will be probably even unable | |
59 to retain the specified bitrate as the interlacing artifacts produce high | |
60 amount of detail and thus consume lot of bandwidth. You can enable | |
61 deinterlacing with <option>-vop pp=DEINT_TYPE</option>. Usually | |
62 <option>pp=lb</option> does a good job, but it can be matter of personal | |
63 preference. See other deinterlacing algorithms in the manual and give it a try. | |
64 </para> | |
65 </listitem> | |
66 | |
67 <listitem> | |
68 <para> | |
69 Crop out the dead space. When you capture the video, the areas at the edges | |
70 are usually black or contain some noise. These again consume lots of | |
71 unnecessary bandwidth. More precisely it's not the black areas themselves | |
72 but the sharp transitions between the black and the brighter video image | |
73 which do but that's not important for now. Before you start capturing, | |
74 adjust the arguments of the <option>crop</option> option so that all the | |
75 crap at the margins is cropped out. Again, don't forget to keep the resulting | |
76 dimensions sane. | |
77 </para> | |
78 </listitem> | |
79 | |
80 <listitem> | |
81 <para> | |
82 Watch out for CPU load. It shouldn't cross the 90% boundary for most of the | |
83 time. If you have a large capture buffer, MEncoder can survive an overload | |
84 for few seconds but nothing more. It's better to turn off the 3D OpenGL | |
85 screensavers and similar stuff. | |
86 </para> | |
87 </listitem> | |
88 | |
89 <listitem> | |
90 <para> | |
91 Don't mess with the system clock. <application>MEncoder</application> uses the | |
92 system clock for doing A/V sync. If you adjust the system clock (especially | |
93 backwards in time), MEncoder gets confused and you will lose frames. This is | |
94 an important issue if you are hooked to a network and run some time | |
95 synchronization software like NTP. You have to turn NTP off during the capture | |
96 process if you want to capture reliably. | |
97 </para> | |
98 </listitem> | |
99 | |
100 <listitem> | |
101 <para> | |
102 Don't change the <option>outfmt</option> unless you know what you are doing | |
103 or your card/driver really doesn't support the default (YV12 colorspace). | |
104 In the older versions of <application>MPlayer</application>/ | |
105 <application>MEncoder</application> it was necessary to specify the output | |
106 format. This issue should be fixed in the current releases and <option>outfmt</option> | |
107 isn't required anymore, and the default suits the most purposes. For example, | |
108 if you are capturing into DivX using libavcodec and specify | |
109 <option>outfmt=RGB24</option> in order to increase the quality of the captured | |
110 images, the captured image will be actually later converted back into YV12 so | |
111 the only thing you achieve is a massive waste of CPU power. | |
112 </para> | |
113 </listitem> | |
114 | |
115 <listitem> | |
116 <para> | |
117 To specify the I420 colorspace (<option>outfmt=i420</option>), you have to add an | |
118 option <option>-vc rawi420</option> due to a fourcc conflict with an Intel Indeo | |
119 video codec. | |
120 </para> | |
121 </listitem> | |
122 | |
123 <listitem> | |
124 <para> | |
125 There are several ways of capturing audio. You can grab the sound either using | |
126 your soundcard via an external cable connection between video card and line-in, | |
127 or using the built-in ADC in the bt878 chip. In the latter case, you have to | |
128 load the <emphasis role="bold">btaudio</emphasis> driver. Read the | |
129 <filename>linux/Documentation/sound/btaudio</filename> file (in the kernel | |
130 tree, not MPlayer's) for some instructions on using this driver. | |
131 </para> | |
132 </listitem> | |
133 | |
134 <listitem> | |
135 <para> | |
136 If <application>MEncoder</application> cannot open the audio device, make | |
137 sure that it is really available. There can be some trouble with the sound | |
138 servers like arts (KDE) or esd (GNOME). If you have a full duplex soundcard | |
139 (almost any decent card supports it today), and you are using KDE, try to | |
140 check the "full duplex" option in the sound server preference menu. | |
141 </para> | |
142 </listitem> | |
143 </itemizedlist> | |
144 </sect2> | |
145 | |
146 | |
147 <sect2 id="tv-examples"> | |
148 <title>Examples</title> | |
149 | |
150 <informalexample> | |
151 <para> | |
152 Dummy output, to AAlib :) | |
153 <screen> | |
154 mplayer -tv on:driver=dummy:width=640:height=480 -vo aa<!-- | |
155 --></screen> | |
156 </para> | |
157 </informalexample> | |
158 | |
159 <informalexample> | |
160 <para> | |
161 Input from standard V4L: | |
162 <screen> | |
163 mplayer -tv on:driver=v4l:width=640:height=480:outfmt=i420 -vc rawi420 -vo xv<!-- | |
164 --></screen> | |
165 </para> | |
166 </informalexample> | |
167 | |
168 <informalexample> | |
169 <para> | |
170 A more sophisticated example. This makes MEncoder capture the full PAL | |
171 image, crop the margins, and deinterlace the picture using a linear blend | |
172 algorithm. Audio is compressed with a constant bitrate of 64kbps, using | |
173 LAME codec. This setup is suitable for capturing movies. | |
174 <screen> | |
175 mencoder -tv on:driver=v4l:width=768:height=576 \ | |
176 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 \ | |
177 -oac mp3lame -lameopts cbr:br=64 \ | |
178 -vop pp=lb,crop=720:544:24:16 -o output.avi | |
179 </screen> | |
180 </para> | |
181 </informalexample> | |
182 | |
183 <informalexample> | |
184 <para> | |
185 This will additionally rescale the image to 384x288 and compresses the | |
186 video with the bitrate of 350kbps in high quality mode. The vqmax option | |
187 looses the quantizer and allows the video compressor to actualy reach so | |
188 low bitrate even at the expense of the quality. This can be used for | |
189 capturing long TV series, where the video quality isn't so important. | |
190 <screen> | |
191 mencoder -tv on:driver=v4l:width=768:height=576 \ | |
192 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=350:vhq:vqmax=31:keyint=300 \ | |
193 -oac mp3lame -lameopts cbr:br=48 \ | |
194 -vop scale=384:288,pp=tn/lb,crop=720:540:24:18 -sws 1 -o output.avi | |
195 </screen> | |
196 It's also possible to specify smaller image dimensions in the <option>-tv</option> | |
197 option and omit the software scaling but this approach uses the maximum available | |
198 information and is a little more resistant to noise. The bt8x8 chips can do the | |
199 pixel averaging only in the horizontal direction due to a hardware limitation. | |
200 </para> | |
201 </informalexample> | |
202 </sect2> | |
203 </sect1> |