[MPlayer-users] auto-select alsa-output plugin according to decodec channels?

Ivo ivop at euronet.nl
Sat Feb 3 13:59:45 CET 2007


On Friday 02 February 2007 19:16, Markus Schulz wrote:
> It would be nice if mplayer follows this way:
> - decoder reports 2 channels
> -> select alsa:device=default
>
> - decoder reports 4 channels
> -> select alsa:device=surround40
>
> - decoder reports 6 channels
> -> selec alsa:device=surround51
>
> and so on.
>
> It this currently possible or perhaps doable as a future enhancement?

Perhaps.

> Currently i must start with -v to see how many channels the file has
>  and restart with correct parameters. This is poor scriptable and time
>  consuming.

You might try:

i=`mplayer -ao null -vo null -frames 1 -identify fubar.avi | grep 
ID_AUDIO_NCH | tail -n 1 | cut -d '=' -f 2`
case "$i" in
	2)	;;
	4)	;;
	6)	;;
	*)	;;
esac

et cetera...

--Ivo



More information about the MPlayer-users mailing list