Mplayer vdpau script

From MultimediaWiki
Revision as of 19:32, 15 December 2010 by Ce (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

NOTE: MPlayer filters work fine with -vo vdpau (and using it allows you for example to enable de-interlacing at any time), so this script does not look useful and no bug-reports will be accepted for it!

A little bash script to select -vo xv if there is also a -vf switch in mplayer command line. Useful due to vdpau problems with video filters - these may in fact be caused by the ff*vdpau codecs, but I know of no way to easily disable the codecs without disabling the output driver, but not permanently.

Obviously paths are hardcoded; change to suit your system.

#!/bin/bash

usevdpau=1

for arg in $@; do
  if [ "$arg" = "-vf" ]; then
    usevdpau=0
  fi
done

if [ "$usevdpau" = "0" ]; then
  /usr/bin/mplayer -vo xv "$@"
else
  /usr/bin/mplayer -vo vdpau "$@"
fi

Script by Muzer