[MPlayer-users] Using parameters based on file extention or codec used

Krzysztof Duchnowski amidk75 at gmail.com
Fri Aug 31 21:42:50 CEST 2007


infernix pisze:

> Two examples:

> - DTS audio requires me to supply mplayer the correct channel mapping 
> when playing back 6 channels, e.g. -af 
> channels=6:6:0:4:1:0:2:1:3:2:4:3:5:5. Seeing as this can be in various 
> containers, I'd like to activate this whenever ffdca is used.

> - EVO files with H264 streams need the -psprobe 5000000 parameter to get 
> parsed properly, so if a filename ends in evo or EVO I'd like to have it 
> activate this.

> If this isn't possible, does anyone have any alternative options?

edit ~/.mplaye/config to that:

[evofile]
profile-desc="for EVO h264 encoded files"
psprobe=5000000

[dts6ch]
profile-desc="DTS 6ch mapping"
af=channels=6:6:0:4:1:0:2:1:3:2:4:3:5:5

[default]



then make "/usr/bin/amplayer" script and chmod it:

#!/bin/bash
mplayer -frames 1 -endpos 1 -identify -ao null -vo null "$1" > 
/tmp/media.status
_container=$(cat "/tmp/media.status" | fgrep ID_FILENAME | sed -e 
's/ID_FILENAME=//' -e 's/^\(.*\)\.\(...\)/\2/' -e 's/.*/\L&/')
_demuxer=$(cat "/tmp/media.status" | fgrep ID_DEMUXER | sed -e 
's/ID_DEMUXER=//' -e 's/.*/\L&/')
_vformat=$(cat "/tmp/media.status" | fgrep ID_VIDEO_FORMAT | sed -e 
's/ID_VIDEO_FORMAT=//' -e 's/.*/\L&/')
_vcodec=$(cat "/tmp/media.status" | fgrep ID_VIDEO_CODEC | sed -e 
's/ID_VIDEO_CODEC=//' -e 's/.*/\L&/')
_aformat=$(cat "/tmp/media.status" | fgrep ID_AUDIO_FORMAT | sed -e 
's/ID_AUDIO_FORMAT=//' -e 's/.*/\L&/')
_acodec=$(cat "/tmp/media.status" | fgrep ID_AUDIO_CODEC | sed -e 
's/ID_AUDIO_CODEC=//' -e 's/.*/\L&/')
_achannel=$(cat "/tmp/media.status" | fgrep ID_AUDIO_NCH | sed -e 
's/ID_AUDIO_NCH=//')
#printf "\n\nContainer\t: $_container\nDemuxer\t\t: $_demuxer\nVideo 
format\t: $_vformat\nVideo decoder\t: $_vcodec\nAudio format\t: 
$_aformat\nAudio decoder\t: $_acodec\n\n\n"
if [ "$_acodec"=="dts" ] && [ "$_achannel"=="6" ]; then
     mplayer -profile dts6ch "$1"
elif [ "$_container"=="evo" ]; then
     mplayer -profile evofile "$1"
else
     mplayer "$1"
fi



-- 
Krzysztof 'DK75' Duchnowski
GetFirefox - http://www.mozilla.com/firefox/
Konfiguracja UTF-8 dla czytników - http://evil.pl/pip/utf/



More information about the MPlayer-users mailing list