2002-06-12 23:53:28 +00:00
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2001-08-21 21:01:54 +00:00
|
|
|
<HTML>
|
2002-03-07 17:55:34 +00:00
|
|
|
|
|
|
|
<HEAD>
|
2002-08-04 00:07:55 +00:00
|
|
|
<TITLE>Sound - MPlayer - The Movie Player for Linux</TITLE>
|
2002-06-12 09:14:08 +00:00
|
|
|
<LINK REL="stylesheet" TYPE="text/css" HREF="default.css">
|
2002-06-12 23:53:28 +00:00
|
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
2002-03-07 17:55:34 +00:00
|
|
|
</HEAD>
|
|
|
|
|
2002-06-12 23:53:28 +00:00
|
|
|
<BODY>
|
2001-08-26 17:28:49 +00:00
|
|
|
|
2001-08-21 21:01:54 +00:00
|
|
|
|
2002-08-20 00:33:04 +00:00
|
|
|
<H3><A NAME="audio">2.3.2 Audio output devices</A></H3>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<H4><A NAME="sync">2.3.2.1 Audio/Video synchronisation</A></H4>
|
2002-11-13 05:13:51 +00:00
|
|
|
|
2002-10-20 12:20:39 +00:00
|
|
|
<P>MPlayer's audio interface is called <I>libao2</I>. It currently
|
2002-08-11 18:27:38 +00:00
|
|
|
contains these drivers:</P>
|
2001-09-14 16:13:28 +00:00
|
|
|
|
2003-01-03 22:56:18 +00:00
|
|
|
<DL>
|
|
|
|
<DT>oss</DT>
|
|
|
|
<DD>OSS (ioctl) driver (supports hardware AC3 passthrough)</DD>
|
|
|
|
|
|
|
|
<DT>sdl</DT>
|
|
|
|
<DD>SDL driver (supports <B>ESD</B>, <B>ARTS</B> etc)</DD>
|
|
|
|
|
|
|
|
<DT>nas</DT>
|
|
|
|
<DD>NAS (Network Audio System) driver</DD>
|
|
|
|
|
|
|
|
<DT>alsa5</DT>
|
|
|
|
<DD>native ALSA 0.5 driver</DD>
|
|
|
|
|
|
|
|
<DT>alsa9</DT>
|
|
|
|
<DD>native ALSA 0.9 driver (supports hardware AC3 passthrough)</DD>
|
|
|
|
|
|
|
|
<DT>sun</DT>
|
|
|
|
<DD>SUN audio driver (<CODE>/dev/audio</CODE>) for BSD and Solaris8 users</DD>
|
|
|
|
|
|
|
|
<DT>arts</DT>
|
|
|
|
<DD>native ARTS driver (mostly for KDE users)</DD>
|
|
|
|
|
|
|
|
<DT>esd</DT>
|
|
|
|
<DD>native ESD driver (mostly for GNOME users)</DD>
|
|
|
|
</DL>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2002-11-13 05:13:51 +00:00
|
|
|
<P>Fact is, Linux sound card drivers have compatibility problems. The cause
|
2003-01-03 22:29:16 +00:00
|
|
|
is that MPlayer uses a feature that well coded audio drivers implement to
|
|
|
|
maintain audio/video sync. Regrettably, some driver authors do not care about
|
|
|
|
this function, it is not needed for playing MP3s or for sound effects.</P>
|
2002-11-13 05:13:51 +00:00
|
|
|
|
|
|
|
<P>Other media players like aviplay or xine possibly work out-of-the-box with
|
|
|
|
these drivers because they use "simple" methods with internal timing. A note:
|
|
|
|
time showed their methods aren't AS efficient as MPlayer's.</P>
|
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<P>With a correctly written audio driver MPlayer will never create audio related
|
|
|
|
A/V desynchronisation, unless your file is badly broken. Some options to work
|
|
|
|
around these problems are described in the man page).</P>
|
2002-11-13 05:13:51 +00:00
|
|
|
|
|
|
|
<P>If you happen to have a bad audio driver, try the <CODE>-autosync</CODE>
|
|
|
|
option, it should sort out your problems. See the man page for detailed
|
|
|
|
information.</P>
|
|
|
|
|
|
|
|
<P>Some notes:</P>
|
2002-04-21 15:29:59 +00:00
|
|
|
|
|
|
|
<UL>
|
2002-08-10 20:26:43 +00:00
|
|
|
<LI>If you have an OSS driver, first try <CODE>-ao oss</CODE> (this is the
|
|
|
|
default). If you experience glitches, halts or anything out of the
|
2003-01-03 22:29:16 +00:00
|
|
|
ordinary, try <CODE>-ao sdl</CODE> (NOTE: You need to have SDL libraries
|
2002-08-10 20:26:43 +00:00
|
|
|
and header files installed). The SDL audio driver helps in a lot of cases
|
2003-01-03 22:29:16 +00:00
|
|
|
and also supports ESD and ARTS. (ESD is the sound daemon
|
2002-08-10 20:26:43 +00:00
|
|
|
from GNOME, ARTS is from KDE.)</LI>
|
|
|
|
<LI>If you have ALSA version 0.5, then you almost always have to use
|
|
|
|
<CODE>-ao alsa5</CODE> , since ALSA 0.5 has buggy OSS emulation code, and
|
|
|
|
will <B>crash MPlayer</B> with a message like this:<BR>
|
|
|
|
<CODE>DEMUXER: Too many (945 in 8390980 bytes) video packets in the buffer!</CODE></LI>
|
2002-04-21 15:29:59 +00:00
|
|
|
</UL>
|
2001-09-14 16:13:28 +00:00
|
|
|
|
2002-11-13 05:13:51 +00:00
|
|
|
<P>On <B>Solaris</B>, use the SUN audio driver with the
|
2002-08-10 20:26:43 +00:00
|
|
|
<CODE>-ao sun</CODE> option, otherwise neither video nor audio will work.</P>
|
2001-09-14 16:13:28 +00:00
|
|
|
|
2002-08-20 00:33:04 +00:00
|
|
|
|
2002-11-13 05:13:51 +00:00
|
|
|
<H4><A NAME="experiences">2.3.2.2 Sound Card experiences, recommendations</A></H4>
|
2001-08-24 18:48:13 +00:00
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<TABLE BORDER="0" WIDTH="100%">
|
2002-08-11 18:38:41 +00:00
|
|
|
<TR><TD COLSPAN=3><B>VIA onboard chipset (via82cxxx) 48kHz only</B></TD></TR>
|
2003-01-03 22:29:16 +00:00
|
|
|
<TR><TD></TD><TD>Driver:</TD><TD> from the
|
|
|
|
<A HREF="http://sourceforge.net/project/showfiles.php?group_id=3242&release_id=59602">gkernel project</A></TD></TR>
|
2002-08-11 18:38:41 +00:00
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>Aureal Vortex 2</B></TD></TR>
|
|
|
|
<TR><TD> </TD><TD>OSS:</TD><TD>no driver</TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS/Pro:</TD><TD>OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>no driver</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>48</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Driver:</TD><TD><A HREF="http://aureal.sourceforge.net">aureal.sourceforge.net</A></TD></TR>
|
2003-01-03 22:56:18 +00:00
|
|
|
<TR><TD></TD><TD>Driver2:</TD><TD> from <A HREF="http://makacs.poliod.hu/~pontscho/aureal/au88xx-1.1.3.tar.bz2">Pontscho's page</A>
|
2002-08-11 18:38:41 +00:00
|
|
|
(<I>buffer size increased to 32k</I>)</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>GUS PnP</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>no driver</TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS/Pro:</TD><TD>OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>48</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>SB Live!</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>Analog OK, SP/DIF not working</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>Both OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>192</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>SB AWE 64</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>max 44kHz</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>48kHz sounds bad</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>48</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>Gravis UltraSound ACE</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>not OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>44</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>Gravis UltraSound MAX</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>OK (?)</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>48</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>ESS 688</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>OK (?)</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>48</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>C-Media cards (which ones?)</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>not OK (hissing) (?)</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>OK (?)</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>?</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>Yamaha cards (*ymf*)</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>not OK (?) (maybe <CODE>-ao sdl</CODE>)</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>OK only with ALSA 0.5 with OSS emulation <B>AND</B> <CODE>-ao sdl</CODE> (!) (?)</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>?</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>Cards with envy24 chips (like Terratec EWS88MT)</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>?</TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS/Pro:</TD><TD>OK</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>?</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>?</TD></TR>
|
|
|
|
|
|
|
|
<TR><TD COLSPAN=3><B>PC Speaker or DAC</B></TD></TR>
|
|
|
|
<TR><TD></TD><TD>OSS:</TD><TD>OK (Use the SDL driver: <CODE>-ao sdl</CODE>)</TD></TR>
|
|
|
|
<TR><TD></TD><TD>ALSA:</TD><TD>no driver</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Max kHz:</TD><TD>The driver emulates 44.1, maybe more.</TD></TR>
|
|
|
|
<TR><TD></TD><TD>Driver:</TD><TD><A HREF="ftp://ftp.infradead.org/pub/pcsp">ftp://ftp.infradead.org/pub/pcsp</A></TD></TR>
|
2002-04-21 15:29:59 +00:00
|
|
|
</TABLE>
|
|
|
|
|
2002-08-27 18:06:07 +00:00
|
|
|
<P>On Linux, a 2.4.x kernel is highly recommended. Kernel 2.2 is not tested.</P>
|
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<P>If the sound clicks when playing from CD-ROM, turn on IRQ unmasking, e.g.
|
2002-08-27 18:06:07 +00:00
|
|
|
<CODE>hdparm -u1 /dev/cdrom</CODE> (<CODE>man hdparm</CODE>). This is
|
2003-01-03 22:29:16 +00:00
|
|
|
generally beneficial and described in more detail in the
|
|
|
|
<A HREF="cd-dvd.html#drives">CD-ROM section</A>.</P>
|
2002-08-27 18:06:07 +00:00
|
|
|
|
2002-10-20 12:20:39 +00:00
|
|
|
<P>Feedback to this document is welcome. Please tell us how MPlayer
|
2002-08-27 18:06:07 +00:00
|
|
|
and your sound card(s) worked together.</P>
|
2001-08-21 21:01:54 +00:00
|
|
|
|
2001-12-23 15:55:11 +00:00
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<H4><A NAME="af">2.3.2.3 Audio filters</A></H4>
|
|
|
|
|
|
|
|
<P>The old audio plugins have been superseded by a new audio filter layer. Audio
|
|
|
|
filters are used for changing the properties of the audio data before the
|
|
|
|
sound reaches the sound card. The activation and deactivation of the filters
|
|
|
|
is normally automated but can be overridden. The filters are activated when
|
|
|
|
the properties of the audio data differ from those required by the sound card
|
|
|
|
and deactivated if unnecessary. The <CODE>-af filter1,filter2,...</CODE>
|
|
|
|
switch is used to override the automatic activation of filters or to insert
|
|
|
|
filters that are not automatically inserted. The filters will be executed as
|
|
|
|
they appear in the comma separated list.</P>
|
|
|
|
|
|
|
|
<P>Example:<BR>
|
|
|
|
<CODE>mplayer -af resample,pan movie.avi </CODE></P>
|
|
|
|
|
|
|
|
<P>would run the sound through the resampling filter followed by the pan filter.
|
|
|
|
Observe that the list must not contain any spaces, else it will fail.</P>
|
|
|
|
|
|
|
|
<P>The filters often have switches that change their behavior. These switches
|
|
|
|
are explained in detail in the sections below. A filter will execute using
|
|
|
|
default settings if its switches are omitted. Here is an example of how to use
|
|
|
|
filters in combination with filter specific switches:</P>
|
|
|
|
|
|
|
|
<P> <CODE>mplayer -af resample=11025,pan=1:0.5:0.5 -channels 1
|
|
|
|
-srate 11025 media.avi</CODE></P>
|
|
|
|
|
|
|
|
<P>would set the output frequency of the resample filter to 11025Hz and downmix
|
|
|
|
the audio to 1 channel using the pan filter.</P>
|
|
|
|
|
|
|
|
<P>Most filters respond to the <CODE>-v</CODE> switch, which makes the filters
|
|
|
|
print out status messages.</P>
|
|
|
|
|
|
|
|
<P>The overall execution of the filter layer is controlled using the
|
|
|
|
<CODE>-af-adv</CODE> switch. This switch has two suboptions:</P>
|
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT><CODE>force</CODE><DT>
|
|
|
|
<DD>is an integer between 0 and 3 that controls how the filters are inserted
|
|
|
|
and what speed/accuracy optimizations they use:
|
|
|
|
<DL>
|
|
|
|
<DT>0</DT>
|
|
|
|
<DD>Use automatic insertion of filters and optimize according to CPU
|
|
|
|
speed.</DD>
|
|
|
|
<DT>1</DT>
|
|
|
|
<DD>Use automatic insertion of filters and optimize for the highest speed.
|
|
|
|
If this option is set the processing of the audio data will be done
|
|
|
|
using fix point arithmetics. Warning: Some features in the audio filters
|
|
|
|
will silently fail, and the sound quality may drop.</DD>
|
|
|
|
<DT>2</DT>
|
|
|
|
<DD>Use automatic insertion of filters and optimize for quality. If this
|
|
|
|
option is set the processing of the audio data will be done using
|
|
|
|
floating point instructions and is therefore quite CPU intensive, but
|
|
|
|
gives a lot higher sound quality than fix point processing.</DD>
|
|
|
|
<DT>3</DT>
|
|
|
|
<DD>Use no automatic insertion of filters and no optimization. Warning: It
|
|
|
|
may be possible to crash MPlayer using this setting.</DD>
|
|
|
|
</DL>
|
|
|
|
</DD>
|
|
|
|
|
|
|
|
<DT><CODE>list</CODE></DT>
|
|
|
|
<DD>is an alias for the -af switch.</DD>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
|
|
|
|
<H5><A NAME="af_resample">2.3.2.3.1 Up/Down-sampling</A></H5>
|
|
|
|
|
|
|
|
<P>MPlayer fully supports sound up/down-sampling. This filter can be used if you
|
|
|
|
have a fixed frequency sound card or if you are stuck with an old sound card
|
|
|
|
that is only capable of max 44.1kHz. This filter is automatically enabled if
|
|
|
|
it is necessary, but it can also be explicitly enabled on the command line. It
|
|
|
|
has three switches:</P>
|
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT><CODE>srate</CODE></DT>
|
|
|
|
<DD>is an integer used for setting the output sample
|
|
|
|
frequency in Hz. The valid range for this parameter is 8kHz to 192kHz. If
|
|
|
|
the input and output sample frequency are the same or if this parameter is
|
|
|
|
omitted the filter is automatically unloaded. A high sample frequency
|
|
|
|
normally improves the audio quality, especially when used in combination
|
|
|
|
with other filters.</DD>
|
|
|
|
|
|
|
|
<DT><CODE>sloppy</CODE></DT>
|
|
|
|
<DD>is an optional binary parameter that allows the output frequency to differ
|
|
|
|
slightly from the frequency given by <CODE>srate</CODE>. This switch can be
|
|
|
|
used if the startup of the playback is extremely slow.</DD>
|
|
|
|
|
|
|
|
<DT><CODE>fast</CODE><DT>
|
|
|
|
<DD>is an optional binary parameter that enables linear interpolation as
|
|
|
|
resampling method. Linear interpolation is extremely fast, but suffers from
|
|
|
|
poor sound quality especially when used for up-sampling.</DD>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
<P>Example:<BR>
|
|
|
|
<CODE>mplayer -af resample=44100:0:1</CODE></P>
|
|
|
|
|
|
|
|
<P>would set the output frequency of the resample filter to 44100Hz using exact
|
|
|
|
output frequency scaling and linear interpolation.</P>
|
|
|
|
|
|
|
|
|
|
|
|
<H5><A NAME="af_channels">2.3.2.3.2 Changing the number of channels</A></H5>
|
|
|
|
|
|
|
|
<P>The <CODE>channels</CODE> filter can be used for adding and removing
|
|
|
|
channels, it can also be used for routing or copying channels. It is
|
|
|
|
automatically enabled when the output from the audio filter layer differs from
|
|
|
|
the input layer or when it is requested by another filter. This filter unloads
|
|
|
|
itself if not needed. The number of switches is dynamic:</P>
|
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT><CODE>nch</CODE></DT>
|
|
|
|
<DD>is an integer between 1 and 6 that is used for setting the number of
|
|
|
|
output channels. This switch is required, leaving it empty results in a
|
|
|
|
runtime error.</DD>
|
|
|
|
|
|
|
|
<DT><CODE>nr</CODE></DT>
|
|
|
|
<DD>is an integer between 1 and 6 that is used for specifying the number of
|
|
|
|
routes. This parameter is optional. If it is omitted the default routing is
|
|
|
|
used.</DD>
|
|
|
|
|
|
|
|
<DT><CODE>from1:to1:from2:to2:from3:to3...</CODE></DT>
|
|
|
|
<DD>are pairs of numbers between 0 and 5 that define where each channel should
|
|
|
|
be routed.</DD>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
<P>If only <CODE>nch</CODE> is given the default routing is used, it works as
|
|
|
|
follows: If the number of output channels is bigger than the number of input
|
|
|
|
channels empty channels are inserted (except mixing from mono to stereo, then
|
|
|
|
the mono channel is repeated in both of the output channels). If the number of
|
|
|
|
output channels is smaller than the number of input channels the exceeding
|
|
|
|
channels are truncated.</P>
|
|
|
|
|
|
|
|
<P>Example 1:<BR>
|
|
|
|
<CODE>mplayer -af channels=4:4:0:1:1:0:2:2:3:3 media.avi </CODE></P>
|
|
|
|
|
|
|
|
<P>would change the number of channels to 4 and set up 4 routes that swap
|
|
|
|
channel 0 and channel 1 and leave channel 2 and 3 intact. Observe that if
|
|
|
|
media containing two channels was played back, channels 2 and 3 would contain
|
|
|
|
silence but 0 and 1 would still be swapped.</P>
|
|
|
|
|
|
|
|
<P>Example 2:<BR>
|
|
|
|
<CODE>mplayer -af channels=6:4:0:0:0:1:0:2:0:3 media.avi </CODE></P>
|
|
|
|
|
|
|
|
<P>would change the number of channels to 6 and set up 4 routes that copy
|
|
|
|
channel 0 to channels 0 to 3. Channel 4 and 5 will contain silence.</P>
|
|
|
|
|
|
|
|
|
|
|
|
<H5><A NAME="af_format">2.3.2.3.3 Sample format converter</A></H5>
|
|
|
|
|
|
|
|
<P>This filter is a sample format converter. It is automatically enabled when
|
|
|
|
needed by the sound card or another filter.</P>
|
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT><CODE>bps</CODE></DT>
|
|
|
|
<DD>can be 1, 2 or 4 and denotes the number of bytes per sample. This switch
|
|
|
|
is required, leaving it empty results in a runtime error.</DD>
|
|
|
|
|
|
|
|
<DT><CODE>f</CODE></DT>
|
|
|
|
<DD>is a text string describing the sample format. The string is a
|
|
|
|
concatenated mix of: <CODE>alaw</CODE>, <CODE>mulaw</CODE> or
|
|
|
|
<CODE>imaadpcm</CODE>, <CODE>float</CODE> or <CODE>int</CODE>,
|
|
|
|
<CODE>unsigned</CODE> or <CODE>signed</CODE>, <CODE>le</CODE> or
|
|
|
|
<CODE>be</CODE> (little or big endian). This switch is required, leaving it
|
|
|
|
empty results in a runtime error.</DD>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
<P>Example:<BR>
|
|
|
|
<CODE>mplayer media.avi -af format=4:float</CODE></P>
|
|
|
|
|
|
|
|
<P>would set the output output format to 4 bytes per sample floating point
|
|
|
|
data.</P>
|
|
|
|
|
|
|
|
|
|
|
|
<H5><A NAME="af_delay">2.3.2.3.4 Delay</A></H5>
|
|
|
|
|
|
|
|
<P>This filter delays the sound to the loudspeakers in order to make the sound
|
|
|
|
in the different channels arrive at the same time to the listening position.
|
|
|
|
It is only useful if you have more than 2 loudspeakers. This filter has a
|
|
|
|
variable number of parameters:</P>
|
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT><CODE>d1:d2:d3...</CODE></DT>
|
|
|
|
<DD>are floating point numbers representing the delays in ms that should be
|
|
|
|
imposed on the different channels. The minimum delay is 0ms and the maximum
|
|
|
|
is 1000ms.</DD>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
<P>To calculate the required delay for the different channels do as follows:</P>
|
|
|
|
|
|
|
|
<OL>
|
|
|
|
<LI>Measure the distance to the loudspeakers in meters in relation to your
|
|
|
|
listening position, giving you the distances s1 to s5 (for a 5.1 system).
|
|
|
|
There is no point in compensating for the sub-woofer (you will not hear the
|
|
|
|
difference anyway).</LI>
|
|
|
|
<LI>Subtract the distances s1 to s5 from the maximum distance i.e.<BR>
|
|
|
|
s[i] = max(s) - s[i]; i = 1...5</LI>
|
|
|
|
<LI>Calculated the required delays in ms as<BR>
|
|
|
|
d[i] = 1000*s[i]/342; i = 1...5 </LI>
|
|
|
|
</OL>
|
|
|
|
|
|
|
|
<P>Example:<BR>
|
|
|
|
<CODE>mplayer -af delay=10.5:10.5:0:0:7:0 media.avi</CODE></P>
|
|
|
|
|
|
|
|
<P>would delay front left and right by 10.5ms, the two rear channels and the sub
|
|
|
|
by 0ms and the center channel by 7ms.</P>
|
|
|
|
|
|
|
|
|
|
|
|
<H5><A NAME="af_volume">2.3.2.3.5 Software volume control</A></H5>
|
|
|
|
|
|
|
|
<P>This filter is a software volume control. Use this filter with caution since
|
|
|
|
it can reduce the signal to noise ratio of the sound. In most cases it is best
|
|
|
|
to set the level for the PCM sound to max, leave this filter out and control
|
|
|
|
the output level to your speakers with the master volume control of the mixer.
|
|
|
|
If there is an external amplifier connected to the computer (this is almost
|
|
|
|
always the case), the noise level can be minimized by adjusting the master
|
|
|
|
level and the volume knob on the amplifier until the hissing noise in the
|
|
|
|
background is gone. This filter has two switches:</P>
|
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT><CODE>v</CODE></DT>
|
|
|
|
<DD>is a floating point number between -200 and +60 which represents the
|
|
|
|
volume level in dB. The default level is -10dB.</DD>
|
|
|
|
|
|
|
|
<DT><CODE>c</CODE></DT>
|
|
|
|
<DD>is a binary control that turns soft clipping on and off. Soft-clipping can
|
|
|
|
make the sound more smooth if very high volume levels are used. Enable this
|
|
|
|
switch if the dynamic range of the loudspeakers is very low. Be aware that
|
|
|
|
this feature creates distortion and should be considered a last resort.</DD>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
<P>Example:<BR>
|
|
|
|
<CODE>mplayer -af volume=10.1:0 media.avi</CODE></P>
|
|
|
|
|
|
|
|
<P>would amplify the sound by 10.1dB and hard-clip if the sound level is too
|
|
|
|
high.</P>
|
|
|
|
|
|
|
|
<P>This filter has a second feature: It measures the overall maximum sound level
|
|
|
|
and prints out that level when MPlayer exits. This volume estimate can be used
|
|
|
|
for setting the sound level in MEncoder such that the maximum dynamic range is
|
|
|
|
utilized.</P>
|
|
|
|
|
|
|
|
|
|
|
|
<H5><A NAME="af_equalizer">2.3.2.3.6 Equalizer</A></H5>
|
|
|
|
|
|
|
|
<P> This filter is a 10 octave band graphic equalizer, implemented using 10 IIR
|
|
|
|
band pass filters. This means that it works regardless of what type of audio
|
|
|
|
is being played back. The center frequencies for the 10 bands are:</P>
|
|
|
|
|
|
|
|
<TABLE BORDER="0" WIDTH="100%">
|
|
|
|
<TR><TD>Band No.</TD><TD>Center frequency</TD></TR>
|
|
|
|
<TR><TD>0</TD><TD>31.25 Hz</TD></TR>
|
|
|
|
<TR><TD>1</TD><TD>62.50 Hz</TD></TR>
|
|
|
|
<TR><TD>2</TD><TD>125.0 Hz</TD></TR>
|
|
|
|
<TR><TD>3</TD><TD>250.0 Hz</TD></TR>
|
|
|
|
<TR><TD>4</TD><TD>500.0 Hz</TD></TR>
|
|
|
|
<TR><TD>5</TD><TD>1.000 kHz</TD></TR>
|
|
|
|
<TR><TD>6</TD><TD>2.000 kHz</TD></TR>
|
|
|
|
<TR><TD>7</TD><TD>4.000 kHz</TD></TR>
|
|
|
|
<TR><TD>8</TD><TD>8.000 kHz</TD></TR>
|
|
|
|
<TR><TD>9</TD><TD>16.00 kHz</TD></TR>
|
|
|
|
</TABLE>
|
|
|
|
|
|
|
|
<P>If the sample rate of the sound being played back is lower than the center
|
|
|
|
frequency for a frequency band, then that band will be disabled. A known bug
|
|
|
|
with this filter is that the characteristics for the uppermost band are not
|
|
|
|
completely symmetric if the sample rate is close to the center frequency of
|
|
|
|
that band. This problem can be worked around by up-sampling the sound using
|
|
|
|
the resample filter before it reaches this filter. </P>
|
|
|
|
|
|
|
|
<P> This filter has 10 parameters:</P>
|
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT><CODE>g1:g2:g3...g10</CODE></DT>
|
|
|
|
<DD>are floating point numbers between -12 to +12dB representing the gain in
|
|
|
|
dB for each frequency band.</DD>
|
|
|
|
</DL>
|
|
|
|
|
|
|
|
<P>Example:<BR>
|
|
|
|
<CODE>mplayer -af equalizer=11:11:10:5:0:-12:0:5:12:12 media.avi</CODE></P>
|
|
|
|
|
|
|
|
<P>would amplify the sound in the upper and lower frequency region while
|
|
|
|
canceling it almost completely around 1kHz.</P>
|
|
|
|
|
|
|
|
<H5><A NAME="af_panning">2.3.2.3.7 Panning filter </A></H5>
|
|
|
|
|
|
|
|
<P>This filter can be used for mixing the channels arbitrarily. It is basically
|
|
|
|
a combination of the volume control and the channels filter. There are two
|
|
|
|
major uses for this filter: </P>
|
|
|
|
|
|
|
|
<OL>
|
|
|
|
<LI>Down-mixing many channels to only a few, stereo to mono for example.</LI>
|
|
|
|
<LI>Varying the "width" of the center speaker in a surround sound system.</LI>
|
|
|
|
</OL>
|
|
|
|
|
|
|
|
<P>This filter is hard to use, and will require some tinkering before the
|
|
|
|
desired result is obtained. The number of switches for this filter depends on
|
|
|
|
the number of output channels:</P>
|
|
|
|
|
|
|
|
<DL>
|
|
|
|
<DT><CODE>nch</CODE></DT>
|
|
|
|
<DD>is an integer between 1 and 6 and is used for setting the number of output
|
|
|
|
channels. This switch is required, leaving it empty results in a runtime
|
|
|
|
error.</DD>
|
|
|
|
|
|
|
|
<DT><CODE>l00:l01:l02:..l10:l11:l12:...ln0:ln1:ln2:...</CODE></DT>
|
2003-01-04 01:44:20 +00:00
|
|
|
<DD>are floating point values between 0 and 1. <CODE>l[i][j]</CODE> determines
|
|
|
|
how much of input channel j is mixed into output channel i.</DD>
|
2003-01-03 22:29:16 +00:00
|
|
|
</DL>
|
|
|
|
|
|
|
|
<P>Example:<BR>
|
|
|
|
<CODE>mplayer -af pan=1:0.5:0.5 -channels 1 media.avi</CODE></P>
|
|
|
|
|
|
|
|
<P>would down-mix from stereo to mono.</P>
|
|
|
|
|
|
|
|
|
|
|
|
<H2><STRONG>Note: Audio plugins have been deprecated by audio filters and will be
|
|
|
|
removed soon.</STRONG></H2>
|
|
|
|
|
|
|
|
<H4><A NAME="plugins">2.3.2.4 Audio plugins (deprecated)</A></H4>
|
2001-12-23 15:55:11 +00:00
|
|
|
|
2002-10-20 12:20:39 +00:00
|
|
|
<P>MPlayer has support for audio plugins. Audio plugins can be used for
|
2002-02-03 13:03:09 +00:00
|
|
|
changing the properties of the audio data before the sound reaches the sound
|
2002-04-21 15:29:59 +00:00
|
|
|
card. They are enabled using the <CODE>-aop</CODE> switch which takes a
|
|
|
|
<CODE>list=plugin1,plugin2,...</CODE> argument. The <CODE>list</CODE> argument
|
|
|
|
is required and determines which plugins should be used and in which order they
|
2002-08-11 18:27:38 +00:00
|
|
|
should be executed. Example:</P>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
|
|
|
<P> <CODE>mplayer media.avi -aop list=resample,format</CODE></P>
|
|
|
|
|
|
|
|
<P>would run the sound through the resampling plugin followed by the format
|
2002-08-11 18:27:38 +00:00
|
|
|
plugin.</P>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>The plugins can also have switches that change their behavior. These
|
2002-02-03 13:03:09 +00:00
|
|
|
switches are explained in detail in the sections below. A plugin will execute
|
2002-04-21 15:29:59 +00:00
|
|
|
using default settings if its switches are omitted. Here is an example of how
|
2002-08-11 18:27:38 +00:00
|
|
|
to use plugins in combination with plugin specific switches:</P>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
|
|
|
<P> <CODE>mplayer media.avi -aop
|
2002-08-11 18:27:38 +00:00
|
|
|
list=resample,format:fout=44100:format=0x8</CODE></P>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
|
|
|
<P>would set the output frequency of the resample plugin to 44100Hz and the
|
2003-01-03 22:29:16 +00:00
|
|
|
output format of the format plugin to AFMT_U8.</P>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
2002-10-20 12:20:39 +00:00
|
|
|
<P>Currently audio plugins can not be used in MEncoder.</P>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<H5><A NAME="resample">2.3.2.4.1 Up/Downsampling</A></H5>
|
2001-12-23 15:55:11 +00:00
|
|
|
|
2002-10-20 12:20:39 +00:00
|
|
|
<P>MPlayer fully supports up/downsampling of the sound. This plugin can
|
2002-04-21 15:29:59 +00:00
|
|
|
be used if you have a fixed frequency sound card or if you are
|
|
|
|
stuck with an old sound card that is only capable of max 44.1kHz.
|
2003-01-03 22:29:16 +00:00
|
|
|
Whether is usage of this plugin is necessary or not, is <B>autodetected</B>.
|
2002-11-23 21:56:41 +00:00
|
|
|
This plugin has one switch:
|
2002-02-03 13:03:09 +00:00
|
|
|
<CODE>fout</CODE> which is used for setting the desired output sample
|
2002-04-21 15:29:59 +00:00
|
|
|
frequency. It defaults to 48kHz, and is given in
|
2002-08-11 18:27:38 +00:00
|
|
|
<Hz>.</P>
|
2001-12-23 15:55:11 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>Usage:<BR>
|
2002-08-11 18:27:38 +00:00
|
|
|
<CODE>mplayer media.avi -aop list=resample:fout=<required
|
2001-12-23 15:55:11 +00:00
|
|
|
frequency in Hz, like 44100></CODE></P>
|
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>Note that the output frequency should not be scaled up from the default value.
|
|
|
|
Scaling up will cause the audio and video streams to be played in slow motion
|
|
|
|
in addition to audio distortion.</P>
|
2001-12-23 15:55:11 +00:00
|
|
|
|
2002-08-11 18:27:38 +00:00
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<H5><A NAME="surround_decoding">2.3.2.4.2 Surround Sound decoding</A></H5>
|
2002-01-01 18:20:40 +00:00
|
|
|
|
2002-10-20 12:20:39 +00:00
|
|
|
<P>MPlayer has an audio plugin that can decode matrix encoded
|
2002-08-11 18:27:38 +00:00
|
|
|
surround sound. Dolby Surround is an example of a matrix encoded format.
|
|
|
|
Many files with 2 channel audio actually contain matrixed surround sound.
|
|
|
|
To use this feature you need a sound card supporting at least 4 channels.</P>
|
2002-01-01 18:20:40 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>Usage:<BR>
|
2002-08-11 18:27:38 +00:00
|
|
|
<CODE>mplayer media.avi -aop list=surround</CODE></P>
|
2002-01-01 18:20:40 +00:00
|
|
|
|
2002-02-03 13:03:09 +00:00
|
|
|
|
2002-11-13 05:13:51 +00:00
|
|
|
<H5><A NAME="format">2.3.2.3.3 Sample format converter</A></H5>
|
2003-01-03 22:29:16 +00:00
|
|
|
|
|
|
|
<P>If your sound card driver does not support signed 16bit <CODE>int</CODE> data type,
|
2002-04-21 15:29:59 +00:00
|
|
|
this plugin can
|
2002-02-03 13:03:09 +00:00
|
|
|
be used to change the format to one which your sound card can understand. It
|
2002-04-21 15:29:59 +00:00
|
|
|
has one switch, <CODE>format</CODE>, which can be set to one of the numbers
|
|
|
|
found in <CODE>libao2/afmt.h</CODE>. This plugin is hardly ever needed and is
|
|
|
|
intended for advanced users. Keep in mind that this plugin only changes the
|
2002-08-11 18:27:38 +00:00
|
|
|
sample format and not the sample frequency or the number of channels.</P>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>Usage:<BR>
|
2002-02-03 13:03:09 +00:00
|
|
|
<CODE>mplayer media.avi -aop
|
2002-08-11 18:27:38 +00:00
|
|
|
list=format:format=<required output format></CODE></P>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<H5><A NAME="delay">2.3.2.4.4 Delay</A></H5>
|
2002-02-03 13:03:09 +00:00
|
|
|
|
|
|
|
<P>This plugin delays the sound and is intended as an example of how to develop
|
2002-04-21 15:29:59 +00:00
|
|
|
new plugins. It can not be used for anything useful from a users perspective
|
2002-02-03 13:03:09 +00:00
|
|
|
and is mentioned here for the sake of completeness only. Do not use this
|
|
|
|
plugin unless you are a developer.</P>
|
|
|
|
|
2002-08-20 00:33:04 +00:00
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<H5><A NAME="volume">2.3.2.4.5 Software volume control</A></H5>
|
2002-03-02 18:22:44 +00:00
|
|
|
|
|
|
|
<P>This plugin is a software replacement for the volume control, and
|
2002-04-21 15:29:59 +00:00
|
|
|
can be used on machines with a broken mixer device. It can also be
|
2002-10-20 12:20:39 +00:00
|
|
|
used if one wants to change the output volume of MPlayer
|
2002-03-02 18:22:44 +00:00
|
|
|
without changing the PCM volume setting in the mixer. It has one
|
|
|
|
switch <CODE>volume</CODE> that is used for setting the initial
|
|
|
|
sound level. The initial sound level can be set to values between 0
|
2002-03-15 20:36:20 +00:00
|
|
|
and 255 and defaults to 101 which equals 0dB amplification. Use this
|
|
|
|
plugin with caution since it can reduce the signal to noise ratio of
|
|
|
|
the sound. In most cases it is best to set the level for the PCM
|
|
|
|
sound to max, leave this plugin out and control the output level to
|
2002-04-21 15:29:59 +00:00
|
|
|
your speakers with the master volume control of the mixer. If there is an
|
2002-03-15 20:36:20 +00:00
|
|
|
external amplifier connected to the computer (this is almost always
|
|
|
|
the case), the noise level can be minimized by adjusting the master
|
|
|
|
level and the volume knob on the amplifier until the hissing noise
|
2002-08-11 18:27:38 +00:00
|
|
|
in the background is gone.</P>
|
2002-03-02 18:22:44 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>Usage:<BR>
|
2002-03-02 18:22:44 +00:00
|
|
|
<CODE>mplayer media.avi -aop
|
2002-08-11 18:27:38 +00:00
|
|
|
list=volume:volume=<0-255></CODE></P>
|
2002-03-02 18:22:44 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>This plugin also has compressor or "soft-clipping" capabilities.
|
2002-03-15 20:36:20 +00:00
|
|
|
Compression can be used if the dynamic range of the sound is very
|
|
|
|
high or if the dynamic range of the loudspeakers is very
|
2002-04-21 15:29:59 +00:00
|
|
|
low. Be aware that this feature creates distortion and should be
|
2002-08-11 18:27:38 +00:00
|
|
|
considered a last resort.</P>
|
2002-03-15 20:36:20 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>Usage:<BR>
|
2002-03-15 20:36:20 +00:00
|
|
|
<CODE>mplayer media.avi -aop
|
2002-08-11 18:27:38 +00:00
|
|
|
list=volume:softclip</CODE></P>
|
2002-03-03 16:47:04 +00:00
|
|
|
|
2002-03-15 22:14:26 +00:00
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<H5><A NAME="extrastereo">2.3.2.4.6 Extrastereo</A></H5>
|
2002-03-03 16:47:04 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>This plugin (linearly) increases the difference between left and right
|
|
|
|
channels (like the XMMS extrastereo plugin) which gives some sort of "live"
|
2002-08-11 18:27:38 +00:00
|
|
|
effect to playback.</P>
|
2002-03-03 16:47:04 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>Usage:<BR>
|
2002-03-03 16:47:04 +00:00
|
|
|
<CODE>mplayer media.avi -aop list=extrastereo</CODE><BR>
|
|
|
|
<CODE>mplayer media.avi -aop list=extrastereo:mul=3.45</CODE></P>
|
|
|
|
|
|
|
|
<P>The default coefficient (<CODE>mul</CODE>) is a float number that defaults
|
2002-04-21 15:29:59 +00:00
|
|
|
to 2.5. If you set it to 0.0, you will have mono sound (average of both
|
2002-06-02 19:06:11 +00:00
|
|
|
channels). If you set it to 1.0, sound will be unchanged, if you set it to
|
|
|
|
-1.0, left and right channels will be swapped.</P>
|
2002-03-03 16:47:04 +00:00
|
|
|
|
2002-03-15 22:14:26 +00:00
|
|
|
|
2003-01-03 22:29:16 +00:00
|
|
|
<H5><A NAME="normalizer">2.3.2.4.7 Volume normalizer</A></H5>
|
2002-03-15 22:14:26 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>This plugin maximizes the volume without distorting the sound.</P>
|
2002-03-15 22:14:26 +00:00
|
|
|
|
2002-04-21 15:29:59 +00:00
|
|
|
<P>Usage:<BR>
|
2002-03-15 22:14:26 +00:00
|
|
|
<CODE>mplayer media.avi -aop list=volnorm</CODE><BR>
|
|
|
|
|
2002-04-20 07:02:36 +00:00
|
|
|
|
2001-08-21 21:01:54 +00:00
|
|
|
</BODY>
|
|
|
|
</HTML>
|