11156
|
1 <?xml version="1.0" encoding="utf-8"?>
|
19027
|
2 <!-- synced with 1.16 (deprecated CVS)-->
|
|
3 <!-- synced with 17322 (svn) -->
|
|
4 <!-- Opiekun: Cobra -->
|
|
5 <chapter id="tv">
|
|
6 <title>TV</title>
|
|
7
|
11156
|
8 <sect1 id="tv-input" xreflabel="TV input">
|
|
9 <title>Wejście TV</title>
|
|
10
|
|
11 <para>
|
|
12 Sekcja ta opisuje jak <emphasis role="bold">oglądać/nagrywać obraz
|
|
13 za pomocą tunera TV kompatybilnego z V4L</emphasis>. Zajrzyj do strony man
|
|
14 by zobaczyć opis opcji TV i klawiszy sterujących.
|
|
15 </para>
|
|
16
|
|
17
|
|
18 <sect2 id="tv-compilation">
|
|
19 <title>Kompilacja</title>
|
|
20
|
|
21 <procedure>
|
|
22 <step><para>
|
|
23 Najpierw musisz przekompilować. <filename>./configure</filename> wykryje
|
|
24 automatycznie nagłówki jądra związane z V4L i obecność urządzeń
|
|
25 <filename>/dev/video*</filename>. Jeśli istnieją, obsługa TV zostanie
|
|
26 wbudowana (zobacz wynik działania <filename>./configure</filename>).
|
|
27 </para></step>
|
|
28 <step><para>
|
11543
|
29 Upewnij się, że Twój tuner działa z innymi programami do obsługi TV pod
|
|
30 Linuksem, na przykład <application>XawTV</application>.
|
11156
|
31 </para></step>
|
|
32 </procedure>
|
|
33 </sect2>
|
|
34
|
|
35 <sect2 id="tv-tips">
|
|
36 <title>Wskazówki użytkowania</title>
|
|
37 <para>
|
|
38 Kompletna lista opcji dostępna jest na stronie man.
|
|
39 Tu jest tylko kilka wskazówek:
|
|
40 </para>
|
|
41 <itemizedlist>
|
|
42 <listitem>
|
|
43 <para>
|
|
44 Używaj opcji <option>channels</option>. Przykład
|
|
45 <screen>-tv channels=26-MTV1,23-TV2</screen>
|
|
46 Wyjaśnienie: używając tej opcji, tylko kanały 23 i 26 będą dostępne oraz pojawi
|
|
47 się fajny napis na OSD przy zmianie kanału, wyświetlający jego nazwę.
|
|
48 Odstępy w nazwie kanału muszą zostać zastąpione znakiem "_".
|
|
49 </para>
|
|
50 </listitem>
|
|
51
|
|
52 <listitem>
|
|
53 <para>
|
|
54 Używaj rozsądnych rozmiarów obrazu. Rozmiary obrazu wynikowego powinny
|
|
55 być podzielne przez 16.
|
|
56 </para>
|
|
57 </listitem>
|
|
58
|
|
59 <listitem>
|
|
60 <para>
|
|
61 Jeśli nagrywasz obraz video o pionowej rozdzielczości większej niż połowa
|
19027
|
62 rozdzielczości pełnej (np. 288 dla PAL lub 240 dla NTSC), wtedy 'ramki'
|
|
63 które otrzymasz będą tak naprawdę parami poprzeplatanych (interleaved) pól.
|
|
64 W zależności od tego, co chcesz zrobić ze strumieniem wideo, możesz go zostawić
|
|
65 w takiej formie, użyć destrukcyjnego usuwania przeplotu (deinterlacing),
|
|
66 albo rozdzielić pary na pojedyncze pola.
|
|
67 </para>
|
|
68 <para>
|
|
69 W przeciwnym wypadku dostaniesz
|
11543
|
70 film, który jest zniekształcony w trakcie scen o dużej dynamice, a wskazana
|
19027
|
71 szybkość transmisji (bitrate) prawdopodobnie nie będzie nawet mogła być
|
|
72 utrzymana przez kontroler szybkości (bitrate controller),
|
|
73 ponieważ artefakty przeplotu tworzą duże ilości szczegółów,
|
|
74 a co za tym idzie, potrzebują dużej przepustowości. Możesz włączyć
|
11543
|
75 usuwanie przeplotu za pomocą opcji <option>-vf pp=TYP_DEINT</option>. Zwykle
|
|
76 <option>pp=lb</option> spisuje się dobrze, ale to kwestia gustu. Poczytaj o
|
|
77 innych algorytmach usuwania przeplotu na stronie man i zacznij eksperymentować.
|
11156
|
78 </para>
|
|
79 </listitem>
|
|
80
|
|
81 <listitem>
|
|
82 <para>
|
|
83 Usuwaj "martwe miejsca". Kiedy nagrywasz video, są pewnie miejsca przy brzegach,
|
11543
|
84 które są zazwyczaj czarne lub zawierają szum. Jak się łatwo domyślić,
|
|
85 niepotrzebnie wymagają większej przepustowości (dokładniej, to nie same czarne
|
|
86 miejsca, lecz ostre przejścia pomiędzy czarnym kolorem i jaśniejszym obrazem
|
|
87 video, ale nie jest to akurat takie ważne). Zanim zaczniesz nagrywać, ustaw
|
|
88 argumenty opcji <option>crop</option> by wszystkie "śmieci" na brzegach zostały
|
|
89 wycięte. Oczywiście nie zapomnij o utrzymaniu prawidłowych wymiarów obrazu.
|
11156
|
90 </para>
|
|
91 </listitem>
|
|
92
|
|
93 <listitem>
|
|
94 <para>
|
11543
|
95 Uważaj na obciążenie CPU. Nie powinno ono przekroczyć granicy 90% przez
|
|
96 większość czasu. Jeśli masz duży bufor nagrywania,
|
|
97 <application>MEncoder</application> może przetrwać przeciążenie przez najwyżej
|
|
98 kilka sekund i nic więcej. Lepiej więc wyłączyć wszystkie trójwymiarowe
|
11156
|
99 wygaszacze OpenGL i inne tego typu bajery.
|
|
100 </para>
|
|
101 </listitem>
|
|
102
|
|
103 <listitem>
|
|
104 <para>
|
|
105 Nie mieszaj z zegarem systemowym. <application>MEncoder</application> korzysta z
|
|
106 niego do synchronizacji A/V. Jeśli zmodyfikujesz zegar systemowy (zwłaszcza
|
11543
|
107 wstecz), <application>MEncoder</application> się pogubi i utraci klatki. Jest to
|
|
108 bardzo ważna sprawa jeśli jesteś podpięty do sieci i używasz do synchronizacji
|
|
109 czasu różnych programów typu NTP. Musisz wyłączyć NTP w trakcie nagrywania,
|
|
110 jeśli chcesz, by było ono przeprowadzone niezawodnie.
|
11156
|
111 </para>
|
|
112 </listitem>
|
|
113
|
|
114 <listitem>
|
|
115 <para>
|
|
116 Nie zmieniaj opcji <option>outfmt</option>, chyba, że wiesz co robisz lub Twoja
|
|
117 karta/sterownik naprawdę nie obsługuje ustawienia domyślnego (przestrzeń
|
|
118 kolorów YV12). W poprzednich wersjach
|
|
119 <application>MPlayera</application>/<application>MEncodera</application>
|
|
120 konieczne było podanie formatu wyjścia.
|
|
121 Ten problem powinien być rozwiązany w aktualnych wydaniach i opcja
|
|
122 <option>outfmt</option> nie jest już wymagana, a ustawienie domyślne powinno
|
11543
|
123 pasować każdemu. Na przykład, jeśli nagrywasz do formatu DivX używając
|
11862
|
124 <systemitem class="library">libavcodec</systemitem> i podasz opcję <option>outfmt=RGB24</option>
|
|
125 aby zwiększyć jakość nagrywanego obrazu, zostanie on i tak później z
|
|
126 powrotem przekonwertowany do YV12, więc jedyne, co osiągniesz, to ogromna
|
|
127 strata mocy obliczeniowej.
|
11156
|
128 </para>
|
|
129 </listitem>
|
|
130
|
|
131 <listitem>
|
|
132 <para>
|
11543
|
133 By użyć przestrzeni kolorów I420 (<option>outfmt=i420</option>), musisz dodać
|
|
134 opcję <option>-vc rawi420</option> z powodu konfliktu fourcc z kodekiem Intel
|
|
135 Indeo.
|
11156
|
136 </para>
|
|
137 </listitem>
|
|
138
|
|
139 <listitem>
|
|
140 <para>
|
|
141 Jest kilka sposobów na nagrywanie audio. Możesz nagrywać dźwięk za pomocą Twojej
|
11543
|
142 karty dźwiękowej korzystając z zewnętrznego kabla pomiędzy kartą video i
|
|
143 wejściem liniowym lub korzystając z wbudowanego w układ bt878 przetwornika ADC.
|
|
144 W tym drugim przypadku musisz załadować sterownik
|
|
145 <emphasis role="bold">btaudio</emphasis>. Przeczytaj plik
|
|
146 <filename>linux/Documentation/sound/btaudio</filename> (w drzewie jądra, a nie
|
|
147 <application>MPlayera</application>) by dowiedzieć się jak korzystać z tego
|
|
148 sterownika.
|
11156
|
149 </para>
|
|
150 </listitem>
|
|
151
|
|
152 <listitem>
|
|
153 <para>
|
|
154 Jeśli <application>MEncoder</application> nie może otworzyć urządzenia
|
|
155 dźwiękowego, upewnij się, że jest ono rzeczywiście dostępne. Zdarzają się
|
16527
|
156 problemy z serwerami dźwięku typu aRts (KDE) lub ESD (GNOME). Jeśli masz
|
11156
|
157 kartę full-duplex (prawie wszystkie przyzwoite karty dostępne obecnie obsługują
|
|
158 tę funkcję) i korzystasz z KDE, spróbuj zaznaczyć opcję "Działanie w pełni
|
|
159 dupleksowe" ("full duplex") w konfiguracji serwera dźwięku.
|
|
160 </para>
|
|
161 </listitem>
|
|
162 </itemizedlist>
|
|
163 </sect2>
|
|
164
|
|
165
|
|
166 <sect2 id="tv-examples">
|
|
167 <title>Przykłady</title>
|
|
168
|
|
169 <informalexample>
|
|
170 <para>
|
|
171 Puste wyjście, do AAlib :)
|
|
172 <screen>
|
|
173 mplayer -tv driver=dummy:width=640:height=480 -vo aa tv://<!--
|
|
174 --></screen>
|
|
175 </para>
|
|
176 </informalexample>
|
|
177
|
|
178 <informalexample>
|
|
179 <para>
|
|
180 Wejście ze standardowego V4L:
|
|
181 <screen>
|
|
182 mplayer -tv driver=v4l:width=640:height=480:outfmt=i420 -vc rawi420 -vo xv tv://<!--
|
|
183 --></screen>
|
|
184 </para>
|
|
185 </informalexample>
|
|
186
|
|
187 <informalexample>
|
|
188 <para>
|
11543
|
189 Bardziej skomplikowany przykład. Każe on
|
|
190 <application>MEncoderowi</application> nagrać pełen
|
11156
|
191 obraz PAL, wykadrować go i usunąć przeplot korzystając z algorytmu
|
|
192 liniowego zlewania (linear blend). Audio jest kompresowane ze stałą
|
|
193 szybkością równą 64kbps, korzystając z kodeka LAME. To ustawienie jest
|
|
194 dobre do nagrywania filmów.
|
|
195 <screen>
|
|
196 mencoder -tv driver=v4l:width=768:height=576 \
|
|
197 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 \
|
|
198 -oac mp3lame -lameopts cbr:br=64 \
|
11718
|
199 -vf crop=720:544:24:16,pp=lb -o <replaceable>wyjscie.avi</replaceable> tv://
|
11156
|
200 </screen>
|
|
201 </para>
|
|
202 </informalexample>
|
|
203
|
|
204 <informalexample>
|
|
205 <para>
|
|
206 Ten przykład dodatkowo przeskaluje obraz do 384x288 i skompresuje video
|
|
207 z szybkością 350kbps w trybie wysokiej jakości. Opcja <option>vqmax</option>
|
|
208 uwalnia kwantyzator i pozwala kompresorowi video na osiągnięcie tak
|
|
209 niskiej szybkości nawet kosztem jakości obrazu. Może być to używane do
|
|
210 nagrywania długich seriali TV, kiedy jakość obrazu nie jest tak ważna.
|
|
211 <screen>
|
|
212 mencoder -tv driver=v4l:width=768:height=576 \
|
|
213 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=350:vhq:vqmax=31:keyint=300 \
|
|
214 -oac mp3lame -lameopts cbr:br=48 \
|
14980
|
215 -vf crop=720:540:24:18,pp=lb,scale=384:288 -sws 1 -o <replaceable>wyjscie.avi</replaceable> tv://
|
11156
|
216 </screen>
|
11543
|
217 Jest również możliwe podanie mniejszych wymiarów obrazu w opcji
|
|
218 <option>-tv</option> i pominięcie programowego skalowania, ale to podejście
|
|
219 wykorzystuje maksymalną ilość dostępnych informacji i jest trochę bardziej
|
|
220 odporne na szum. Z powodu ograniczeń sprzętowych Układy bt878 mogą stosować
|
|
221 uśrednianie pikseli jedynie w kierunku poziomym.
|
11156
|
222 </para>
|
|
223 </informalexample>
|
|
224 </sect2>
|
|
225 </sect1>
|
19027
|
226
|
|
227 </chapter> |