comparison DOCS/xml/en/usage.xml @ 21521:b210a229fbcb

General reformatting round: - fix some " -> &quot; - reindent with more consistency - visual markup of <sect?> tags - break overly long lines - add missing <replaceable> tags in examples - cola truck standing by
author torinthiel
date Fri, 08 Dec 2006 11:38:06 +0000
parents c0687e92d463
children f551403d82a9
comparison
equal deleted inserted replaced
21520:0977cf2eb136 21521:b210a229fbcb
7 <title>Command line</title> 7 <title>Command line</title>
8 8
9 <para> 9 <para>
10 <application>MPlayer</application> utilizes a complex playtree. It consists 10 <application>MPlayer</application> utilizes a complex playtree. It consists
11 of global options written as first, for example 11 of global options written as first, for example
12
13 <screen>mplayer -vfm 5</screen> 12 <screen>mplayer -vfm 5</screen>
14
15 and options written after filenames, that apply only to the given 13 and options written after filenames, that apply only to the given
16 filename/URL/whatever, for example: 14 filename/URL/whatever, for example:
17 15 <screen>
18 <screen>mplayer -vfm 5 <replaceable>movie1.avi</replaceable> <replaceable>movie2.avi</replaceable> -vfm 4</screen> 16 mplayer -vfm 5 <replaceable>movie1.avi</replaceable> <replaceable>movie2.avi</replaceable> -vfm 4
17 </screen>
19 </para> 18 </para>
20 19
21 <para> 20 <para>
22 You can group filenames/URLs together using <literal>{</literal> and 21 You can group filenames/URLs together using <literal>{</literal> and
23 <literal>}</literal>. It is useful with option <option>-loop</option>: 22 <literal>}</literal>. It is useful with option <option>-loop</option>:
24
25 <screen>mplayer { 1.avi -loop 2 2.avi } -loop 3</screen> 23 <screen>mplayer { 1.avi -loop 2 2.avi } -loop 3</screen>
26
27 The above command will play files in this order: 1, 1, 2, 1, 1, 2, 1, 1, 2. 24 The above command will play files in this order: 1, 1, 2, 1, 1, 2, 1, 1, 2.
28 </para> 25 </para>
29 26
30 <para> 27 <para>
31 Playing a file: 28 Playing a file:
103 --></screen> 100 --></screen>
104 </para> 101 </para>
105 </sect1> 102 </sect1>
106 103
107 104
105 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
106
107
108 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
109
110
108 <sect1 id="subosd"> 111 <sect1 id="subosd">
109 <title>Subtitles and OSD</title> 112 <title>Subtitles and OSD</title>
110 113
111 <para> 114 <para>
112 <application>MPlayer</application> can display subtitles along with movie files. 115 <application>MPlayer</application> can display subtitles along with movie files.
113 Currently the following formats are supported: 116 Currently the following formats are supported:
114 <itemizedlist> 117 <itemizedlist>
115 <listitem><para>VOBsub</para></listitem> 118 <listitem><para>VOBsub</para></listitem>
116 <listitem><para>OGM</para></listitem> 119 <listitem><para>OGM</para></listitem>
117 <listitem><para>CC (closed caption)</para></listitem> 120 <listitem><para>CC (closed caption)</para></listitem>
118 <listitem><para>MicroDVD</para></listitem> 121 <listitem><para>MicroDVD</para></listitem>
119 <listitem><para>SubRip</para></listitem> 122 <listitem><para>SubRip</para></listitem>
120 <listitem><para>SubViewer</para></listitem> 123 <listitem><para>SubViewer</para></listitem>
121 <listitem><para>Sami</para></listitem> 124 <listitem><para>Sami</para></listitem>
122 <listitem><para>VPlayer</para></listitem> 125 <listitem><para>VPlayer</para></listitem>
123 <listitem><para>RT</para></listitem> 126 <listitem><para>RT</para></listitem>
124 <listitem><para>SSA</para></listitem> 127 <listitem><para>SSA</para></listitem>
125 <listitem><para>PJS (Phoenix Japanimation Society)</para></listitem> 128 <listitem><para>PJS (Phoenix Japanimation Society)</para></listitem>
126 <listitem><para>MPsub</para></listitem> 129 <listitem><para>MPsub</para></listitem>
127 <listitem><para>AQTitle</para></listitem> 130 <listitem><para>AQTitle</para></listitem>
128 <listitem><para><ulink url="http://unicorn.us.com/jacosub/">JACOsub</ulink></para></listitem> 131 <listitem><para>
132 <ulink url="http://unicorn.us.com/jacosub/">JACOsub</ulink>
133 </para></listitem>
129 </itemizedlist> 134 </itemizedlist>
130 </para> 135 </para>
131 136
132 <para> 137 <para>
133 <application>MPlayer</application> can dump the previously listed subtitle formats 138 <application>MPlayer</application> can dump the previously listed subtitle
134 (<emphasis role="bold">except the three first</emphasis>) into the following 139 formats (<emphasis role="bold">except the three first</emphasis>) into the
135 destination formats, with the given options: 140 following destination formats, with the given options:
136 <itemizedlist> 141 <itemizedlist>
137 <listitem><para>MPsub: <option>-dumpmpsub</option></para></listitem> 142 <listitem><para>MPsub: <option>-dumpmpsub</option></para></listitem>
138 <listitem><para>SubRip: <option>-dumpsrtsub</option></para></listitem> 143 <listitem><para>SubRip: <option>-dumpsrtsub</option></para></listitem>
139 <listitem><para>MicroDVD: <option>-dumpmicrodvdsub</option></para></listitem> 144 <listitem><para>MicroDVD: <option>-dumpmicrodvdsub</option></para></listitem>
140 <listitem><para>JACOsub: <option>-dumpjacosub</option></para></listitem> 145 <listitem><para>JACOsub: <option>-dumpjacosub</option></para></listitem>
141 <listitem><para>Sami: <option>-dumpsami</option></para></listitem> 146 <listitem><para>Sami: <option>-dumpsami</option></para></listitem>
142 </itemizedlist> 147 </itemizedlist>
143 </para> 148 </para>
144 149
145 <para> 150 <para>
146 <application>MEncoder</application> can dump DVD subtitles into 151 <application>MEncoder</application> can dump DVD subtitles into
152 </para> 157 </para>
153 158
154 <formalpara> 159 <formalpara>
155 <title>VOBsub subtitles</title> 160 <title>VOBsub subtitles</title>
156 <para> 161 <para>
157 VOBsub subtitles consist of a big (some megabytes) <filename>.SUB</filename> file, 162 VOBsub subtitles consist of a big (some megabytes) <filename>.SUB</filename>
158 and optional <filename>.IDX</filename> and/or <filename>.IFO</filename> 163 file, and optional <filename>.IDX</filename> and/or <filename>.IFO</filename>
159 files. If you have files like 164 files. If you have files like
160 <filename><replaceable>sample.sub</replaceable></filename>, 165 <filename><replaceable>sample.sub</replaceable></filename>,
161 <filename><replaceable>sample.ifo</replaceable></filename> (optional), 166 <filename><replaceable>sample.ifo</replaceable></filename> (optional),
162 <filename><replaceable>sample.idx</replaceable></filename> - you have to pass 167 <filename><replaceable>sample.idx</replaceable></filename> - you have to pass
163 <application>MPlayer</application> the <option>-vobsub sample 168 <application>MPlayer</application> the <option>-vobsub sample
164 [-vobsubid <replaceable>id</replaceable>]</option> options 169 [-vobsubid <replaceable>id</replaceable>]</option> options
165 (full path optional). The <option>-vobsubid</option> option is like 170 (full path optional). The <option>-vobsubid</option> option is like
166 <option>-sid</option> for DVDs, you can choose between subtitle tracks 171 <option>-sid</option> for DVDs, you can choose between subtitle tracks
167 (languages) with it. In case that <option>-vobsubid</option> is omitted, 172 (languages) with it. In case that <option>-vobsubid</option> is omitted,
168 <application>MPlayer</application> will try to use the languages given by the 173 <application>MPlayer</application> will try to use the languages given by the
169 <option>-slang</option> option and fall back to the <systemitem>langidx</systemitem> 174 <option>-slang</option> option and fall back to the
170 in the <filename>.IDX</filename> file to set the subtitle language. If it fails, 175 <systemitem>langidx</systemitem> in the <filename>.IDX</filename> file to set
171 there will be no subtitles. 176 the subtitle language. If it fails, there will be no subtitles.
172 </para> 177 </para>
173 </formalpara> 178 </formalpara>
174 179
175 <formalpara> 180 <formalpara>
176 <title>Other subtitles</title> 181 <title>Other subtitles</title>
188 <varlistentry> 193 <varlistentry>
189 <term><option>-subdelay <replaceable>sec</replaceable></option></term> 194 <term><option>-subdelay <replaceable>sec</replaceable></option></term>
190 <listitem><simpara> 195 <listitem><simpara>
191 Delays subtitles by <option><replaceable>sec</replaceable></option> seconds. 196 Delays subtitles by <option><replaceable>sec</replaceable></option> seconds.
192 Can be negative. The value is added to movie's time position counter. 197 Can be negative. The value is added to movie's time position counter.
193 </simpara></listitem> 198 </simpara></listitem>
194 </varlistentry> 199 </varlistentry>
195 <varlistentry> 200 <varlistentry>
196 <term><option>-subfps <replaceable>RATE</replaceable></option></term> 201 <term><option>-subfps <replaceable>RATE</replaceable></option></term>
197 <listitem><simpara> 202 <listitem><simpara>
198 Specify frame/sec rate of subtitle file (float number). 203 Specify frame/sec rate of subtitle file (float number).
199 </simpara></listitem> 204 </simpara></listitem>
200 </varlistentry> 205 </varlistentry>
201 <varlistentry> 206 <varlistentry>
202 <term><option>-subpos <replaceable>0-100</replaceable></option></term> 207 <term><option>-subpos <replaceable>0-100</replaceable></option></term>
203 <listitem><simpara> 208 <listitem><simpara>
204 Specify the position of subtitles. 209 Specify the position of subtitles.
205 </simpara></listitem> 210 </simpara></listitem>
206 </varlistentry> 211 </varlistentry>
207 </variablelist> 212 </variablelist>
208 213
209 <para> 214 <para>
210 If you experience a growing delay between the movie and the subtitles when 215 If you experience a growing delay between the movie and the subtitles when
215 be used with this format. If you like to solve this problem permanently, 220 be used with this format. If you like to solve this problem permanently,
216 you have to manually convert the subtitle file framerate. 221 you have to manually convert the subtitle file framerate.
217 <application>MPlayer</application> can do this 222 <application>MPlayer</application> can do this
218 conversion for you: 223 conversion for you:
219 224
220 <screen>mplayer -dumpmicrodvdsub -fps <replaceable>subtitles_fps</replaceable> -subfps <replaceable>avi_fps</replaceable> -sub <replaceable>subtitle_filename</replaceable> <replaceable>dummy.avi</replaceable></screen> 225 <screen>
226 mplayer -dumpmicrodvdsub -fps <replaceable>subtitles_fps</replaceable> -subfps <replaceable>avi_fps</replaceable> \
227 -sub <replaceable>subtitle_filename</replaceable> <replaceable>dummy.avi</replaceable>
228 </screen>
221 </para> 229 </para>
222 230
223 <para> 231 <para>
224 About DVD subtitles, read the <link linkend="dvd">DVD</link> section. 232 About DVD subtitles, read the <link linkend="dvd">DVD</link> section.
225 </para> 233 </para>
226 </sect1> 234 </sect1>
235
236
237 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
238
239
240 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
227 241
228 242
229 <sect1 id="control"> 243 <sect1 id="control">
230 <title>Control</title> 244 <title>Control</title>
231 245
234 driven, control layer which lets you control 248 driven, control layer which lets you control
235 <application>MPlayer</application> with keyboard, mouse, joystick or remote 249 <application>MPlayer</application> with keyboard, mouse, joystick or remote
236 control (using LIRC). See the man page for the complete list of keyboard controls. 250 control (using LIRC). See the man page for the complete list of keyboard controls.
237 </para> 251 </para>
238 252
253 <!-- ********** -->
239 254
240 <sect2 id="ctrl-cfg"> 255 <sect2 id="ctrl-cfg">
241 <title>Controls configuration</title> 256 <title>Controls configuration</title>
242 257
243 <para> 258 <para>
273 ENTER pt_step 1 1<!-- 288 ENTER pt_step 1 1<!--
274 --></programlisting> 289 --></programlisting>
275 </example> 290 </example>
276 </sect2> 291 </sect2>
277 292
293 <!-- ********** -->
278 294
279 <sect2 id="lirc"> 295 <sect2 id="lirc">
280 <title>Control from LIRC</title> 296 <title>Control from LIRC</title>
281 297
282 <para> 298 <para>
337 <replaceable>filename</replaceable></option> switch to specify another 353 <replaceable>filename</replaceable></option> switch to specify another
338 file. 354 file.
339 </para> 355 </para>
340 </sect2> 356 </sect2>
341 357
358 <!-- ********** -->
342 359
343 <sect2 id="slave-mode"> 360 <sect2 id="slave-mode">
344 <title>Slave mode</title> 361 <title>Slave mode</title>
362
345 <para> 363 <para>
346 The slave mode allows you to build simple frontends to 364 The slave mode allows you to build simple frontends to
347 <application>MPlayer</application>. When run with the 365 <application>MPlayer</application>. When run with the
348 <option>-slave</option> option <application>MPlayer</application> will 366 <option>-slave</option> option <application>MPlayer</application> will
349 read commands separated by a newline (\n) from stdin. 367 read commands separated by a newline (\n) from stdin.
351 <ulink url="../../tech/slave.txt">slave.txt</ulink> file. 369 <ulink url="../../tech/slave.txt">slave.txt</ulink> file.
352 </para> 370 </para>
353 </sect2> 371 </sect2>
354 </sect1> 372 </sect1>
355 373
374 <!-- ********** -->
375
376 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
377
356 378
357 <sect1 id="streaming"> 379 <sect1 id="streaming">
358 <title>Streaming from network or pipes</title> 380 <title>Streaming from network or pipes</title>
359 381
360 <para> 382 <para>
380 It is also recommended to enable <option>-cache</option> when playing 402 It is also recommended to enable <option>-cache</option> when playing
381 from the network: 403 from the network:
382 <screen>wget <replaceable>ftp://micorsops.com/something.avi</replaceable> -O - | mplayer -cache 8192 -</screen> 404 <screen>wget <replaceable>ftp://micorsops.com/something.avi</replaceable> -O - | mplayer -cache 8192 -</screen>
383 </para></note> 405 </para></note>
384 406
407 <!-- ********** -->
408
385 <sect2 id="streaming-save"> 409 <sect2 id="streaming-save">
386 <title>Saving streamed content</title> 410 <title>Saving streamed content</title>
387 <para> 411
388 Once you succeed in making <application>MPlayer</application> play 412 <para>
389 your favorite internet stream, you can use the option 413 Once you succeed in making <application>MPlayer</application> play
390 <option>-dumpstream</option> to save the stream into a file. 414 your favorite internet stream, you can use the option
391 For example: 415 <option>-dumpstream</option> to save the stream into a file.
392 <screen> 416 For example:
393 mplayer <replaceable>http://217.71.208.37:8006</replaceable> -dumpstream -dumpfile <replaceable>stream.asf</replaceable> 417 <screen>
418 mplayer <replaceable>http://217.71.208.37:8006</replaceable> -dumpstream -dumpfile <replaceable>stream.asf</replaceable>
394 </screen> 419 </screen>
395 will save the content streamed from 420 will save the content streamed from
396 <replaceable>http://217.71.208.37:8006</replaceable> into 421 <replaceable>http://217.71.208.37:8006</replaceable> into
397 <replaceable>stream.asf</replaceable>. 422 <replaceable>stream.asf</replaceable>.
398 This works with all protocols supported by 423 This works with all protocols supported by
399 <application>MPlayer</application>, like MMS, RSTP, and so forth. 424 <application>MPlayer</application>, like MMS, RSTP, and so forth.
400 </para> 425 </para>
401 </sect2> 426 </sect2>
402
403 </sect1> 427 </sect1>
428
429 <!-- ********** -->
430
431 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
432
404 433
405 <sect1 id="mpst" xreflabel="Remote streams"> 434 <sect1 id="mpst" xreflabel="Remote streams">
406 <title>Remote streams</title> 435 <title>Remote streams</title>
407 436
408 <para> 437 <para>
413 stream type (currently TV and MF) are not usable remotely because they are 442 stream type (currently TV and MF) are not usable remotely because they are
414 implemented at the demuxer level. It is sad for MF but TV stream would anyway 443 implemented at the demuxer level. It is sad for MF but TV stream would anyway
415 require an insane amount of bandwidth. 444 require an insane amount of bandwidth.
416 </para> 445 </para>
417 446
447 <!-- ********** -->
448
418 <sect2 id="compile_mpst_server"> 449 <sect2 id="compile_mpst_server">
419 <title>Compiling the server</title> 450 <title>Compiling the server</title>
451
420 <para> 452 <para>
421 After having compiled <application>MPlayer</application> go to the 453 After having compiled <application>MPlayer</application> go to the
422 <filename>TOOLS/netstream</filename> directory and enter 454 <filename>TOOLS/netstream</filename> directory and enter
423 <application>make</application> to build the server binary. 455 <application>make</application> to build the server binary.
424 You can then copy the <application>netstream</application> binary 456 You can then copy the <application>netstream</application> binary
425 to the right place on your system (usually 457 to the right place on your system (usually
426 <filename class="directory">/usr/local/bin</filename> on Linux). 458 <filename class="directory">/usr/local/bin</filename> on Linux).
427 </para> 459 </para>
428 </sect2> 460 </sect2>
429 461
462 <!-- ********** -->
463
430 <sect2 id="use_mpst"> 464 <sect2 id="use_mpst">
431 <title>Using remote streams</title> 465 <title>Using remote streams</title>
466
432 <para> 467 <para>
433 First you have to start the server on the computer you intend to remotely 468 First you have to start the server on the computer you intend to remotely
434 access. Currently the server is very basic and does not have any commands 469 access. Currently the server is very basic and does not have any commands
435 line arguments so just enter <filename>netstream</filename>. Now you can 470 line arguments so just enter <filename>netstream</filename>. Now you can
436 for example play the second track of a VCD on the server with : 471 for example play the second track of a VCD on the server with :
440 You can also access files on this server : 475 You can also access files on this server :
441 <screen> 476 <screen>
442 mplayer -cache 5000 <replaceable>mpst://servername//usr/local/movies/lol.avi</replaceable> 477 mplayer -cache 5000 <replaceable>mpst://servername//usr/local/movies/lol.avi</replaceable>
443 </screen> 478 </screen>
444 Note that paths which aren't starting with a / will be relative to 479 Note that paths which aren't starting with a / will be relative to
445 the directory where the server is running. The <option>-cache</option> option is not 480 the directory where the server is running. The <option>-cache</option> option
446 needed but highly recommended. 481 is not needed but highly recommended.
447 </para> 482 </para>
448 483
449 <para> 484 <para>
450 Be aware that currently the server is not secure at all. So do not complain 485 Be aware that currently the server is not secure at all. So do not complain
451 about the numerous exploits which are possible through this. Instead send 486 about the numerous exploits which are possible through this. Instead send
452 some (good) patch to make it better or start writing your own server. 487 some (good) patch to make it better or start writing your own server.
453 </para> 488 </para>
454
455 </sect2> 489 </sect2>
456
457 </sect1> 490 </sect1>
491
492
493 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
494
458 495
459 <sect1 id="edl" xreflabel="Edit Decision Lists (EDL)"> 496 <sect1 id="edl" xreflabel="Edit Decision Lists (EDL)">
460 <title>Edit Decision Lists (EDL)</title> 497 <title>Edit Decision Lists (EDL)</title>
461 498
462 <para> 499 <para>
475 <para> 512 <para>
476 The EDL file format is pretty bare-bones. There is one command per line that 513 The EDL file format is pretty bare-bones. There is one command per line that
477 indicates what to do (skip/mute) and when to do it (using pts in seconds). 514 indicates what to do (skip/mute) and when to do it (using pts in seconds).
478 </para> 515 </para>
479 516
517 <!-- ********** -->
518
480 <sect2 id="edl_using"> 519 <sect2 id="edl_using">
481 <title>Using an EDL file</title> 520 <title>Using an EDL file</title>
521
482 <para> 522 <para>
483 Include the <option>-edl &lt;filename&gt;</option> flag when you run 523 Include the <option>-edl &lt;filename&gt;</option> flag when you run
484 <application>MPlayer</application>, with the name of the EDL file you 524 <application>MPlayer</application>, with the name of the EDL file you
485 want applied to the video. 525 want applied to the video.
486 </para> 526 </para>
487 </sect2> 527 </sect2>
488 528
529 <!-- ********** -->
530
489 <sect2 id="edl_making"> 531 <sect2 id="edl_making">
490 <title>Making an EDL file</title> 532 <title>Making an EDL file</title>
533
491 <para> 534 <para>
492 The current EDL file format is: 535 The current EDL file format is:
493 <programlisting> 536 <programlisting>[begin second] [end second] [action]</programlisting>
494 [begin second] [end second] [action]
495 </programlisting>
496 Where the seconds are floating-point numbers and the action is either 537 Where the seconds are floating-point numbers and the action is either
497 <literal>0</literal> for skip or <literal>1</literal> for mute. Example: 538 <literal>0</literal> for skip or <literal>1</literal> for mute. Example:
498 <programlisting> 539 <programlisting>
499 5.3 7.1 0 540 5.3 7.1 0
500 15 16.7 1 541 15 16.7 1
505 of the video. These actions will be performed when the playback timer 546 of the video. These actions will be performed when the playback timer
506 reaches the times given in the file. 547 reaches the times given in the file.
507 </para> 548 </para>
508 549
509 <para> 550 <para>
510 To create an EDL file to work from, use the <option>-edlout &lt;filename&gt;</option> 551 To create an EDL file to work from, use the <option>-edlout
511 flag. During playback, just hit <keycap>i</keycap> to mark the beginning and 552 &lt;filename&gt;</option> flag. During playback, just hit <keycap>i</keycap> to
512 end of a skip block. A corresponding entry will be written to the file for 553 mark the beginning and end of a skip block.
513 that time. You can then go back and fine-tune the generated EDL file as well as 554 A corresponding entry will be written to the file for that time.
555 You can then go back and fine-tune the generated EDL file as well as
514 change the default operation which is to skip the block described by each line. 556 change the default operation which is to skip the block described by each line.
515 </para> 557 </para>
516 </sect2> 558 </sect2>
517
518 </sect1> 559 </sect1>
560
561
562 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
519 563
520 564
521 <sect1 id="advaudio" xreflabel="Advanced Audio"> 565 <sect1 id="advaudio" xreflabel="Advanced Audio">
522 <title>Advanced audio</title> 566 <title>Advanced audio</title>
523 567
524 <sect2 id="advaudio-surround"> 568 <sect2 id="advaudio-surround">
525 <title>Surround/Multichannel playback</title> 569 <title>Surround/Multichannel playback</title>
526 570
527 <sect3 id="advaudio-surround-DVD"> 571 <sect3 id="advaudio-surround-DVD">
528 <title>DVDs</title> 572 <title>DVDs</title>
573
529 <para> 574 <para>
530 Most DVDs and many other files include surround sound. 575 Most DVDs and many other files include surround sound.
531 <application>MPlayer</application> supports surround playback but does not 576 <application>MPlayer</application> supports surround playback but does not
532 enable it by default because stereo equipment is by far more common. To play a 577 enable it by default because stereo equipment is by far more common. To play a
533 file that has more than two channels of audio use <option>-channels</option>. 578 file that has more than two channels of audio use <option>-channels</option>.
534 For example, to play a DVD with 5.1 audio: 579 For example, to play a DVD with 5.1 audio:
535
536 <screen>mplayer dvd://1 -channels 6</screen> 580 <screen>mplayer dvd://1 -channels 6</screen>
537
538 Note that despite the name "5.1" there are actually six discrete channels. 581 Note that despite the name "5.1" there are actually six discrete channels.
539 If you have surround sound equipment it is safe to put the 582 If you have surround sound equipment it is safe to put the
540 <option>channels</option> option in your <application>MPlayer</application> 583 <option>channels</option> option in your <application>MPlayer</application>
541 configuration file <filename>~/.mplayer/config</filename>. For example, to make 584 configuration file <filename>~/.mplayer/config</filename>. For example, to make
542 quadraphonic playback the default, add this line: 585 quadraphonic playback the default, add this line:
543
544 <programlisting>channels=4</programlisting> 586 <programlisting>channels=4</programlisting>
545
546 <application>MPlayer</application> will then output audio in four channels when 587 <application>MPlayer</application> will then output audio in four channels when
547 all four channels are available. 588 all four channels are available.
548 </para> 589 </para>
549 </sect3> 590 </sect3>
550 591
553 <title>Playing stereo files to four speakers</title> 594 <title>Playing stereo files to four speakers</title>
554 595
555 <para> 596 <para>
556 <application>MPlayer</application> does not duplicate any channels by default, 597 <application>MPlayer</application> does not duplicate any channels by default,
557 and neither do most audio drivers. If you want to do that manually: 598 and neither do most audio drivers. If you want to do that manually:
558
559 <screen>mplayer <replaceable>filename</replaceable> -af channels=2:2:0:1:0:0</screen> 599 <screen>mplayer <replaceable>filename</replaceable> -af channels=2:2:0:1:0:0</screen>
560
561 See the section on 600 See the section on
562 <link linkend="advaudio-channels-copying">channel copying</link> for an 601 <link linkend="advaudio-channels-copying">channel copying</link> for an
563 explanation. 602 explanation.
564 </para> 603 </para>
565
566 </sect3> 604 </sect3>
567 605
568 606
569 <sect3 id="advaudio-surround-passthrough"> 607 <sect3 id="advaudio-surround-passthrough">
570 <title>AC3/DTS Passthrough</title> 608 <title>AC3/DTS Passthrough</title>
584 </para> 622 </para>
585 623
586 <itemizedlist> 624 <itemizedlist>
587 <title>To enable passthrough on the command line:</title> 625 <title>To enable passthrough on the command line:</title>
588 <listitem><para> 626 <listitem><para>
589 For AC3 only, use <option>-ac hwac3</option> 627 For AC3 only, use <option>-ac hwac3</option>
590 </para></listitem> 628 </para></listitem>
591 <listitem><para> 629 <listitem><para>
592 For DTS only, use <option>-ac hwdts</option> 630 For DTS only, use <option>-ac hwdts</option>
593 </para></listitem> 631 </para></listitem>
594 <listitem><para> 632 <listitem><para>
595 For both AC3 and DTS, use <option>-afm hwac3</option> 633 For both AC3 and DTS, use <option>-afm hwac3</option>
596 </para></listitem> 634 </para></listitem>
597 </itemizedlist> 635 </itemizedlist>
598 636
599 <itemizedlist> 637 <itemizedlist>
600 <title>To enable passthrough in the <application>MPlayer</application> 638 <title>To enable passthrough in the <application>MPlayer</application>
601 configuration file: </title> 639 configuration file: </title>
602 <listitem><para> 640 <listitem><para>
603 For AC3 only, use <option>ac=hwac3,</option> 641 For AC3 only, use <option>ac=hwac3,</option>
604 </para></listitem> 642 </para></listitem>
605 <listitem><para> 643 <listitem><para>
606 For DTS only, use <option>ac=hwdts,</option> 644 For DTS only, use <option>ac=hwdts,</option>
607 </para></listitem> 645 </para></listitem>
608 <listitem><para> 646 <listitem><para>
609 For both AC3 and DTS, use <option>afm=hwac3</option> 647 For both AC3 and DTS, use <option>afm=hwac3</option>
610 </para></listitem> 648 </para></listitem>
611 </itemizedlist> 649 </itemizedlist>
612 650
613 <para> 651 <para>
614 Note that there is a comma (",") at the end of 652 Note that there is a comma (",") at the end of
616 <application>MPlayer</application> fall back on the codecs it normally uses when 654 <application>MPlayer</application> fall back on the codecs it normally uses when
617 playing a file that does not have AC3 or DTS audio. <option>afm=hwac3</option> 655 playing a file that does not have AC3 or DTS audio. <option>afm=hwac3</option>
618 does not need a comma; <application>MPlayer</application> will fall back anyway 656 does not need a comma; <application>MPlayer</application> will fall back anyway
619 when an audio family is specified. 657 when an audio family is specified.
620 </para> 658 </para>
621
622 </sect3> 659 </sect3>
660
623 661
624 <sect3 id="hwmpa-surround-passthrough"> 662 <sect3 id="hwmpa-surround-passthrough">
625 <title>MPEG audio Passthrough</title> 663 <title>MPEG audio Passthrough</title>
626 664
627 <para> 665 <para>
637 To use this codec: 675 To use this codec:
638 <screen> mplayer -ac hwmpa </screen> 676 <screen> mplayer -ac hwmpa </screen>
639 </para> 677 </para>
640 </sect3> 678 </sect3>
641 679
680
642 <sect3 id="advaudio-surround-matrix"> 681 <sect3 id="advaudio-surround-matrix">
643 <title>Matrix-encoded audio</title> 682 <title>Matrix-encoded audio</title>
644 683
645 <para> 684 <para>
646 <emphasis>***TODO***</emphasis> 685 <emphasis>***TODO***</emphasis>
647 </para> 686 </para>
687
648 <para> 688 <para>
649 This section has yet to be written and cannot be completed until somebody 689 This section has yet to be written and cannot be completed until somebody
650 provides sample files for us to test. If you have any matrix-encoded audio 690 provides sample files for us to test. If you have any matrix-encoded audio
651 files, know where to find some, or have any information that could be helpful, 691 files, know where to find some, or have any information that could be helpful,
652 please send a message to the 692 please send a message to the
653 <ulink url="http://lists.mplayerhq.hu/mailman/listinfo/mplayer-docs">MPlayer-DOCS</ulink> 693 <ulink url="http://lists.mplayerhq.hu/mailman/listinfo/mplayer-docs">MPlayer-DOCS</ulink>
654 mailing list. Put "[matrix-encoded audio]" in the subject line. 694 mailing list. Put "[matrix-encoded audio]" in the subject line.
655 </para> 695 </para>
696
656 <para> 697 <para>
657 If no files or further information are forthcoming this section will be dropped. 698 If no files or further information are forthcoming this section will be dropped.
658 </para> 699 </para>
659 700
660 <para> 701 <para>
661 Good links: 702 Good links:
662 <itemizedlist> 703 <itemizedlist>
663 <listitem><para> 704 <listitem><para>
664 <ulink url="http://electronics.howstuffworks.com/surround-sound5.htm">http://electronics.howstuffworks.com/surround-sound5.htm</ulink> 705 <ulink url="http://electronics.howstuffworks.com/surround-sound5.htm">http://electronics.howstuffworks.com/surround-sound5.htm</ulink>
665 </para></listitem> 706 </para></listitem>
666 <listitem><para> 707 <listitem><para>
667 <ulink url="http://www.extremetech.com/article2/0,1697,1016875,00.asp">http://www.extremetech.com/article2/0,1697,1016875,00.asp</ulink> 708 <ulink url="http://www.extremetech.com/article2/0,1697,1016875,00.asp">http://www.extremetech.com/article2/0,1697,1016875,00.asp</ulink>
668 </para></listitem> 709 </para></listitem>
669 </itemizedlist> 710 </itemizedlist>
670 </para> 711 </para>
671
672 </sect3> 712 </sect3>
673 713
674 714
675 <sect3 id="advaudio-surround-hrtf"> 715 <sect3 id="advaudio-surround-hrtf">
676 <title>Surround emulation in headphones</title> 716 <title>Surround emulation in headphones</title>
693 trying out. 733 trying out.
694 </para> 734 </para>
695 735
696 <para> 736 <para>
697 To play a DVD with HRTF: 737 To play a DVD with HRTF:
698
699 <screen>mplayer dvd://1 -channels 6 -af hrtf</screen> 738 <screen>mplayer dvd://1 -channels 6 -af hrtf</screen>
700
701 </para> 739 </para>
702 740
703 <para> 741 <para>
704 <option>hrtf</option> only works well with 5 or 6 channels. Also, 742 <option>hrtf</option> only works well with 5 or 6 channels. Also,
705 <option>hrtf</option> requires 48 kHz audio. DVD audio is already 48 kHz, but if 743 <option>hrtf</option> requires 48 kHz audio. DVD audio is already 48 kHz, but if
706 you have a file with a different sampling rate that you want to play using 744 you have a file with a different sampling rate that you want to play using
707 <option>hrtf</option> you must resample it: 745 <option>hrtf</option> you must resample it:
708 746 <screen>
709 <screen>mplayer <replaceable>filename</replaceable> -channels 6 -af resample=48000,hrtf</screen> 747 mplayer <replaceable>filename</replaceable> -channels 6 -af resample=48000,hrtf
710 748 </screen>
711 </para> 749 </para>
712
713 </sect3> 750 </sect3>
714 751
715 752
716 <sect3 id="advaudio-surround-troubleshooting"> 753 <sect3 id="advaudio-surround-troubleshooting">
717 <title>Troubleshooting</title> 754 <title>Troubleshooting</title>
719 <para> 756 <para>
720 If you do not hear any sound out of your surround channels, check your mixer 757 If you do not hear any sound out of your surround channels, check your mixer
721 settings with a mixer program such as <application>alsamixer</application>; 758 settings with a mixer program such as <application>alsamixer</application>;
722 audio outputs are often muted and set to zero volume by default. 759 audio outputs are often muted and set to zero volume by default.
723 </para> 760 </para>
724
725 </sect3> 761 </sect3>
726
727 </sect2> 762 </sect2>
728 763
764 <!-- ********** -->
729 765
730 <sect2 id="advaudio-channels"> 766 <sect2 id="advaudio-channels">
731 <title>Channel manipulation</title> 767 <title>Channel manipulation</title>
732 768
733 <sect3 id="advaudio-channels-general"> 769 <sect3 id="advaudio-channels-general">
738 listed below are those of AC3 and are fairly typical; try them and see if your 774 listed below are those of AC3 and are fairly typical; try them and see if your
739 source matches. Channels are numbered starting with 0. 775 source matches. Channels are numbered starting with 0.
740 776
741 <orderedlist spacing="compact"> 777 <orderedlist spacing="compact">
742 <title>mono</title> 778 <title>mono</title>
743 <listitem override="0"><simpara>center</simpara></listitem> 779 <listitem override="0"><simpara>center</simpara></listitem>
744 </orderedlist> 780 </orderedlist>
745 781
746 <orderedlist spacing="compact"> 782 <orderedlist spacing="compact">
747 <title>stereo</title> 783 <title>stereo</title>
748 <listitem override="0"><simpara>left</simpara></listitem> 784 <listitem override="0"><simpara>left</simpara></listitem>
749 <listitem><simpara>right</simpara></listitem> 785 <listitem><simpara>right</simpara></listitem>
750 </orderedlist> 786 </orderedlist>
751 787
752 <orderedlist spacing="compact"> 788 <orderedlist spacing="compact">
753 <title>quadraphonic</title> 789 <title>quadraphonic</title>
754 <listitem override="0"><simpara>left front</simpara></listitem> 790 <listitem override="0"><simpara>left front</simpara></listitem>
755 <listitem><simpara>right front</simpara></listitem> 791 <listitem><simpara>right front</simpara></listitem>
756 <listitem><simpara>left rear</simpara></listitem> 792 <listitem><simpara>left rear</simpara></listitem>
757 <listitem><simpara>right rear</simpara></listitem> 793 <listitem><simpara>right rear</simpara></listitem>
758 </orderedlist> 794 </orderedlist>
759 795
760 <orderedlist spacing="compact"> 796 <orderedlist spacing="compact">
761 <title>surround 4.0</title> 797 <title>surround 4.0</title>
762 <listitem override="0"><simpara>left front</simpara></listitem> 798 <listitem override="0"><simpara>left front</simpara></listitem>
763 <listitem><simpara>right front</simpara></listitem> 799 <listitem><simpara>right front</simpara></listitem>
764 <listitem><simpara>center rear</simpara></listitem> 800 <listitem><simpara>center rear</simpara></listitem>
765 <listitem><simpara>center front</simpara></listitem> 801 <listitem><simpara>center front</simpara></listitem>
766 </orderedlist> 802 </orderedlist>
767 803
768 <orderedlist spacing="compact"> 804 <orderedlist spacing="compact">
769 <title>surround 5.0</title> 805 <title>surround 5.0</title>
770 <listitem override="0"><simpara>left front</simpara></listitem> 806 <listitem override="0"><simpara>left front</simpara></listitem>
771 <listitem><simpara>right front</simpara></listitem> 807 <listitem><simpara>right front</simpara></listitem>
772 <listitem><simpara>left rear</simpara></listitem> 808 <listitem><simpara>left rear</simpara></listitem>
773 <listitem><simpara>right rear</simpara></listitem> 809 <listitem><simpara>right rear</simpara></listitem>
774 <listitem><simpara>center front</simpara></listitem> 810 <listitem><simpara>center front</simpara></listitem>
775 </orderedlist> 811 </orderedlist>
776 812
777 <orderedlist spacing="compact"> 813 <orderedlist spacing="compact">
778 <title>surround 5.1</title> 814 <title>surround 5.1</title>
779 <listitem override="0"><simpara>left front</simpara></listitem> 815 <listitem override="0"><simpara>left front</simpara></listitem>
780 <listitem><simpara>right front</simpara></listitem> 816 <listitem><simpara>right front</simpara></listitem>
781 <listitem><simpara>left rear</simpara></listitem> 817 <listitem><simpara>left rear</simpara></listitem>
782 <listitem><simpara>right rear</simpara></listitem> 818 <listitem><simpara>right rear</simpara></listitem>
783 <listitem><simpara>center front</simpara></listitem> 819 <listitem><simpara>center front</simpara></listitem>
784 <listitem><simpara>subwoofer</simpara></listitem> 820 <listitem><simpara>subwoofer</simpara></listitem>
785 </orderedlist> 821 </orderedlist>
786
787 </para> 822 </para>
788 823
789 <para> 824 <para>
790 The <option>-channels</option> option is used to request the number of 825 The <option>-channels</option> option is used to request the number of
791 channels from the audio decoder. Some audio codecs use the number of specified 826 channels from the audio decoder. Some audio codecs use the number of specified
798 <para> 833 <para>
799 The <option>channels</option> audio filter can be used to create or remove 834 The <option>channels</option> audio filter can be used to create or remove
800 channels and is useful for controlling the number of channels sent to the sound 835 channels and is useful for controlling the number of channels sent to the sound
801 card. See the following sections for more information on channel manipulation. 836 card. See the following sections for more information on channel manipulation.
802 </para> 837 </para>
803
804 </sect3> 838 </sect3>
805 839
806 840
807 <sect3 id="advaudio-channels-mono"> 841 <sect3 id="advaudio-channels-mono">
808 <title>Playing mono with two speakers</title> 842 <title>Playing mono with two speakers</title>
812 using headphones. Audio files that truly have one channel are automatically 846 using headphones. Audio files that truly have one channel are automatically
813 played through two speakers; unfortunately, most files with mono sound are 847 played through two speakers; unfortunately, most files with mono sound are
814 actually encoded as stereo with one channel silent. The easiest and most 848 actually encoded as stereo with one channel silent. The easiest and most
815 foolproof way to make both speakers output the same audio is the 849 foolproof way to make both speakers output the same audio is the
816 <option>extrastereo</option> filter: 850 <option>extrastereo</option> filter:
817
818 <screen>mplayer <replaceable>filename</replaceable> -af extrastereo=0</screen> 851 <screen>mplayer <replaceable>filename</replaceable> -af extrastereo=0</screen>
819
820 </para> 852 </para>
821 853
822 <para> 854 <para>
823 This averages both channels, resulting in both channels being half as loud as 855 This averages both channels, resulting in both channels being half as loud as
824 the original. The next sections have examples of other ways to do this without a 856 the original. The next sections have examples of other ways to do this without a
825 volume decrease, but they are more complex and require different options 857 volume decrease, but they are more complex and require different options
826 depending on which channel to keep. If you really need to maintain the volume, 858 depending on which channel to keep. If you really need to maintain the volume,
827 it may be easier to experiment with the <option>volume</option> filter and find 859 it may be easier to experiment with the <option>volume</option> filter and find
828 the right value. For example: 860 the right value. For example:
829 861 <screen>
830 <screen>mplayer <replaceable>filename</replaceable> -af extrastereo=0,volume=5</screen> 862 mplayer <replaceable>filename</replaceable> -af extrastereo=0,volume=5
831 863 </screen>
832 </para> 864 </para>
833
834 </sect3> 865 </sect3>
835 866
836 867
837 <sect3 id="advaudio-channels-copying"> 868 <sect3 id="advaudio-channels-copying">
838 <title>Channel copying/moving</title> 869 <title>Channel copying/moving</title>
842 Setting up all the suboptions for the <option>channels</option> 873 Setting up all the suboptions for the <option>channels</option>
843 filter can be complicated and takes a little care. 874 filter can be complicated and takes a little care.
844 875
845 <orderedlist spacing="compact"> 876 <orderedlist spacing="compact">
846 <listitem><para> 877 <listitem><para>
847 Decide how many output channels you need. This is the first suboption. 878 Decide how many output channels you need. This is the first suboption.
848 </para></listitem> 879 </para></listitem>
849 <listitem><para> 880 <listitem><para>
850 Count how many channel moves you will do. This is the second suboption. Each 881 Count how many channel moves you will do. This is the second suboption. Each
851 channel can be moved to several different channels at the same time, but keep in 882 channel can be moved to several different channels at the same time, but keep
852 mind that when a channel is moved (even if to only one destination) the source 883 in mind that when a channel is moved (even if to only one destination) the
853 channel will be empty unless another channel is moved into it. To copy a 884 source channel will be empty unless another channel is moved into it. To copy
854 channel, keeping the source the same, simply move the channel into both the 885 a channel, keeping the source the same, simply move the channel into both the
855 destination and the source. For example: 886 destination and the source. For example:
856 <programlisting> 887 <programlisting>
857 channel 2 --> channel 3 888 channel 2 --> channel 3
858 channel 2 --> channel 2 889 channel 2 --> channel 2<!--
859 </programlisting> 890 --></programlisting>
860 </para></listitem> 891 </para></listitem>
861 <listitem><para> 892 <listitem><para>
862 Write out the channel copies as pairs of suboptions. Note that the first channel 893 Write out the channel copies as pairs of suboptions. Note that the first
863 is 0, the second is 1, etc. The order of these suboptions does not matter as 894 channel is 0, the second is 1, etc. The order of these suboptions does not
864 long as they are properly grouped into 895 matter as long as they are properly grouped into
865 <replaceable>source:destination</replaceable> pairs. 896 <replaceable>source:destination</replaceable> pairs.
866 </para></listitem> 897 </para></listitem>
867 </orderedlist> 898 </orderedlist>
868 899 </para>
869 </para>
870
871 900
872 <bridgehead>Example: one channel in two speakers</bridgehead> 901 <bridgehead>Example: one channel in two speakers</bridgehead>
873
874 <para> 902 <para>
875 Here is an example of another way to play one channel in both speakers. Suppose 903 Here is an example of another way to play one channel in both speakers. Suppose
876 for this example that the left channel should be played and the right channel 904 for this example that the left channel should be played and the right channel
877 discarded. Following the steps above: 905 discarded. Following the steps above:
878 <orderedlist> 906 <orderedlist>
879 <listitem><para> 907 <listitem><para>
880 In order to provide an output channel for each of the two speakers, the first 908 In order to provide an output channel for each of the two speakers, the first
881 suboption must be "2". 909 suboption must be "2".
882 </para></listitem> 910 </para></listitem>
883 <listitem><para> 911 <listitem><para>
884 The left channel needs to be moved to the right channel, and also must be moved 912 The left channel needs to be moved to the right channel, and also must be
885 to itself so it won't be empty. This is a total of two moves, making the second 913 moved to itself so it won't be empty. This is a total of two moves, making
886 suboption "2" as well. 914 the second suboption "2" as well.
887 </para></listitem> 915 </para></listitem>
888 <listitem><para> 916 <listitem><para>
889 To move the left channel (channel 0) into the right channel (channel 1), the 917 To move the left channel (channel 0) into the right channel (channel 1), the
890 suboption pair is "0:1", "0:0" moves the left channel onto itself. 918 suboption pair is "0:1", "0:0" moves the left channel onto itself.
891 </para></listitem> 919 </para></listitem>
892 </orderedlist> 920 </orderedlist>
893 Putting that all together gives: 921 Putting that all together gives:
894 922 <screen>
895 <screen>mplayer <replaceable>filename</replaceable> -af channels=2:2:0:1:0:0</screen> 923 mplayer <replaceable>filename</replaceable> -af channels=2:2:0:1:0:0
924 </screen>
896 </para> 925 </para>
897 926
898 <para> 927 <para>
899 The advantage this example has over <option>extrastereo</option> is that the 928 The advantage this example has over <option>extrastereo</option> is that the
900 volume of each output channel is the same as the input channel. The disadvantage 929 volume of each output channel is the same as the input channel. The disadvantage
901 is that the suboptions must be changed to "2:2:1:0:1:1" when the desired audio 930 is that the suboptions must be changed to "2:2:1:0:1:1" when the desired audio
902 is in the right channel. Also, it is more difficult to remember and type. 931 is in the right channel. Also, it is more difficult to remember and type.
903 </para> 932 </para>
904 933
905 <bridgehead>Example: left channel in two speakers shortcut</bridgehead> 934 <bridgehead>Example: left channel in two speakers shortcut</bridgehead>
906
907 <para> 935 <para>
908 There is actually a much easier way to use the <option>channels</option> filter 936 There is actually a much easier way to use the <option>channels</option> filter
909 for playing the left channel in both speakers: 937 for playing the left channel in both speakers:
910
911 <screen>mplayer <replaceable>filename</replaceable> -af channels=1</screen> 938 <screen>mplayer <replaceable>filename</replaceable> -af channels=1</screen>
912
913 The second channel is discarded and, with no further suboptions, the single 939 The second channel is discarded and, with no further suboptions, the single
914 remaining channel is left alone. Sound card drivers automatically play 940 remaining channel is left alone. Sound card drivers automatically play
915 single-channel audio in both speakers. This only works when the desired channel 941 single-channel audio in both speakers. This only works when the desired channel
916 is on the left. 942 is on the left.
917 </para> 943 </para>
920 <para> 946 <para>
921 Another common operation is to duplicate the front channels and play them back 947 Another common operation is to duplicate the front channels and play them back
922 on the rear speakers of a quadraphonic setup. 948 on the rear speakers of a quadraphonic setup.
923 <orderedlist> 949 <orderedlist>
924 <listitem><para> 950 <listitem><para>
925 There should be four output channels. The first suboption is "4". 951 There should be four output channels. The first suboption is "4".
926 </para></listitem> 952 </para></listitem>
927 <listitem><para> 953 <listitem><para>
928 Each of the two front channels needs to be moved to the corresponding rear 954 Each of the two front channels needs to be moved to the corresponding rear
929 channel and also to itself. This is four moves, so the second suboption is "4". 955 channel and also to itself. This is four moves, so the second suboption is "4".
930 </para></listitem> 956 </para></listitem>
931 <listitem><para> 957 <listitem><para>
932 The left front (channel 0) needs to moved to the left rear (channel 2): "0:2". 958 The left front (channel 0) needs to moved to the left rear (channel 2):
933 The left front also needs to be moved to itself: "0:0". The right front (channel 959 "0:2". The left front also needs to be moved to itself: "0:0". The right
934 1) is moved to the right rear (channel 3): "1:3", and also to itself: "1:1". 960 front (channel 1) is moved to the right rear (channel 3): "1:3", and also to
961 itself: "1:1".
935 </para></listitem> 962 </para></listitem>
936 </orderedlist> 963 </orderedlist>
937 Combine all the suboptions to get: 964 Combine all the suboptions to get:
938 965 <screen>
939 <screen>mplayer <replaceable>filename</replaceable> -af channels=4:4:0:2:0:0:1:3:1:1</screen> 966 mplayer <replaceable>filename</replaceable> -af channels=4:4:0:2:0:0:1:3:1:1
940 967 </screen>
941 </para> 968 </para>
942
943 </sect3> 969 </sect3>
944 970
945 971
946 <sect3 id="advaudio-channels-mixing"> 972 <sect3 id="advaudio-channels-mixing">
947 <title>Channel mixing</title> 973 <title>Channel mixing</title>
950 The <option>pan</option> filter can mix channels in user-specified proportions. 976 The <option>pan</option> filter can mix channels in user-specified proportions.
951 This allows for everything the <option>channels</option> filter can do and 977 This allows for everything the <option>channels</option> filter can do and
952 more. Unfortunately, the suboptions are much more complicated. 978 more. Unfortunately, the suboptions are much more complicated.
953 <orderedlist> 979 <orderedlist>
954 <listitem><para> 980 <listitem><para>
955 Decide how many channels to work with. You may need to specify this with 981 Decide how many channels to work with. You may need to specify this with
956 <option>-channels</option> and/or <option>-af channels</option>. Later examples 982 <option>-channels</option> and/or <option>-af channels</option>.
957 will show when to use which. 983 Later examples will show when to use which.
958 </para></listitem> 984 </para></listitem>
959 <listitem><para> 985 <listitem><para>
960 Decide how many channels to feed into <option>pan</option> (further decoded 986 Decide how many channels to feed into <option>pan</option> (further decoded
961 channels are discarded). This is the first suboption, and it also controls how 987 channels are discarded). This is the first suboption, and it also controls how
962 many channels to employ for output. 988 many channels to employ for output.
963 </para></listitem> 989 </para></listitem>
964 <listitem><para> 990 <listitem>
965 The remaining suboptions specify how much of each channel gets mixed into each 991 <para>
966 other channel. This is the complicated part. To break the task down, split the 992 The remaining suboptions specify how much of each channel gets mixed into each
967 suboptions into several sets, one set for each output channel. Each suboption 993 other channel. This is the complicated part. To break the task down, split the
968 within a set corresponds to an input channel. The number you specify will be the 994 suboptions into several sets, one set for each output channel. Each suboption
969 percentage of the input channel that gets mixed into the output channel. 995 within a set corresponds to an input channel. The number you specify will be
970 </para> 996 the percentage of the input channel that gets mixed into the output channel.
971 <para> 997 </para>
972 <option>pan</option> accepts values from 0 to 512, yielding 0% to 51200% of the 998 <para>
973 original volume. Be careful when using values greater than 1. Not only can this 999 <option>pan</option> accepts values from 0 to 512, yielding 0% to 51200% of
974 give you very high volume, but if you exceed the sample range of your sound card 1000 the original volume. Be careful when using values greater than 1. Not only
975 you may hear painful pops and clicks. If you want you can follow 1001 can this give you very high volume, but if you exceed the sample range of
976 <option>pan</option> with <option>,volume</option> to enable clipping, but it is 1002 your sound card you may hear painful pops and clicks. If you want you can
977 best to keep the values of <option>pan</option> low enough that clipping is not 1003 follow <option>pan</option> with <option>,volume</option> to enable clipping,
978 necessary. 1004 but it is best to keep the values of <option>pan</option> low enough that
979 </para></listitem> 1005 clipping is not necessary.
1006 </para>
1007 </listitem>
980 </orderedlist> 1008 </orderedlist>
981 </para> 1009 </para>
982 1010
983 <bridgehead>Example: one channel in two speakers</bridgehead> 1011 <bridgehead>Example: one channel in two speakers</bridgehead>
984
985 <para> 1012 <para>
986 Here is yet another example for playing the left channel in two speakers. Follow 1013 Here is yet another example for playing the left channel in two speakers. Follow
987 the steps above: 1014 the steps above:
988 <orderedlist> 1015 <orderedlist>
989 <listitem><para> 1016 <listitem><para>
990 <option>pan</option> should output two channels, so the first 1017 <option>pan</option> should output two channels, so the first
991 suboption is "2". 1018 suboption is "2".
992 </para></listitem> 1019 </para></listitem>
993 <listitem><para> 1020 <listitem><para>
994 Since we have two input channels, there will be two sets of suboptions. 1021 Since we have two input channels, there will be two sets of suboptions.
995 Since there are also two output channels, 1022 Since there are also two output channels,
996 there will be two suboptions per set. 1023 there will be two suboptions per set.
997 The left channel from the file should go with full volume to 1024 The left channel from the file should go with full volume to
998 the new left and the right channels. 1025 the new left and the right channels.
999 Thus the first set of suboptions is "1:1". 1026 Thus the first set of suboptions is "1:1".
1000 The right channel should be discarded, so the second would be "0:0". 1027 The right channel should be discarded, so the second would be "0:0".
1001 Any 0 values at the end can be left out, but for ease of 1028 Any 0 values at the end can be left out, but for ease of
1002 understanding we will keep them. 1029 understanding we will keep them.
1003 </para></listitem> 1030 </para></listitem>
1004 </orderedlist> 1031 </orderedlist>
1005 Putting those options together gives: 1032 Putting those options together gives:
1006
1007 <screen>mplayer <replaceable>filename</replaceable> -af pan=2:1:1:0:0</screen> 1033 <screen>mplayer <replaceable>filename</replaceable> -af pan=2:1:1:0:0</screen>
1008
1009 If the right channel is desired instead of the left, the suboptions to 1034 If the right channel is desired instead of the left, the suboptions to
1010 <option>pan</option> will be "2:0:0:1:1". 1035 <option>pan</option> will be "2:0:0:1:1".
1011 </para> 1036 </para>
1012 1037
1013 1038
1014 <bridgehead>Example: left channel in two speakers shortcut</bridgehead> 1039 <bridgehead>Example: left channel in two speakers shortcut</bridgehead>
1015
1016 <para> 1040 <para>
1017 As with <option>channels</option>, there is a shortcut that only works with the 1041 As with <option>channels</option>, there is a shortcut that only works with the
1018 left channel: 1042 left channel:
1019
1020 <screen>mplayer <replaceable>filename</replaceable> -af pan=1:1</screen> 1043 <screen>mplayer <replaceable>filename</replaceable> -af pan=1:1</screen>
1021
1022 Since <option>pan</option> has only one channel of input (the other channel is 1044 Since <option>pan</option> has only one channel of input (the other channel is
1023 discarded), there is only one set with one suboption, which specifies that the 1045 discarded), there is only one set with one suboption, which specifies that the
1024 only channel gets 100% of itself. 1046 only channel gets 100% of itself.
1025 </para> 1047 </para>
1026 1048
1028 <para> 1050 <para>
1029 <application>MPlayer</application>'s decoder for 6-channel PCM is not capable of 1051 <application>MPlayer</application>'s decoder for 6-channel PCM is not capable of
1030 downmixing. Here is a way to downmix PCM using <option>pan</option>: 1052 downmixing. Here is a way to downmix PCM using <option>pan</option>:
1031 <orderedlist> 1053 <orderedlist>
1032 <listitem><para> 1054 <listitem><para>
1033 The number of output channels is 2, so the first suboption is "2". 1055 The number of output channels is 2, so the first suboption is "2".
1034 </para></listitem> 1056 </para></listitem>
1035 <listitem><para> 1057 <listitem><para>
1036 With six input channels there will be six sets of options. Fortunately, 1058 With six input channels there will be six sets of options. Fortunately,
1037 since we only care about the output of the first two channels, we only need to 1059 since we only care about the output of the first two channels, we only need to
1038 make two sets; the remaining four sets can be omitted. Beware that not all 1060 make two sets; the remaining four sets can be omitted. Beware that not all
1039 multichannel audio files have the same channel order! This example 1061 multichannel audio files have the same channel order! This example
1040 demonstrates downmixing a file with the same channels as AC3 5.1: 1062 demonstrates downmixing a file with the same channels as AC3 5.1:
1041 <programlisting> 1063 <programlisting>
1042 0 - front left 1064 0 - front left
1043 1 - front right 1065 1 - front right
1044 2 - rear left 1066 2 - rear left
1045 3 - rear right 1067 3 - rear right
1046 4 - center front 1068 4 - center front
1047 5 - subwoofer 1069 5 - subwoofer<!--
1048 </programlisting> 1070 --></programlisting>
1049 The first set of suboptions lists the percentages of the original volume, in 1071 The first set of suboptions lists the percentages of the original volume, in
1050 order, which each output channel should receive from the 1072 order, which each output channel should receive from the
1051 front left channel: "1:0". 1073 front left channel: "1:0".
1052 The front right channel should go into the right output: "0:1". 1074 The front right channel should go into the right output: "0:1".
1053 The same for the rear channels: "1:0" and "0:1". 1075 The same for the rear channels: "1:0" and "0:1".
1054 The center channel goes into both output channels with half volume: 1076 The center channel goes into both output channels with half volume:
1055 "0.5:0.5", and the subwoofer goes into both with full volume: "1:1". 1077 "0.5:0.5", and the subwoofer goes into both with full volume: "1:1".
1056 </para></listitem> 1078 </para></listitem>
1057 </orderedlist> 1079 </orderedlist>
1058 Put all that together, for: 1080 Put all that together, for:
1059 1081 <screen>
1060 <screen>mplayer <replaceable>6-channel.wav</replaceable> -af pan=2:1:0:0:1:1:0:0:1:0.5:0.5:1:1</screen> 1082 mplayer <replaceable>6-channel.wav</replaceable> -af pan=2:1:0:0:1:1:0:0:1:0.5:0.5:1:1
1061 1083 </screen>
1062 The percentages listed above are only a rough example. Feel free to tweak them. 1084 The percentages listed above are only a rough example. Feel free to tweak them.
1063 </para> 1085 </para>
1064 1086
1065 <bridgehead>Example: Playing 5.1 audio on big speakers without a subwoofer</bridgehead> 1087 <bridgehead>Example: Playing 5.1 audio on big speakers without a subwoofer</bridgehead>
1066
1067 <para> 1088 <para>
1068 If you have a huge pair of front speakers you may not want to waste any money on 1089 If you have a huge pair of front speakers you may not want to waste any money on
1069 buying a subwoofer for a complete 5.1 sound system. If you use 1090 buying a subwoofer for a complete 5.1 sound system. If you use
1070 <option>-channels 5</option> to request that liba52 decode 5.1 audio in 5.0, 1091 <option>-channels 5</option> to request that liba52 decode 5.1 audio in 5.0,
1071 the subwoofer channel is simply discarded. If you want to distribute the 1092 the subwoofer channel is simply discarded. If you want to distribute the
1072 subwoofer channel yourself you need to downmix manually with 1093 subwoofer channel yourself you need to downmix manually with
1073 <option>pan</option>: 1094 <option>pan</option>:
1074
1075 <orderedlist> 1095 <orderedlist>
1076 <listitem><para> 1096 <listitem><para>
1077 Since <option>pan</option> needs to examine all six channels, specify 1097 Since <option>pan</option> needs to examine all six channels, specify
1078 <option>-channels 6</option> so liba52 decodes them all. 1098 <option>-channels 6</option> so liba52 decodes them all.
1079 </para></listitem> 1099 </para></listitem>
1080 <listitem><para> 1100 <listitem><para>
1081 <option>pan</option> outputs to only five channels, the first suboption is 5. 1101 <option>pan</option> outputs to only five channels, the first suboption is 5.
1082 </para></listitem> 1102 </para></listitem>
1083 <listitem><para> 1103 <listitem><para>
1084 Six input channels and five output channels means six sets of five suboptions. 1104 Six input channels and five output channels means six sets of five suboptions.
1085 <itemizedlist spacing="compact"> 1105 <itemizedlist spacing="compact">
1086 <listitem><simpara> 1106 <listitem><simpara>
1087 The left front channel only replicates onto itself: 1107 The left front channel only replicates onto itself:
1088 "1:0:0:0:0" 1108 "1:0:0:0:0"
1089 </simpara></listitem> 1109 </simpara></listitem>
1090 <listitem><simpara> 1110 <listitem><simpara>
1091 Same for the right front channel: 1111 Same for the right front channel:
1092 "0:1:0:0:0" 1112 "0:1:0:0:0"
1093 </simpara></listitem> 1113 </simpara></listitem>
1094 <listitem><simpara> 1114 <listitem><simpara>
1095 Same for the left rear channel: 1115 Same for the left rear channel:
1096 "0:0:1:0:0" 1116 "0:0:1:0:0"
1097 </simpara></listitem> 1117 </simpara></listitem>
1098 <listitem><simpara> 1118 <listitem><simpara>
1099 And also the same for the right rear channel: 1119 And also the same for the right rear channel:
1100 "0:0:0:1:0" 1120 "0:0:0:1:0"
1101 </simpara></listitem> 1121 </simpara></listitem>
1102 <listitem><simpara> 1122 <listitem><simpara>
1103 Center front, too: 1123 Center front, too:
1104 "0:0:0:0:1" 1124 "0:0:0:0:1"
1105 </simpara></listitem> 1125 </simpara></listitem>
1106 <listitem><simpara> 1126 <listitem><simpara>
1107 And now we have to decide what to do with the subwoofer, 1127 And now we have to decide what to do with the subwoofer,
1108 e.g. half into front right and front left: 1128 e.g. half into front right and front left:
1109 "0.5:0.5:0:0:0" 1129 "0.5:0.5:0:0:0"
1110 </simpara></listitem> 1130 </simpara></listitem>
1111 </itemizedlist> 1131 </itemizedlist>
1112 </para></listitem> 1132 </para></listitem>
1113 </orderedlist> 1133 </orderedlist>
1114 Combine all those options to get: 1134 Combine all those options to get:
1115 1135 <screen>
1116 <screen>mplayer <replaceable>dvd://1</replaceable> -channels 6 -af pan=5:1:0:0:0:0:0:1:0:0:0:0:0:1:0:0:0:0:0:1:0:0:0:0:0:1:0.5:0.5:0:0:0</screen> 1136 mplayer <replaceable>dvd://1</replaceable> -channels 6 -af pan=5:1:0:0:0:0:0:1:0:0:0:0:0:1:0:0:0:0:0:1:0:0:0:0:0:1:0.5:0.5:0:0:0
1117 1137 </screen>
1118 </para> 1138 </para>
1119
1120 </sect3> 1139 </sect3>
1121
1122 </sect2> 1140 </sect2>
1123 1141
1142 <!-- ********** -->
1124 1143
1125 <sect2 id="advaudio-volume"> 1144 <sect2 id="advaudio-volume">
1126 <title>Software Volume adjustment</title> 1145 <title>Software Volume adjustment</title>
1127 1146
1128 <para> 1147 <para>
1132 <application>MPlayer</application> to use an internal mixer. You can then use 1151 <application>MPlayer</application> to use an internal mixer. You can then use
1133 the volume adjustment keys (by default <keycap>9</keycap> and 1152 the volume adjustment keys (by default <keycap>9</keycap> and
1134 <keycap>0</keycap>) to reach much higher volume levels. Note that this does not 1153 <keycap>0</keycap>) to reach much higher volume levels. Note that this does not
1135 bypass your sound card's mixer; <application>MPlayer</application> only 1154 bypass your sound card's mixer; <application>MPlayer</application> only
1136 amplifies the signal before sending it to your sound card. 1155 amplifies the signal before sending it to your sound card.
1137
1138 The following example is a good start: 1156 The following example is a good start:
1139 1157 <screen>
1140 <screen>mplayer <replaceable>quiet-file</replaceable> -softvol -softvol-max 300</screen> 1158 mplayer <replaceable>quiet-file</replaceable> -softvol -softvol-max 300
1141 1159 </screen>
1142 The <option>-softvol-max</option> option specifies the maximum allowable output 1160 The <option>-softvol-max</option> option specifies the maximum allowable output
1143 volume as a percentage of the 1161 volume as a percentage of the
1144 original volume. For example, <option>-softvol-max 200</option> would allow the 1162 original volume. For example, <option>-softvol-max 200</option> would allow the
1145 volume to be adjusted up to twice its original level. 1163 volume to be adjusted up to twice its original level.
1146 It is safe to specify a large value with 1164 It is safe to specify a large value with
1154 1172
1155 <para> 1173 <para>
1156 The <option>-softvol</option> option works by controlling the 1174 The <option>-softvol</option> option works by controlling the
1157 <option>volume</option> audio filter. If you want to play a file at a certain 1175 <option>volume</option> audio filter. If you want to play a file at a certain
1158 volume from the beginning you can specify <option>volume</option> manually: 1176 volume from the beginning you can specify <option>volume</option> manually:
1159
1160 <screen>mplayer <replaceable>quiet-file</replaceable> -af volume=10</screen> 1177 <screen>mplayer <replaceable>quiet-file</replaceable> -af volume=10</screen>
1161
1162 This will play the file with a ten decibel gain. Be careful when using the 1178 This will play the file with a ten decibel gain. Be careful when using the
1163 <option>volume</option> filter - you could easily hurt your ears if you use 1179 <option>volume</option> filter - you could easily hurt your ears if you use
1164 too high a value. Start low and work your way up gradually until you get a feel 1180 too high a value. Start low and work your way up gradually until you get a feel
1165 for how much adjustment is required. Also, if you specify excessively high 1181 for how much adjustment is required. Also, if you specify excessively high
1166 values, <option>volume</option> may need to clip the signal to avoid sending your 1182 values, <option>volume</option> may need to clip the signal to avoid sending
1167 sound card data that is outside the allowable range; this will result in 1183 your sound card data that is outside the allowable range; this will result in
1168 distorted audio. 1184 distorted audio.
1169 </para> 1185 </para>
1170
1171 </sect2> 1186 </sect2>
1172
1173 </sect1> 1187 </sect1>
1174
1175 </chapter> 1188 </chapter>