[MPlayer-dev-eng] [PATCH] select the number of channels to save with -ao pcm

Giacomo Comes comes at naic.edu
Tue Oct 11 17:34:10 CEST 2005


On Tue, Oct 11, 2005 at 04:13:24PM +0200, Guillaume POIRIER wrote:
> Hi,
> 
> On 10/7/05, Giacomo Comes <comes at naic.edu> wrote:
> > I was looking for a solution to extract a particular channel from a
> > multichannel audio stream (tipically ac3).
> >
> > I found a way to listen to a specific channel with:
> >
> > mplayer dvd://1 -channels 6 -af channels=1:1:4:0 (center channel)
> >
> > but when I tryed to save the channel adding -ao pcm, all the six channels
> > where saved.
> >
> > I created therefore a patch that allow to specify the number of channels
> > you want to save with -ao pcm.
> >
> > Example:
> >
> > mplayer dvd://1 -channels 6 -af channels=1:1:4:0 -ao pcm:channels=1
> > (save only the center channels)
> >
> > mplayer dvd://1 -channels 6 -af channels=2:2:2:0:3:1 -ao pcm:channels=2
> > (save only the surround channels)
> >
> > If the patch will be applied I will also include a man page update.
> >
> > Comments?
> 
> Wouldn't it be much better if your patch could fix the "misbehaviour"
> of MPlayer when considering that precise problem? ... or would it
> require a dirty hack?

I don't think there is a "misbehaviour". If you have a ac3 6 channels stream
you need to supply the option -channels 6 otherwise liba52 will downmix
and therefore you cannot select anymore the appropriate channel you are intrested in.
And once you have supplied the option -channels 6 then -ao pcm will save
all the 6 channels.

May be there is be another way to achive what I want, but I have no
idea how to do it and the patch is really simple.

Giacomo




More information about the MPlayer-dev-eng mailing list