2003-03-23 23:35:12 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2003-09-21 13:05:42 +00:00
|
|
|
<!-- $Revision$ -->
|
2003-03-23 23:35:12 +00:00
|
|
|
<chapter id="usage">
|
|
|
|
<title>Usage</title>
|
|
|
|
|
|
|
|
<sect1 id="commandline">
|
|
|
|
<title>Command line</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<application>MPlayer</application> utilizes a complex playtree. It consists
|
|
|
|
of global options written as first, for example
|
|
|
|
|
|
|
|
<screen>mplayer -vfm 5</screen>
|
|
|
|
|
|
|
|
and options written after filenames, that apply only to the given
|
|
|
|
filename/URL/whatever, for example:
|
|
|
|
|
2004-01-03 17:20:46 +00:00
|
|
|
<screen>mplayer -vfm 5 <replaceable>movie1.avi</replaceable> <replaceable>movie2.avi</replaceable> -vfm 4</screen>
|
2003-03-23 23:35:12 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
You can group filenames/URLs together using <literal>{</literal> and
|
2005-09-06 16:36:26 +00:00
|
|
|
<literal>}</literal>. It is useful with option <option>-loop</option>:
|
2003-03-23 23:35:12 +00:00
|
|
|
|
2003-08-17 14:09:27 +00:00
|
|
|
<screen>mplayer { 1.avi -loop 2 2.avi } -loop 3</screen>
|
2003-03-23 23:35:12 +00:00
|
|
|
|
|
|
|
The above command will play files in this order: 1, 1, 2, 1, 1, 2, 1, 1, 2.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Playing a file:
|
|
|
|
<synopsis>
|
|
|
|
<command>mplayer</command><!--
|
|
|
|
--> [<replaceable>options</replaceable>]<!--
|
|
|
|
--> [<replaceable>path</replaceable>/]<replaceable>filename</replaceable>
|
|
|
|
</synopsis>
|
|
|
|
</para>
|
|
|
|
|
2005-05-14 13:13:58 +00:00
|
|
|
<para>
|
|
|
|
Another way to play a file:
|
|
|
|
<synopsis>
|
|
|
|
<command>mplayer</command><!--
|
|
|
|
--> [<replaceable>options</replaceable>]<!--
|
|
|
|
--> <replaceable>file:///uri-escaped-path</replaceable>
|
|
|
|
</synopsis>
|
|
|
|
</para>
|
|
|
|
|
2003-03-23 23:35:12 +00:00
|
|
|
<para>
|
|
|
|
Playing more files:
|
|
|
|
<synopsis>
|
|
|
|
<command>mplayer</command><!--
|
|
|
|
--> [<replaceable>default options</replaceable>]<!--
|
|
|
|
--> [<replaceable>path</replaceable>/]<replaceable>filename1</replaceable><!--
|
|
|
|
--> [<replaceable>options for filename1</replaceable>]<!--
|
|
|
|
--> <replaceable>filename2</replaceable><!--
|
|
|
|
--> [<replaceable>options for filename2</replaceable>] ...
|
|
|
|
</synopsis>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Playing VCD:
|
|
|
|
<synopsis>
|
|
|
|
<command>mplayer</command> [<replaceable>options</replaceable>]<!--
|
2003-05-25 19:15:01 +00:00
|
|
|
--> vcd://<replaceable>trackno</replaceable><!--
|
2003-03-23 23:35:12 +00:00
|
|
|
--> [-cdrom-device <replaceable>/dev/cdrom</replaceable>]
|
|
|
|
</synopsis>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Playing DVD:
|
|
|
|
<synopsis>
|
|
|
|
<command>mplayer</command> [<replaceable>options</replaceable>]<!--
|
2003-05-25 19:15:01 +00:00
|
|
|
--> dvd://<replaceable>titleno</replaceable><!--
|
2003-03-23 23:35:12 +00:00
|
|
|
--> [-dvd-device <replaceable>/dev/dvd</replaceable>]
|
|
|
|
</synopsis>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Playing from the WWW:
|
|
|
|
<synopsis>
|
|
|
|
<command>mplayer</command> [<replaceable>options</replaceable>]<!--
|
|
|
|
--> http://<replaceable>site.com/file.asf</replaceable>
|
|
|
|
</synopsis>
|
|
|
|
(playlists can be used, too)
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Playing from RTSP:
|
|
|
|
<synopsis>
|
|
|
|
<command>mplayer</command> [<replaceable>options</replaceable>]<!--
|
|
|
|
--> rtsp://<replaceable>server.example.com/streamName</replaceable>
|
|
|
|
</synopsis>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Examples:
|
|
|
|
<screen>
|
2004-01-01 17:44:41 +00:00
|
|
|
mplayer -vo x11 <replaceable>/mnt/Films/Contact/contact2.mpg</replaceable>
|
2004-07-16 17:14:57 +00:00
|
|
|
mplayer vcd://<replaceable>2</replaceable> -cdrom-device <replaceable>/dev/hdc</replaceable>
|
2004-01-01 17:44:41 +00:00
|
|
|
mplayer -afm 3 <replaceable>/mnt/DVDtrailers/alien4.vob</replaceable>
|
|
|
|
mplayer dvd://<replaceable>1</replaceable> -dvd-device <replaceable>/dev/hdc</replaceable>
|
|
|
|
mplayer -abs 65536 -delay -0.4 -nobps <replaceable>~/movies/test.avi</replaceable><!--
|
2003-03-23 23:35:12 +00:00
|
|
|
--></screen>
|
|
|
|
</para>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="control">
|
|
|
|
<title>Control</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<application>MPlayer</application> has a fully configurable, command
|
|
|
|
driven, control layer which lets you control
|
|
|
|
<application>MPlayer</application> with keyboard, mouse, joystick or remote
|
|
|
|
control (using LIRC). See the man page for the complete list of keyboard controls.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<sect2 id="ctrl-cfg">
|
|
|
|
<title>Controls configuration</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<application>MPlayer</application> allows you bind any key/button to any
|
2003-11-30 13:07:40 +00:00
|
|
|
<application>MPlayer</application> command using a simple config file.
|
|
|
|
The syntax consist of a key name followed by a command. The default config file location is
|
2003-03-23 23:35:12 +00:00
|
|
|
<filename>$HOME/.mplayer/input.conf</filename> but it can be overridden
|
|
|
|
using the <option>-input <replaceable>conf</replaceable></option> option
|
|
|
|
(relative path are relative to <filename>$HOME/.mplayer</filename>).
|
|
|
|
</para>
|
|
|
|
|
2004-10-21 11:17:42 +00:00
|
|
|
<para>
|
|
|
|
You can get a full list of supported key names by running
|
|
|
|
<command>mplayer -input keylist</command>
|
|
|
|
and a full list of available commands by running
|
|
|
|
<command>mplayer -input cmdlist</command>.
|
|
|
|
</para>
|
|
|
|
|
2003-03-23 23:35:12 +00:00
|
|
|
<example>
|
|
|
|
<title>A simple input control file</title>
|
|
|
|
<programlisting>
|
|
|
|
##
|
|
|
|
## MPlayer input control file
|
|
|
|
##
|
|
|
|
|
|
|
|
RIGHT seek +10
|
|
|
|
LEFT seek -10
|
|
|
|
- audio_delay 0.100
|
|
|
|
+ audio_delay -0.100
|
|
|
|
q quit
|
|
|
|
> pt_step 1
|
|
|
|
< pt_step -1
|
|
|
|
ENTER pt_step 1 1<!--
|
|
|
|
--></programlisting>
|
|
|
|
</example>
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
|
|
<sect2 id="lirc">
|
|
|
|
<title>Control from LIRC</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Linux Infrared Remote Control - use an easy to build home-brewn IR-receiver,
|
2004-11-05 10:14:39 +00:00
|
|
|
an (almost) arbitrary remote control and control your Linux box with it!
|
|
|
|
More about it on the <ulink url="http://www.lirc.org">LIRC homepage</ulink>.
|
2003-03-23 23:35:12 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2004-11-05 10:14:39 +00:00
|
|
|
If you have the LIRC package installed, <filename>configure</filename> will
|
|
|
|
autodetect it. If everything went fine, <application>MPlayer</application>
|
|
|
|
will print "<systemitem>Setting up LIRC support...</systemitem>"
|
|
|
|
on startup. If an error occurs it will tell you. If there is no message about
|
|
|
|
LIRC there is no support compiled in. That's it :-)
|
2003-03-23 23:35:12 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2004-11-05 10:14:39 +00:00
|
|
|
The application name for <application>MPlayer</application> is - surprise -
|
|
|
|
<filename>mplayer</filename>. You can use any <application>MPlayer</application>
|
|
|
|
commands and even pass more than one command by separating them with
|
|
|
|
<literal>\n</literal>.
|
2005-09-06 16:36:26 +00:00
|
|
|
Do not forget to enable the repeat flag in <filename>.lircrc</filename> when
|
|
|
|
it makes sense (seek, volume, etc). Here is an excerpt from a sample
|
2003-03-23 23:35:12 +00:00
|
|
|
<filename>.lircrc</filename>:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<programlisting>
|
|
|
|
begin
|
|
|
|
button = VOLUME_PLUS
|
|
|
|
prog = mplayer
|
|
|
|
config = volume 1
|
|
|
|
repeat = 1
|
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
|
|
|
button = VOLUME_MINUS
|
|
|
|
prog = mplayer
|
|
|
|
config = volume -1
|
|
|
|
repeat = 1
|
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
|
|
|
button = CD_PLAY
|
|
|
|
prog = mplayer
|
|
|
|
config = pause
|
|
|
|
end
|
|
|
|
|
|
|
|
begin
|
|
|
|
button = CD_STOP
|
|
|
|
prog = mplayer
|
|
|
|
config = seek 0 1\npause
|
|
|
|
end<!--
|
|
|
|
--></programlisting>
|
|
|
|
|
|
|
|
<para>
|
2005-09-06 16:36:26 +00:00
|
|
|
If you do not like the standard location for the lirc-config file
|
2003-03-23 23:35:12 +00:00
|
|
|
(<filename>~/.lircrc</filename>) use the <option>-lircconf
|
|
|
|
<replaceable>filename</replaceable></option> switch to specify another
|
|
|
|
file.
|
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
|
|
<sect2 id="slave-mode">
|
|
|
|
<title>Slave mode</title>
|
|
|
|
<para>
|
2004-10-21 11:17:42 +00:00
|
|
|
The slave mode allows you to build simple frontends to
|
|
|
|
<application>MPlayer</application>. When run with the
|
|
|
|
<option>-slave</option> option <application>MPlayer</application> will
|
|
|
|
read commands separated by a newline (\n) from stdin.
|
|
|
|
The commands are documented in the
|
|
|
|
<ulink url="../../tech/slave.txt">slave.txt</ulink> file.
|
2003-03-23 23:35:12 +00:00
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
|
|
|
|
<sect1 id="streaming">
|
|
|
|
<title>Streaming from network or pipes</title>
|
|
|
|
|
|
|
|
<para>
|
2004-11-05 10:14:39 +00:00
|
|
|
<application>MPlayer</application> can play files from the network, using the
|
2003-08-31 22:10:52 +00:00
|
|
|
HTTP, FTP, MMS or RTSP/RTP protocol.
|
2003-03-23 23:35:12 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2004-11-05 10:14:39 +00:00
|
|
|
Playing works simply by passing the URL on the command line.
|
|
|
|
<application>MPlayer</application> honors the <envar>http_proxy</envar>
|
|
|
|
environment variable, using a proxy if available. Proxies can also be forced:
|
2004-01-01 17:44:41 +00:00
|
|
|
<screen>mplayer <replaceable>http_proxy://proxy.micorsops.com:3128/http://micorsops.com:80/stream.asf</replaceable></screen>
|
2003-03-23 23:35:12 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<application>MPlayer</application> can read from stdin
|
2004-11-05 10:14:39 +00:00
|
|
|
(<emphasis>not</emphasis> named pipes). This can for example be used to
|
2003-03-23 23:35:12 +00:00
|
|
|
play from FTP:
|
2004-01-01 17:44:41 +00:00
|
|
|
<screen>wget <replaceable>ftp://micorsops.com/something.avi</replaceable> -O - | mplayer -</screen>
|
2003-03-23 23:35:12 +00:00
|
|
|
</para>
|
|
|
|
|
2003-10-07 19:02:14 +00:00
|
|
|
<note><para>
|
2005-09-06 16:36:26 +00:00
|
|
|
It is also recommended to enable <option>-cache</option> when playing
|
2004-11-05 10:14:39 +00:00
|
|
|
from the network:
|
2004-01-01 17:44:41 +00:00
|
|
|
<screen>wget <replaceable>ftp://micorsops.com/something.avi</replaceable> -O - | mplayer -cache 8192 -</screen>
|
2003-10-07 19:02:14 +00:00
|
|
|
</para></note>
|
2005-05-17 21:34:15 +00:00
|
|
|
|
|
|
|
<sect2 id="streaming-save">
|
|
|
|
<title>Saving streamed content</title>
|
|
|
|
<para>
|
|
|
|
Once you succeed in making <application>MPlayer</application> play
|
2005-05-18 12:15:30 +00:00
|
|
|
your favorite internet stream, you can use the option
|
2005-05-17 21:34:15 +00:00
|
|
|
<option>-dumpstream</option> to save the stream into a file.
|
|
|
|
For example:
|
|
|
|
<screen>
|
2005-05-18 12:15:30 +00:00
|
|
|
mplayer <replaceable>http://217.71.208.37:8006</replaceable> -dumpstream -dumpfile <replaceable>stream.asf</replaceable>
|
2005-05-17 21:34:15 +00:00
|
|
|
</screen>
|
|
|
|
will save the content streamed from
|
|
|
|
<replaceable>http://217.71.208.37:8006</replaceable> into
|
2005-05-18 12:15:30 +00:00
|
|
|
<replaceable>stream.asf</replaceable>.
|
|
|
|
This works with all protocols supported by
|
2005-05-17 21:34:15 +00:00
|
|
|
<application>MPlayer</application>, like MMS, RSTP, and so forth.
|
2005-05-18 12:15:30 +00:00
|
|
|
If you only wish to save audio or video, use <option>-dumpaudio</option>
|
|
|
|
or <option>-dumpvideo</option> respectively, but be aware that
|
|
|
|
<application>MPlayer</application> will ignore all but the last
|
|
|
|
<option>-dump*</option> option given on the command line.
|
2005-05-17 21:34:15 +00:00
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
2003-04-21 21:04:59 +00:00
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="mpst" xreflabel="Remote streams">
|
|
|
|
<title>Remote streams</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Remote streams allow you to access most <application>MPlayer</application>
|
|
|
|
stream type from a remote host. The main purpose of this feature is to make
|
|
|
|
it possible to directly use the CD or DVD drive of another computer on the
|
|
|
|
network (provided you have the required bandwidth). On the downside some
|
2003-10-26 14:58:17 +00:00
|
|
|
stream type (currently TV and MF) are not usable remotely because they are
|
2005-09-06 16:36:26 +00:00
|
|
|
implemented at the demuxer level. It is sad for MF but TV stream would anyway
|
2003-10-26 14:58:17 +00:00
|
|
|
require an insane amount of bandwidth.
|
2003-04-21 21:04:59 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<sect2 id="compile_mpst_server">
|
|
|
|
<title>Compiling the server</title>
|
|
|
|
<para>
|
|
|
|
After having compiled <application>MPlayer</application> go to the
|
|
|
|
<filename>TOOLS/netstream</filename> directory and enter
|
|
|
|
<application>make</application> to build the server binary.
|
|
|
|
You can then copy the <application>netstream</application> binary
|
2003-04-21 21:13:44 +00:00
|
|
|
to the right place on your system (usually
|
|
|
|
<filename class="directory">/usr/local/bin</filename> on Linux).
|
2003-04-21 21:04:59 +00:00
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 id="use_mpst">
|
|
|
|
<title>Using remote streams</title>
|
|
|
|
<para>
|
|
|
|
First you have to start the server on the computer you intend to remotely
|
2005-09-06 16:36:26 +00:00
|
|
|
access. Currently the server is very basic and does not have any commands
|
2003-04-21 21:04:59 +00:00
|
|
|
line arguments so just enter <filename>netstream</filename>. Now you can
|
|
|
|
for example play the second track of a VCD on the server with :
|
|
|
|
<screen>
|
2004-01-01 17:44:41 +00:00
|
|
|
mplayer -cache 5000 <replaceable>mpst://servername/vcd://2</replaceable>
|
2003-04-21 21:04:59 +00:00
|
|
|
</screen>
|
|
|
|
You can also access files on this server :
|
|
|
|
<screen>
|
2004-01-01 17:44:41 +00:00
|
|
|
mplayer -cache 5000 <replaceable>mpst://servername//usr/local/movies/lol.avi</replaceable>
|
2003-04-21 21:04:59 +00:00
|
|
|
</screen>
|
2003-10-26 14:58:17 +00:00
|
|
|
Note that paths which aren't starting with a / will be relative to
|
2003-10-16 11:40:13 +00:00
|
|
|
the directory where the server is running. The <option>-cache</option> option is not
|
2003-04-21 21:04:59 +00:00
|
|
|
needed but highly recommended.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2005-09-06 16:36:26 +00:00
|
|
|
Be aware that currently the server is not secure at all. So do not complain
|
2003-10-26 14:58:17 +00:00
|
|
|
about the numerous exploits which are possible through this. Instead send
|
2003-04-21 21:04:59 +00:00
|
|
|
some (good) patch to make it better or start writing your own server.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
2003-03-23 23:35:12 +00:00
|
|
|
</sect1>
|
2004-01-14 19:56:36 +00:00
|
|
|
|
|
|
|
<sect1 id="edl" xreflabel="Edit Decision Lists (EDL)">
|
|
|
|
<title>Edit Decision Lists (EDL)</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The edit decision list (EDL) system allows you to automatically skip
|
|
|
|
or mute sections of videos during playback, based on a movie specific
|
|
|
|
EDL configuration file.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This is useful for those who may want to watch a film in "family-friendly"
|
|
|
|
mode. You can cut out any violence, profanity, Jar-Jar Binks .. from a movie
|
|
|
|
according to your own personal preferences. Aside from this, there are other
|
|
|
|
uses, like automatically skipping over commercials in video files you watch.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The EDL file format is pretty bare-bones. Once the EDL system has reached a
|
|
|
|
certain level of maturity, an XML-based file format will probably be implemented
|
|
|
|
(keeping backwards compatibility with previous EDL formats).
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<sect2 id="edl_using">
|
|
|
|
<title>Using an EDL file</title>
|
|
|
|
<para>
|
|
|
|
Include the <option>-edl <filename></option> flag when you run
|
|
|
|
<application>MPlayer</application>, with the name of the EDL file you
|
|
|
|
want applied to the video.
|
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 id="edl_making">
|
|
|
|
<title>Making an EDL file</title>
|
|
|
|
<para>
|
|
|
|
The current EDL file format is:
|
|
|
|
<programlisting>
|
|
|
|
[begin second] [end second] [action]
|
|
|
|
</programlisting>
|
|
|
|
Where the seconds are floating-point numbers and the action is either
|
|
|
|
<literal>0</literal> for skip or <literal>1</literal> for mute. Example:
|
|
|
|
<programlisting>
|
|
|
|
5.3 7.1 0
|
|
|
|
15 16.7 1
|
|
|
|
420 422 0
|
|
|
|
</programlisting>
|
|
|
|
This will skip from second 5.3 to second 7.1 of the video, then mute at
|
|
|
|
15 seconds, unmute at 16.7 seconds and skip from second 420 to second 422
|
|
|
|
of the video. These actions will be performed when the playback timer
|
|
|
|
reaches the times given in the file.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To create an EDL file to work from, use the <option>-edlout <filename></option>
|
|
|
|
flag. During playback, when you want to mark the previous two seconds to skip over,
|
|
|
|
hit <keycap>i</keycap>. A corresponding entry will be written to the file for
|
|
|
|
that time. You can then go back and fine-tune the generated EDL file.
|
|
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<sect1 id="advaudio" xreflabel="Advanced Audio">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Advanced audio</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<sect2 id="advaudio-surround">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Surround/Multichannel playback</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<sect3 id="advaudio-surround-DVD">
|
|
|
|
<title>DVDs</title>
|
|
|
|
<para>
|
|
|
|
Most DVDs and many other files include surround sound.
|
|
|
|
<application>MPlayer</application> supports surround playback but does not
|
|
|
|
enable it by default because stereo equipment is by far more common. To play a
|
|
|
|
file that has more than two channels of audio use <option>-channels</option>.
|
|
|
|
For example, to play a DVD with 5.1 audio:
|
|
|
|
|
|
|
|
<screen>mplayer dvd://1 -channels 6</screen>
|
|
|
|
|
|
|
|
Note that despite the name "5.1" there are actually six discrete channels.
|
|
|
|
If you have surround sound equipment it is safe to put the
|
|
|
|
<option>channels</option> option in your <application>MPlayer</application>
|
|
|
|
configuration file <filename>~/.mplayer/config</filename>. For example, to make
|
|
|
|
quadraphonic playback the default, add this line:
|
|
|
|
|
|
|
|
<programlisting>channels=4</programlisting>
|
|
|
|
|
|
|
|
<application>MPlayer</application> will then output audio in four channels when
|
|
|
|
all four channels are available.
|
|
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
|
|
|
|
<sect3 id="advaudio-surround-stereoinfour">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Playing stereo files to four speakers</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<application>MPlayer</application> does not duplicate any channels by default,
|
|
|
|
and neither do most audio drivers. If you want to do that manually:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -af channels=2:2:0:1:0:0</screen>
|
|
|
|
|
|
|
|
See the section on
|
|
|
|
<link linkend="advaudio-channels-copying">channel copying</link> for an
|
|
|
|
explanation.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
|
|
|
|
<sect3 id="advaudio-surround-passthrough">
|
|
|
|
<title>AC3/DTS Passthrough</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
DVDs usually have surround audio encoded in AC3 (Dolby Digital) or DTS
|
|
|
|
(Digital Theater System) format. Some modern audio equipment is capable of
|
|
|
|
decoding these formats internally. <application>MPlayer</application> can be
|
|
|
|
configured to relay the audio data without decoding it. This will only work if
|
|
|
|
you have a S/PDIF (Sony/Philips Digital Interface) jack in your sound card.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If your audio equipment can decode both AC3 and DTS, you can safely enable
|
|
|
|
passthrough for both formats. Otherwise, enable passthrough for only the format
|
|
|
|
your equipment supports.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<title>To enable passthrough on the command line:</title>
|
|
|
|
<listitem><para>
|
|
|
|
For AC3 only, use <option>-ac hwac3</option>
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
For DTS only, use <option>-ac hwdts</option>
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
For both AC3 and DTS, use <option>-afm hwac3</option>
|
|
|
|
</para></listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<title>To enable passthrough in the <application>MPlayer</application>
|
|
|
|
configuration file: </title>
|
|
|
|
<listitem><para>
|
|
|
|
For AC3 only, use <option>ac=hwac3,</option>
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
For DTS only, use <option>ac=hwdts,</option>
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
For both AC3 and DTS, use <option>-afm hwac3</option>
|
|
|
|
</para></listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<para>
|
2005-09-06 16:36:26 +00:00
|
|
|
Note that there is a comma (",") at the end of
|
2005-09-04 22:29:36 +00:00
|
|
|
<option>ac=hwac3,</option> and <option>ac=hwdts,</option>. This will make
|
2005-09-06 16:36:26 +00:00
|
|
|
<application>MPlayer</application> fall back on the codecs it normally uses when
|
|
|
|
playing a file that does not have AC3 or DTS audio. <option>afm=hwac3</option>
|
2005-09-04 22:29:36 +00:00
|
|
|
does not need a comma; <application>MPlayer</application> will fall back anyway
|
|
|
|
when an audio family is specified.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
|
|
|
|
<sect3 id="advaudio-surround-matrix">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Matrix-encoded audio</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<para>
|
2005-09-05 01:43:59 +00:00
|
|
|
<emphasis>***TODO***</emphasis>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
This section has yet to be written and cannot be completed until somebody
|
|
|
|
provides sample files for us to test. If you have any matrix-encoded audio
|
|
|
|
files, know where to find some, or have any information that could be helpful,
|
|
|
|
please send a message to the
|
|
|
|
<ulink url="http://mplayerhq.hu/mailman/listinfo/mplayer-docs">MPlayer-DOCS</ulink>
|
|
|
|
mailing list. Put "[matrix-encoded audio]" in the subject line.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
If no files or further information are forthcoming this section will be dropped.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Good links:
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem><para>
|
|
|
|
<ulink url="http://electronics.howstuffworks.com/surround-sound5.htm">http://electronics.howstuffworks.com/surround-sound5.htm</ulink>
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
<ulink url="http://www.extremetech.com/article2/0,1697,1016875,00.asp">http://www.extremetech.com/article2/0,1697,1016875,00.asp</ulink>
|
|
|
|
</para></listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
|
|
|
|
<sect3 id="advaudio-surround-hrtf">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Surround emulation in headphones</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
<application>MPlayer</application> includes an HRTF (Head Related Transfer
|
2005-09-06 16:36:26 +00:00
|
|
|
Function) filter based on an
|
|
|
|
<ulink url="http://sound.media.mit.edu/KEMAR.html">MIT project</ulink>
|
|
|
|
wherein measurements were taken from microphones mounted on a dummy human head.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Although it is not possible to exactly imitate a surround system,
|
|
|
|
<application>MPlayer</application>'s HRTF filter does provide more spatially
|
|
|
|
immersive audio in 2-channel headphones. Regular downmixing simply combines all
|
|
|
|
the channels into two; besides combining the channels, <option>hrtf</option>
|
|
|
|
generates subtle echoes, increases the stereo separation slightly, and alters
|
2005-09-06 16:36:26 +00:00
|
|
|
the volume of some frequencies. Whether HRTF sounds better may be dependent on
|
2005-09-04 22:29:36 +00:00
|
|
|
the source audio and a matter of personal taste, but it is definitely worth
|
|
|
|
trying out.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
To play a DVD with HRTF:
|
|
|
|
|
|
|
|
<screen>mplayer dvd://1 -channels 6 -af hrtf</screen>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
<option>hrtf</option> only works well with 5 or 6 channels. Also,
|
|
|
|
<option>hrtf</option> requires 48 kHz audio. DVD audio is already 48 kHz, but if
|
|
|
|
you have a file with a different sampling rate that you want to play using
|
|
|
|
<option>hrtf</option> you must resample it:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -channels 6 -af resample=48000,hrtf</screen>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
|
|
|
|
<sect3 id="advaudio-surround-troubleshooting">
|
|
|
|
<title>Troubleshooting</title>
|
|
|
|
|
|
|
|
<para>
|
2005-09-06 16:36:26 +00:00
|
|
|
If you do not hear any sound out of your surround channels, check your mixer
|
2005-09-04 22:29:36 +00:00
|
|
|
settings with a mixer program such as <application>alsamixer</application>;
|
|
|
|
audio outputs are often muted and set to zero volume by default.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
|
|
<sect2 id="advaudio-channels">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Channel manipulation</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<sect3 id="advaudio-channels-general">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>General information</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
Unfortunately, there is no standard for how channels are ordered. The orders
|
|
|
|
listed below are those of AC3 and are fairly typical; try them and see if your
|
|
|
|
source matches. Channels are numbered starting with 0.
|
|
|
|
|
|
|
|
<orderedlist spacing="compact">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>mono</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
<listitem override="0"><simpara>center</simpara></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
|
|
|
<orderedlist spacing="compact">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>stereo</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
<listitem override="0"><simpara>left</simpara></listitem>
|
|
|
|
<listitem><simpara>right</simpara></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
|
|
|
<orderedlist spacing="compact">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>quadraphonic</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
<listitem override="0"><simpara>left front</simpara></listitem>
|
|
|
|
<listitem><simpara>right front</simpara></listitem>
|
|
|
|
<listitem><simpara>left rear</simpara></listitem>
|
|
|
|
<listitem><simpara>right rear</simpara></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
|
|
|
<orderedlist spacing="compact">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>surround 4.0</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
<listitem override="0"><simpara>left front</simpara></listitem>
|
|
|
|
<listitem><simpara>right front</simpara></listitem>
|
|
|
|
<listitem><simpara>center rear</simpara></listitem>
|
|
|
|
<listitem><simpara>center front</simpara></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
|
|
|
<orderedlist spacing="compact">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>surround 5.0</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
<listitem override="0"><simpara>left front</simpara></listitem>
|
|
|
|
<listitem><simpara>right front</simpara></listitem>
|
|
|
|
<listitem><simpara>left rear</simpara></listitem>
|
|
|
|
<listitem><simpara>right rear</simpara></listitem>
|
|
|
|
<listitem><simpara>center front</simpara></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
|
|
|
<orderedlist spacing="compact">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>surround 5.1</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
<listitem override="0"><simpara>left front</simpara></listitem>
|
|
|
|
<listitem><simpara>right front</simpara></listitem>
|
|
|
|
<listitem><simpara>left rear</simpara></listitem>
|
|
|
|
<listitem><simpara>right rear</simpara></listitem>
|
|
|
|
<listitem><simpara>center front</simpara></listitem>
|
|
|
|
<listitem><simpara>subwoofer</simpara></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <option>-channels</option> option is used to request the number of
|
|
|
|
channels from the audio decoder. Some audio codecs use the number of specified
|
|
|
|
channels to decide if downmixing the source is necessary. Note that this does
|
|
|
|
not always affect the number of output channels. For example, using
|
|
|
|
<option>-channels 4</option> to play a stereo MP3 file will still result in
|
|
|
|
2-channel output since the MP3 codec will not produce the extra channels.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <option>channels</option> audio filter can be used to create or remove
|
|
|
|
channels and is useful for controlling the number of channels sent to the sound
|
|
|
|
card. See the following sections for more information on channel manipulation.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
|
|
|
|
<sect3 id="advaudio-channels-mono">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Playing mono with two speakers</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<para>
|
2005-09-06 16:36:26 +00:00
|
|
|
Mono sounds a lot better when played through two speakers - especially when
|
|
|
|
using headphones. Audio files that truly have one channel are automatically
|
|
|
|
played through two speakers; unfortunately, most files with mono sound are
|
|
|
|
actually encoded as stereo with one channel silent. The easiest and most
|
|
|
|
foolproof way to make both speakers output the same audio is the
|
|
|
|
<option>extrastereo</option> filter:
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -af extrastereo=0</screen>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This averages both channels, resulting in both channels being half as loud as
|
|
|
|
the original. The next sections have examples of other ways to do this without a
|
|
|
|
volume decrease, but they are more complex and require different options
|
|
|
|
depending on which channel to keep. If you really need to maintain the volume,
|
|
|
|
it may be easier to experiment with the <option>volume</option> filter and find
|
|
|
|
the right value. For example:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -af extrastereo=0,volume=5</screen>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
|
|
|
|
<sect3 id="advaudio-channels-copying">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Channel copying/moving</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<para>
|
2005-09-06 16:36:26 +00:00
|
|
|
The <option>channels</option> filter can move any or all channels.
|
|
|
|
Setting up all the suboptions for the <option>channels</option>
|
|
|
|
filter can be complicated and takes a little care.
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<orderedlist spacing="compact">
|
|
|
|
<listitem><para>
|
|
|
|
Decide how many output channels you need. This is the first suboption.
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
Count how many channel moves you will do. This is the second suboption. Each
|
|
|
|
channel can be moved to several different channels at the same time, but keep in
|
|
|
|
mind that when a channel is moved (even if to only one destination) the source
|
|
|
|
channel will be empty unless another channel is moved into it. To copy a
|
|
|
|
channel, keeping the source the same, simply move the channel into both the
|
|
|
|
destination and the source. For example:
|
|
|
|
<programlisting>
|
|
|
|
channel 2 --> channel 3
|
|
|
|
channel 2 --> channel 2
|
|
|
|
</programlisting>
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
Write out the channel copies as pairs of suboptions. Note that the first channel
|
|
|
|
is 0, the second is 1, etc. The order of these suboptions does not matter as
|
|
|
|
long as they are properly grouped into
|
|
|
|
<replaceable>source:destination</replaceable> pairs.
|
|
|
|
</para></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<bridgehead>Example: one channel in two speakers</bridgehead>
|
|
|
|
|
|
|
|
<para>
|
2005-09-06 16:36:26 +00:00
|
|
|
Here is an example of another way to play one channel in both speakers. Suppose
|
2005-09-04 22:29:36 +00:00
|
|
|
for this example that the left channel should be played and the right channel
|
|
|
|
discarded. Following the steps above:
|
|
|
|
<orderedlist>
|
|
|
|
<listitem><para>
|
|
|
|
In order to provide an output channel for each of the two speakers, the first
|
|
|
|
suboption must be "2".
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
The left channel needs to be moved to the right channel, and also must be moved
|
|
|
|
to itself so it won't be empty. This is a total of two moves, making the second
|
|
|
|
suboption "2" as well.
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
To move the left channel (channel 0) into the right channel (channel 1), the
|
2005-09-06 16:36:26 +00:00
|
|
|
suboption pair is "0:1", "0:0" moves the left channel onto itself.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
Putting that all together gives:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -af channels=2:2:0:1:0:0</screen>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The advantage this example has over <option>extrastereo</option> is that the
|
|
|
|
volume of each output channel is the same as the input channel. The disadvantage
|
|
|
|
is that the suboptions must be changed to "2:2:1:0:1:1" when the desired audio
|
2005-09-06 16:36:26 +00:00
|
|
|
is in the right channel. Also, it is more difficult to remember and type.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<bridgehead>Example: left channel in two speakers shortcut</bridgehead>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
There is actually a much easier way to use the <option>channels</option> filter
|
|
|
|
for playing the left channel in both speakers:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -af channels=1</screen>
|
|
|
|
|
|
|
|
The second channel is discarded and, with no further suboptions, the single
|
|
|
|
remaining channel is left alone. Sound card drivers automatically play
|
|
|
|
single-channel audio in both speakers. This only works when the desired channel
|
|
|
|
is on the left.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<bridgehead>Example: duplicate front channels to the rear</bridgehead>
|
|
|
|
<para>
|
|
|
|
Another common operation is to duplicate the front channels and play them back
|
|
|
|
on the rear speakers of a quadraphonic setup.
|
|
|
|
<orderedlist>
|
|
|
|
<listitem><para>
|
|
|
|
There should be four output channels. The first suboption is "4".
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
Each of the two front channels needs to be moved to the corresponding rear
|
|
|
|
channel and also to itself. This is four moves, so the second suboption is "4".
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
The left front (channel 0) needs to moved to the left rear (channel 2): "0:2".
|
|
|
|
The left front also needs to be moved to itself: "0:0". The right front (channel
|
|
|
|
1) is moved to the right rear (channel 3): "1:3", and also to itself: "1:1".
|
|
|
|
</para></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
Combine all the suboptions to get:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -af channels=4:4:0:2:0:0:1:3:1:1</screen>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
|
|
|
|
<sect3 id="advaudio-channels-mixing">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Channel mixing</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
The <option>pan</option> filter can mix channels in user-specified proportions.
|
|
|
|
This allows for everything the <option>channels</option> filter can do and
|
|
|
|
more. Unfortunately, the suboptions are much more complicated.
|
|
|
|
<orderedlist>
|
|
|
|
<listitem><para>
|
|
|
|
Decide how many channels to work with. You may need to specify this with
|
|
|
|
<option>-channels</option> and/or <option>-af channels</option>. Later examples
|
|
|
|
will show when to use which.
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
Decide how many channels to feed into <option>pan</option> (further decoded
|
|
|
|
channels are discarded). This is the first suboption, and it also controls how
|
2005-09-06 16:36:26 +00:00
|
|
|
many channels to employ for output.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
|
|
|
The remaining suboptions specify how much of each channel gets mixed into each
|
|
|
|
other channel. This is the complicated part. To break the task down, split the
|
|
|
|
suboptions into several sets, one set for each output channel. Each suboption
|
|
|
|
within a set corresponds to an input channel. The number you specify will be the
|
|
|
|
percentage of the input channel that gets mixed into the output channel.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<option>pan</option> accepts values from 0 to 512, yielding 0% to 51200% of the
|
|
|
|
original volume. Be careful when using values greater than 1. Not only can this
|
|
|
|
give you very high volume, but if you exceed the sample range of your sound card
|
|
|
|
you may hear painful pops and clicks. If you want you can follow
|
2005-09-06 16:36:26 +00:00
|
|
|
<option>pan</option> with <option>,volume</option> to enable clipping, but it is
|
2005-09-04 22:29:36 +00:00
|
|
|
best to keep the values of <option>pan</option> low enough that clipping is not
|
|
|
|
necessary.
|
|
|
|
</para></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<bridgehead>Example: one channel in two speakers</bridgehead>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Here is yet another example for playing the left channel in two speakers. Follow
|
|
|
|
the steps above:
|
|
|
|
<orderedlist>
|
|
|
|
<listitem><para>
|
2005-09-18 11:40:06 +00:00
|
|
|
<option>pan</option> should output two channels, so the first
|
2005-09-04 22:29:36 +00:00
|
|
|
suboption is "2".
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
2005-09-18 11:40:06 +00:00
|
|
|
Since we have two input channels, there will be two sets of suboptions.
|
|
|
|
Since there are also two output channels,
|
|
|
|
there will be two suboptions per set.
|
|
|
|
The left channel from the file should go with full volume to
|
|
|
|
the new left and the right channels.
|
|
|
|
Thus the first set of suboptions is "1:1".
|
|
|
|
The right channel should be discarded, so the second would be "0:0".
|
|
|
|
Any 0 values at the end can be left out, but for ease of
|
|
|
|
understanding we will keep them.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
Putting those options together gives:
|
|
|
|
|
2005-09-18 11:40:06 +00:00
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -af pan=2:1:1:0:0</screen>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
If the right channel is desired instead of the left, the suboptions to
|
2005-09-18 11:40:06 +00:00
|
|
|
<option>pan</option> will be "2:0:0:1:1".
|
2005-09-04 22:29:36 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<bridgehead>Example: left channel in two speakers shortcut</bridgehead>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
As with <option>channels</option>, there is a shortcut that only works with the
|
|
|
|
left channel:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>filename</replaceable> -af pan=1:1</screen>
|
|
|
|
|
|
|
|
Since <option>pan</option> has only one channel of input (the other channel is
|
|
|
|
discarded), there is only one set with one suboption, which specifies that the
|
|
|
|
only channel gets 100% of itself.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<bridgehead>Example: downmixing 6-channel PCM</bridgehead>
|
|
|
|
<para>
|
|
|
|
<application>MPlayer</application>'s decoder for 6-channel PCM is not capable of
|
2005-09-06 16:36:26 +00:00
|
|
|
downmixing. Here is a way to downmix PCM using <option>pan</option>:
|
2005-09-04 22:29:36 +00:00
|
|
|
<orderedlist>
|
|
|
|
<listitem><para>
|
2005-09-18 11:40:06 +00:00
|
|
|
The number of output channels is 2, so the first suboption is "2".
|
2005-09-04 22:29:36 +00:00
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
2005-09-18 11:40:06 +00:00
|
|
|
With six input channels there will be six sets of options. Fortunately,
|
2005-09-04 22:29:36 +00:00
|
|
|
since we only care about the output of the first two channels, we only need to
|
|
|
|
make two sets; the remaining four sets can be omitted. Beware that not all
|
|
|
|
multichannel audio files have the same channel order! This example
|
|
|
|
demonstrates downmixing a file with the same channels as AC3 5.1:
|
|
|
|
<programlisting>
|
|
|
|
0 - front left
|
|
|
|
1 - front right
|
|
|
|
2 - rear left
|
|
|
|
3 - rear right
|
|
|
|
4 - center front
|
|
|
|
5 - subwoofer
|
|
|
|
</programlisting>
|
|
|
|
The first set of suboptions lists the percentages of the original volume, in
|
2005-09-18 11:40:06 +00:00
|
|
|
order, which each output channel should receive from the
|
|
|
|
front left channel: "1:0".
|
|
|
|
The front right channel should go into the right output: "0:1".
|
|
|
|
The same for the rear channels: "1:0" and "0:1".
|
|
|
|
The center channel goes into both output channels with half volume:
|
|
|
|
"0.5:0.5", and the subwoofer goes into both with full volume: "1:1".
|
2005-09-04 22:29:36 +00:00
|
|
|
</para></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
Put all that together, for:
|
|
|
|
|
2005-09-18 11:40:06 +00:00
|
|
|
<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>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
The percentages listed above are only a rough example. Feel free to tweak them.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<bridgehead>Example: Playing 5.1 audio on big speakers without a subwoofer</bridgehead>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If you have a huge pair of front speakers you may not want to waste any money on
|
|
|
|
buying a subwoofer for a complete 5.1 sound system. If you use
|
|
|
|
<option>-channels 5</option> to request that liba52 decode 5.1 audio in 5.0,
|
|
|
|
the subwoofer channel is simply discarded. If you want to distribute the
|
|
|
|
subwoofer channel yourself you need to downmix manually with
|
|
|
|
<option>pan</option>:
|
|
|
|
|
|
|
|
<orderedlist>
|
|
|
|
<listitem><para>
|
|
|
|
Since <option>pan</option> needs to examine all six channels, specify
|
|
|
|
<option>-channels 6</option> so liba52 decodes them all.
|
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
2005-09-18 11:40:06 +00:00
|
|
|
<option>pan</option> outputs to only five channels, the first suboption is 5.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para></listitem>
|
|
|
|
<listitem><para>
|
2005-09-18 11:40:06 +00:00
|
|
|
Six input channels and five output channels means six sets of five suboptions.
|
2005-09-04 22:29:36 +00:00
|
|
|
<itemizedlist spacing="compact">
|
|
|
|
<listitem><simpara>
|
2005-09-18 11:40:06 +00:00
|
|
|
The left front channel only replicates onto itself:
|
|
|
|
"1:0:0:0:0"
|
2005-09-04 22:29:36 +00:00
|
|
|
</simpara></listitem>
|
|
|
|
<listitem><simpara>
|
2005-09-18 11:40:06 +00:00
|
|
|
Same for the right front channel:
|
|
|
|
"0:1:0:0:0"
|
2005-09-04 22:29:36 +00:00
|
|
|
</simpara></listitem>
|
|
|
|
<listitem><simpara>
|
2005-09-18 11:40:06 +00:00
|
|
|
Same for the left rear channel:
|
|
|
|
"0:0:1:0:0"
|
2005-09-04 22:29:36 +00:00
|
|
|
</simpara></listitem>
|
|
|
|
<listitem><simpara>
|
2005-09-18 11:40:06 +00:00
|
|
|
And also the same for the right rear channel:
|
|
|
|
"0:0:0:1:0"
|
2005-09-04 22:29:36 +00:00
|
|
|
</simpara></listitem>
|
|
|
|
<listitem><simpara>
|
2005-09-18 11:40:06 +00:00
|
|
|
Center front, too:
|
|
|
|
"0:0:0:0:1"
|
2005-09-04 22:29:36 +00:00
|
|
|
</simpara></listitem>
|
|
|
|
<listitem><simpara>
|
2005-09-18 11:40:06 +00:00
|
|
|
And now we have to decide what to do with the subwoofer,
|
|
|
|
e.g. half into front right and front left:
|
|
|
|
"0.5:0.5:0:0:0"
|
2005-09-04 22:29:36 +00:00
|
|
|
</simpara></listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</para></listitem>
|
|
|
|
</orderedlist>
|
|
|
|
Combine all those options to get:
|
|
|
|
|
2005-09-18 11:40:06 +00:00
|
|
|
<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>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
|
|
|
|
<sect2 id="advaudio-volume">
|
2005-09-06 16:36:26 +00:00
|
|
|
<title>Software Volume adjustment</title>
|
2005-09-04 22:29:36 +00:00
|
|
|
|
|
|
|
<para>
|
|
|
|
Some audio tracks are too quiet to be heard comfortably without amplification.
|
|
|
|
This becomes a problem when your audio equipment cannot amplify the signal for
|
|
|
|
you. The <option>-softvol</option> option directs
|
|
|
|
<application>MPlayer</application> to use an internal mixer. You can then use
|
|
|
|
the volume adjustment keys (by default <keycap>9</keycap> and
|
|
|
|
<keycap>0</keycap>) to reach much higher volume levels. Note that this does not
|
|
|
|
bypass your sound card's mixer; <application>MPlayer</application> only
|
|
|
|
amplifies the signal before sending it to your sound card.
|
|
|
|
|
|
|
|
The following example is a good start:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>quiet-file</replaceable> -softvol -softvol-max 300</screen>
|
|
|
|
|
2005-09-06 16:33:31 +00:00
|
|
|
The <option>-softvol-max</option> option specifies the maximum allowable output
|
|
|
|
volume as a percentage of the
|
2005-09-04 22:29:36 +00:00
|
|
|
original volume. For example, <option>-softvol-max 200</option> would allow the
|
2005-09-06 16:33:31 +00:00
|
|
|
volume to be adjusted up to twice its original level.
|
|
|
|
It is safe to specify a large value with
|
2005-09-04 22:29:36 +00:00
|
|
|
<option>-softvol-max</option>; the higher volume will not be used until you
|
|
|
|
use the volume adjustment keys. The only disadvantage of a large value is that,
|
2005-09-06 16:36:26 +00:00
|
|
|
since <application>MPlayer</application> adjusts volume by a percentage of the
|
2005-09-04 22:29:36 +00:00
|
|
|
maximum, you will not have as precise control when using the volume adjustment
|
2005-09-06 16:33:31 +00:00
|
|
|
keys. Use a lower value with <option>-softvol-max</option> and/or specify
|
|
|
|
<option>-volstep 1</option> if you need higher precision.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The <option>-softvol</option> option works by controlling the
|
|
|
|
<option>volume</option> audio filter. If you want to play a file at a certain
|
|
|
|
volume from the beginning you can specify <option>volume</option> manually:
|
|
|
|
|
|
|
|
<screen>mplayer <replaceable>quiet-file</replaceable> -af volume=10</screen>
|
|
|
|
|
|
|
|
This will play the file with a ten decibel gain. Be careful when using the
|
|
|
|
<option>volume</option> filter - you could easily hurt your ears if you use
|
|
|
|
too high a value. Start low and work your way up gradually until you get a feel
|
|
|
|
for how much adjustment is required. Also, if you specify excessively high
|
2005-09-06 16:33:31 +00:00
|
|
|
values, <option>volume</option> may need to clip the signal to avoid sending your
|
2005-09-14 21:15:38 +00:00
|
|
|
sound card data that is outside the allowable range; this will result in
|
|
|
|
distorted audio.
|
2005-09-04 22:29:36 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
|
2003-03-23 23:35:12 +00:00
|
|
|
</chapter>
|