LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   MPlayer with VDPAU support. For users with Nvidia cards (https://www.linuxquestions.org/questions/slackware-14/mplayer-with-vdpau-support-for-users-with-nvidia-cards-763614/)

Daedra 10-22-2009 12:18 AM

MPlayer with VDPAU support. For users with Nvidia cards
 
I just thought I would share this in case anybody hadn't heard about it. With Nvidia's never drivers they have implemented vdpau support. vdpau basically takes hi-definition video (720p, 1080p, etc) and passes off the processing to the video card gpu instead of your cpu thus freeing up your cpu for other tasks, this is especially useful for mythtv users and htpc's. Unfortunately I learned through trail and error that this is not as straight forward as I had hoped but now that I got it working I thought I would share my steps.

Before you start thought make sure you have a nvidia card that supports vdpau, here is a compatibility list http://www.mythtv.org/wiki/VDPAU#Supported_Cards I'm not sure how current this list is but basically any card from the geforce 8 and series and on should work.

1) Install nvidia's proprietary binary video driver. I am not going to write a howto for this since there are dozens of posts on the forums for this. Once this is installed and working correctly proceed to step two.

2) Ignore (deleted)

3) you need to recompile MPlayer for vdpau support, There are a few issues here that I have worked out that I want to explain first. I used the MPlayer slackbuild from the official release. However Slackware ships an older version of MPlayer than we need so we need to update the build to a newer version. Unfortunately I learned that the MPlayer developers have dropped there GUI support so building a newer mplayer will not have gui support, its ok we'll fix this in step 4. You can find a modified slackbuild here http://webpages.charter.net/daedra/MPlayer.tar.gz by default this will not build patented code, you need to enable patents "YES" to get support for patented code. Here is a post about the mplayer GUI http://lists.mplayerhq.hu/pipermail/...ne/061715.html

4) Now that we have a new MPlayer and installed working, we need to add a GUI. I am recommending gnome-mplayer because it works very well and you can also add on gecko-mediaplayer plugins to work with it, more on that later. To install gnome-mplayer you can just use the build over at slackbuilds.org, just make sure to change the slackbuild to use the newest version of 0.9.8. here is the link for gnome-mplayer http://slackbuilds.org/repository/12...gnome-mplayer/ and the source http://gnome-mplayer.googlecode.com/...r-0.9.8.tar.gz Once its installed launch the program either from command line "gnome-mplayer" or from your launcher. Were almost done we just to change a few options. Under preferences change video output to vdpau and audio output to alsa. Also under mplayer tab enable software volume control unless your soundcard has a hardware mixer.

Now download a test clip from here http://www.h264info.com/clips.html

If your using KDE then run "System Monitor", once the program is running then open "gnome-mplayer" and launch your downloaded test video. if your system monitor shows mplayer cpu usage at 10% or less then vdpau is working correctly, here is a screen shot of it in action, the pic looks wrong but it's just the screenshot http://webpages.charter.net/daedra/1.jpg

Before the cpu usage was around 40%, so as you can see thats a huge improvement.

5) (Optional) Once you have all the steps above working if you want you can now install the gecko-media player plugins, this is basically the mplayerplug-in package that is available in the Slackware /extra directory, however that has been depreciated for a while, the developer has switched to gecko media player plugin. I have made a slackbuild for the newest version available here http://webpages.charter.net/daedra/g...aplayer.tar.gz

Quick note = If you decided to install gecko-media package but don't want to use my build then just know that gecko will use the seamonkey libraries to build the plugin and install then to the seamoney plugins directory so it will not work with firefox, if you use my build you won't have this problem.


We'll thats all, if I missed anything or have any questions please let us know.

slackd 10-22-2009 01:01 AM

I implemented vdpau using mplayer svn when i started using slackware13. i use smplayer as a front-end for mplayer.

* - i don't like gnome-mplayer.

- I customized pat's slackbuild from the DVD and recompiled mplayer.
Code:

./configure --prefix=/usr \
            --mandir=/usr/man \
            --confdir=/etc/mplayer \
            --enable-gui \
            --enable-menu \
            --enable-largefiles \
            --enable-vdpau \
            --disable-arts \
            --codecsdir=${CODECSDIR} \
            --win32codecsdir=${CODECSDIR} \
            --realcodecsdir=${CODECSDIR} \
            --language="${LANGUAGES}" \
            ${EXTRACONFIGUREOPTIONS} \
            ${DO_PATENTED} \
            2>&1 | tee $OUTPUT/configure-${PRGNAM}.log

- I used the closed source nvidia driver <190.42>
- I used smplayer v0.6.8 (supports vdpau fully, doesn't need extra arguments against mplayer exec)

btw...good work on the tutorial, am sure people will find it useful.

EDIT: CPU Usage while playing 720p video = 1-3%
CPU Usage while playing 1080p video = 3-7%

Daedra 10-22-2009 01:42 AM

good to know, I could never get it to work without the libvdpau package, are you using that? or did you get it to work without it?

slackd 10-22-2009 01:52 AM

Quote:

Originally Posted by Daedra (Post 3728130)
good to know, I could never get it to work without the libvdpau package, are you using that? or did you get it to work without it?

nope i did not use the libvdpau package.

There are three VDPAU (Video Decode and Presentation API for Unix-like systems) libraries:
*-The top-level wrapper (/usr/X11/lib64/libvdpau.so.x.y.z),
*- a debug trace library (/usr/X11/lib64/libvdpau_trace.so.x.y.z),
*- and the NVIDIA implementation (/usr/X11/lib64/libvdpau_nvidia.so.x.y.z).

Code:

sam@Sam:/usr/X11/lib64$ ls -l | grep libvdpau
lrwxrwxrwx  1 root root      13 2009-10-22 08:27 libvdpau.so -> libvdpau.so.1*
lrwxrwxrwx  1 root root      18 2009-10-22 08:27 libvdpau.so.1 -> libvdpau.so.190.42*
-rwxr-xr-x  1 root root    5016 2009-10-22 08:27 libvdpau.so.190.42*
lrwxrwxrwx  1 root root      25 2009-10-22 08:27 libvdpau_nvidia.so -> libvdpau_nvidia.so.190.42*
-rwxr-xr-x  1 root root  1458192 2009-10-22 08:27 libvdpau_nvidia.so.190.42*
lrwxrwxrwx  1 root root      24 2009-10-22 08:27 libvdpau_trace.so -> libvdpau_trace.so.190.42*
-rwxr-xr-x  1 root root    49896 2009-10-22 08:27 libvdpau_trace.so.190.42*

did u read :this:

Daedra 10-22-2009 01:58 AM

Thanks for that, I going to go back and look at this, if it works without libvdpau then whats the point of that step. Thanks for the heads up.

slackd 10-22-2009 02:04 AM

the libs came automatically with the nvidia driver. i did not use a single extra package. try the latest .run from nvidia.

hey!..i just remembered..get the ffmpeg package with vdpau support. (kudos, Eric!)
Code:

ffmpeg: updated to r20056 snapshot (20090927). The x264 and gsm codecs were
  updated to their latest version as well. This ffmpeg has support for VDPAU
  (gpu-accelerated video decoding on recent Nvidia hardware) but I have not
  tested that.
  Note: as usual, this package comes without the patent/license encumbered
  LAME and FAAC libraries (meaning, you can not encode mp3 or aac, but you can
  playback these formats). Just rebuild the package and those will be
  automatically added.


Daedra 10-22-2009 02:18 AM

Your right, I upgrade ffmpeg using Eric's slackbuild and it worked without using the libvdpau package.

slackd 10-22-2009 02:39 AM

Congratulations! Buddy, Enjoy now!..

remember to disable Composite by running nvidia-xconfig utility.

Code:

sam@Sam:~$ cat /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder58)  Wed Sep  2 03:36:10 PDT 2009


Section "ServerLayout"
    Identifier    "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    FontPath        "/usr/lib64/X11/fonts/misc/:unscaled"
    FontPath        "/usr/lib64/X11/fonts/100dpi/:unscaled"
    FontPath        "/usr/lib64/X11/fonts/75dpi/:unscaled"
    FontPath        "/usr/lib64/X11/fonts/misc/"
    FontPath        "/usr/lib64/X11/fonts/Type1/"
    FontPath        "/usr/lib64/X11/fonts/Speedo/"
    FontPath        "/usr/lib64/X11/fonts/100dpi/"
    FontPath        "/usr/lib64/X11/fonts/75dpi/"
    FontPath        "/usr/lib64/X11/fonts/cyrillic/"
    FontPath        "/usr/lib64/X11/fonts/TTF/"
EndSection

Section "InputDevice"

    # generated from default
    Identifier    "Mouse0"
    Driver        "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/psaux"
    Option        "Emulate3Buttons" "no"
    Option        "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier    "Keyboard0"
    Driver        "kbd"
EndSection

Section "Monitor"
    Identifier    "Monitor0"
    VendorName    "Unknown"
    ModelName      "Unknown"
    HorizSync      28.0 - 33.0
    VertRefresh    43.0 - 72.0
    Option        "DPMS"
EndSection

Section "Device"
    Identifier    "Device0"
    Driver        "nvidia"
    VendorName    "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier    "Screen0"
    Device        "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option        "RenderAccel" "True"
    Option        "NoRenderExtension" "False"
    Option        "AllowGLXWithComposite" "True"
    Option        "MultisampleCompatibility" "True"
    Option        "AddARGBGLXVisuals" "True"
    Option        "MultiGPU" "Auto"
    Option        "Coolbits" "4"
    SubSection    "Display"
        Depth      24
    EndSubSection
EndSection

Section "Extensions"
    Option        "Composite" "Disable"
EndSection


Daedra 10-22-2009 02:46 AM

cant do that, I like my compiz fusion too much :).

vinegaroon 10-22-2009 03:11 AM

Thanks for this. I've been meaning to get this working.

slackd 10-22-2009 03:51 AM

Quote:

Originally Posted by Daedra (Post 3728192)
cant do that, I like my compiz fusion too much :).

ok..i see.

actually when i used xfce i had tearing issues with the display compositor and i had to set it to "enable". now that i use fluxbox, i set it to "disable".

Daedra 10-22-2009 04:04 AM

Quote:

Originally Posted by slackd (Post 3728236)
ok..i see.

actually when i used xfce i had tearing issues with the display compositor and i had to set it to "enable". now that i use fluxbox, i set it to "disable".

Did you have vsync enabled?

slackd 10-22-2009 04:11 AM

Quote:

Originally Posted by Daedra (Post 3728248)
Did you have vsync enabled?

yes, but that did not solve the problem. then i turned on composite.
that reduced the tearing significantly, but i finally solved it by turning off the compositor that comes with xfce.

the problem went away completely when i started using fluxbox, i couldn't care less about xfce now.

**however, i never had the problem in kde4 & compiz**

H_TeXMeX_H 10-22-2009 04:41 AM

It seems that when I build mplayer it automatically enables vdpau, I didn't have to tell it anything.

Daedra 10-22-2009 04:56 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 3728285)
It seems that when I build mplayer it automatically enables vdpau, I didn't have to tell it anything.

I'm pretty sure your right, the reason I edited the build myself is because of the info I got in this post. http://www.linuxquestions.org/questi...mpile.-757310/

slackd 10-22-2009 05:37 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 3728285)
It seems that when I build mplayer it automatically enables vdpau, I didn't have to tell it anything.

well, i didn't know that.

ppr:kut 10-23-2009 01:22 AM

bringing some light to the "do we need libvdpau?" question.
libvdpau was recently splitted from the binary nvidia graphics driver, and is now available as separate download from freedesktop.org.
However, for now the very same version is still included in the graphics driver package, but will be removed from there at some point.
The stand-alone library is vendor-independent code, which means it is not tide to nvidia cards in any way, and is everything applications need to compile VDPAU-enabled versions.
For SBo users this means that as soon as the 190.x series is declared stable I'll push my updated SlackBuilds for the nvidia-driver / -kernel scripts, which will no longer include the libvdpau library. This one will be submitted as a separate build script, together with vdpauinfo.
So, basic answer, yes you will need libvdpau, sooner or later.

vinegaroon 10-23-2009 02:09 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 3728285)
It seems that when I build mplayer it automatically enables vdpau, I didn't have to tell it anything.

Strange that the official Slackware MPlayer doesn't have it enabled then...

ppr:kut 10-23-2009 02:21 AM

Quote:

Originally Posted by vinegaroon (Post 3729493)
Strange that the official Slackware MPlayer doesn't have it enabled then...

MPlayer enables options automatically, when the needed libraries are available in the system. Slackware doesn't ship libvdpau, so vdpau is disabled.

vinegaroon 10-23-2009 02:49 AM

Quote:

Originally Posted by ppr:kut (Post 3729500)
MPlayer enables options automatically, when the needed libraries are available in the system. Slackware doesn't ship libvdpau, so vdpau is disabled.

Ah ok. Thanks for the info.

slackd 10-23-2009 03:10 AM

Quote:

Originally Posted by ppr:kut (Post 3729500)
MPlayer enables options automatically, when the needed libraries are available in the system. Slackware doesn't ship libvdpau, so vdpau is disabled.

saw that..just rebuild the new package(-current-r29789) with vdpau enabled , its working flawlessly with smplayer.

try it "Daedra".

Daedra 10-23-2009 04:27 AM

I just tried the newest build and it failed with a specific error with vdpau, so I installed the libvdpau package and it compiled successfully. Even the old gui is working again.

slackd 10-23-2009 04:31 AM

Quote:

Originally Posted by Daedra (Post 3729592)
I just tried the newest build and it failed with a specific error with vdpau, so I installed the libvdpau package and it compiled successfully. Even the old gui is working again.

Strange...i used this slackbuild. modified it myself..try it and see.

Code:

#!/bin/sh

# Copyright 2006, 2007, 2008, 2009  Eric Hameleers, Eindhoven, NL
# Copyright 2009  Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
#  Permission to use, copy, modify, and distribute this software for
#  any purpose with or without fee is hereby granted, provided that
#  the above copyright notice and this permission notice appear in all
#  copies.
#
#  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
#  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
#  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
#  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
#  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
#  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
#  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
#  SUCH DAMAGE.
# -----------------------------------------------------------------------------
#
# Slackware SlackBuild script
# ===========================
# By:        Eric Hameleers <alien@slackware.com>
# For:      MPlayer
# Descr:    a movie player for LINUX
# URL:      http://www.mplayerhq.hu/
# -----------------------------------------------------------------------------

PRGNAM=MPlayer
VERSION=${VERSION:-r29789}
ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-2}
TAG=${TAG:-}

DOCS="AUTHORS Changelog Copyright LICENSE README DOCS/HTML-single DOCS/tech"

DEFSKIN=${DEFSKIN:-"Blue"}  # Download more skins at the following url:
SKINVER=${SKINVER:-"1.7"}  # http://www.mplayerhq.hu/design7/dload.html

# Available languages: all bg cs de dk el en es fr hu it ja
# ko mk nb nl pl ro ru sk sv tr uk pt_BR zh_CN zh_TW
LANGUAGES="en nl fr de es"  # The default is to just add "en" documentation

if [ "$ARCH" = "x86_64" ]; then
  LIBDIRSUFFIX="64"
  # --enable-runtime-cpudetection is supported only for x86, x86_64, and PPC
  EXTRACONFIGUREOPTIONS="--enable-runtime-cpudetection"
elif [ "$ARCH" = "i486" -o \
      "$ARCH" = "i586" -o \
      "$ARCH" = "i686" ]; then
  LIBDIRSUFFIX=""
  EXTRACONFIGUREOPTIONS="--enable-runtime-cpudetection"
else
  LIBDIRSUFFIX=""
  EXTRACONFIGUREOPTIONS=""
fi

CODECSDIR=/usr/lib${LIBDIRSUFFIX}/codecs  # Where the WIN32 codecs are expected for instance

# ---------------------------------------------------------------------------
# -- PATENT ALERT! --
# MPlayer source contains an internal copy of 'libdvdcss' for reading DVD's.
# This is considered illegal software in some countries.
# Also, MPLayer can be built with MP3 (lame) and AMR audio encoders
# (needed for FLV and .3GP videos) but these libraries are 'contaminated'
# with patents from Fraunhofer and GGP.
# Also, the AAC encoder has patent issues.
# The Slackware package is built with "USE_PATENTS=NO" i.e. without using
# the lame mp3, faac, AMR and dvdcss libraries.
# This also means that this creates a version of MPlayer that is unable
# to play encrypted DVD's (which is most DVD's on the market). If it is
# allowed in your country to use libdvdcss, this is not a big problem though.
# Install a libdvdcss package and it will be picked up automatically by
# MPlayer's internal libdvdread library, so that MPlayer will again be able
# to play encrypted DVD's.
#
# If you have licenses to use the code, and/or the patents do not apply in
# your region, and you take all legal responsibility, you may wish to build
# MPlayer with the option USE_PATENTS=YES which will include potentially
# patent-encumbered code.
# ---------------------------------------------------------------------------
USE_PATENTS=${USE_PATENTS:-"YES"}

# MPlayer will try to use one of the TrueType fonts present on the target
# system for it's On Screen Display (OSD) font.
# Slackware 11.0 ships with the Vera and DejaVu fonts, you may want to add
# more fonts to this list. The first font found will be used by creating a
# symbolic link "/usr/share/mplayer/subfont.ttf" to it.
# The use of bitmapped fonts is considered deprecated, but you can still use
# those if you want. Read http://www.mplayerhq.hu/DOCS/HTML/en/fonts-osd.html
# if you want to know more about OSD font configuration.
OSDFONTS="LiberationSans-Regular.ttf \
          Arialuni.ttf arial.ttf \
          DejaVuSans.ttf Vera.ttf"

# We will work with a stripped-down source tarball, not containing libdvdcss:
[ "$USE_PATENTS" != "YES" ] && EXTRA="_nolibdvdcss" || EXTRA=""

# Where do we look for sources?
SRCDIR=$(cd $(dirname $0); pwd)

SOURCE[0]="$SRCDIR/${PRGNAM}${EXTRA}-${VERSION}.tar.bz2"
SRCURL[0]=""

# The default skin to use (we need to add at least one)
SOURCE[1]="$SRCDIR/${DEFSKIN}-${SKINVER}.tar.bz2"
SRCURL[1]="http://www.mplayerhq.hu/MPlayer/skins/${DEFSKIN}-${SKINVER}.tar.bz2"

# Use the src_checkout() function if no downloadable tarball exists.
# This function checks out sources from SVN/CVS and creates a tarball of them.
src_checkout() {
  # Param #1 : index in the SOURCE[] array.
  # Param #2 : full path to where SOURCE[$1] tarball should be created.
  # Determine the tarball extension:
  PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.xz|tar.gz|tar.bz2|tgz).*/\1/')
  case "$PEXT" in
    "tar.xz") TARCOMP="J" ;;
    "tar.gz") TARCOMP="z" ;;
    "tgz") TARCOMP="z" ;;
    "tar.bz2") TARCOMP="j" ;;
    *) echo "Archive can only have extension 'tar.xz', '.tar.gz' '.tar.bz2' or '.tgz'" ; exit 1 ;;
  esac
  case ${1} in
  0) # mplayer
    if [ "$(echo ${VERSION}|cut -c1)" == 'r' ]; then # revision instead of date
      REV=$(echo ${VERSION} | cut -c2-)
    else
      REV="{${VERSION}}"
    fi
    mkdir MPlayer-${VERSION} \
      && cd MPlayer-${VERSION} \
      && svn checkout  --revision $REV svn://svn.mplayerhq.hu/mplayer/trunk . \
      && find . -type d -name '.svn' -depth | xargs rm -rf \
      && ([ "$USE_PATENTS" != "YES" ] && rm -rf libdvdcss || true) \
      && chown -R root:root . \
      && cd .. \
      && tar -${TARCOMP}cf ${2} MPlayer-${VERSION}
    rm -rf MPlayer-${VERSION}
    ;;
  *) # Do nothing
    ;;
  esac
}

# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
TMP=${TMP:-/tmp/build}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

##
## --- with a little luck, you won't have to edit below this point --- ##
##

# Exit the script on errors:
set -e
trap 'echo "$0 FAILED at line $LINENO!" | tee $OUTPUT/error-${PRGNAM}.log' ERR
# Catch unitialized variables:
set -u
P1=${1:-1}

# Create working directories:
mkdir -p $TMP/tmp-$PRGNAM # location to build the source
rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
mkdir -p $PKG            # place for the package to be built
rm -rf $PKG/*            # erase old package's contents
mkdir -p $OUTPUT          # place for the package to be saved

# Source file availability:
for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
  if ! [ -f ${SOURCE[$i]} ]; then
    echo "Source '$(basename ${SOURCE[$i]})' not available yet..."
    # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT
    [ -w "$SRCDIR" ] || SOURCE[$i]="$OUTPUT/$(basename ${SOURCE[$i]})"
    if ! [ "x${SRCURL[$i]}" == "x" ]; then
      echo "Will download file to $(dirname $SOURCE[$i])"
      wget -nv -T 20 -O "${SOURCE[$i]}" "${SRCURL[$i]}" || true
      if [ $? -ne 0 -o ! -s "${SOURCE[$i]}" ]; then
        echo "Downloading '$(basename ${SOURCE[$i]})' failed.. aborting the build."
        mv -f "${SOURCE[$i]}" "${SOURCE[$i]}".FAIL
        exit 1
      fi
    else
      # Try if we have a SVN/CVS download routine for ${SOURCE[$i]}
      echo "Will checkout sources to $(dirname $SOURCE[$i])"
      src_checkout $i "${SOURCE[$i]}" 2>&1 > $OUTPUT/checkout-$(basename ${SOURCE[$i]}).log
    fi
    if [ ! -f "${SOURCE[$i]}" -o ! -s "${SOURCE[$i]}" ]; then
      echo "File '$(basename ${SOURCE[$i]})' not available.. aborting the build."
      exit 1
    fi
  fi
done

if [ "$P1" == "--download" ]; then
  echo "Download complete."
  exit 0
fi

# --- PACKAGE BUILDING ---

echo "++"
echo "|| $PRGNAM-$VERSION"
echo "++"

# Warn about libdvdread requirement:
if [ "$USE_PATENTS" != "YES" ]; then
  cat <<"EOT"
**
** Removing internal DeCSS library.
** If you want to play encrypted DVD's you need to install libdvdcss separately.
** You take full legal responsibility for any use of DeCSS.  We neither supply
** DeCSS code nor endorse any illegal use of it.
**
** If you are unaffected by patent concerns because you hold the required
** licenses and permission to use the patented code, or reside in a
** location where this is not a concern, and wish to include the patented
** and restricted code (you take all legal responsibility for doing so),
** then edit this SlackBuild script and change the line:
** USE_PATENTS=${USE_PATENTS:-"NO"}
** to:
** USE_PATENTS="YES"
**
EOT
  sleep 5
fi

cd $TMP/tmp-$PRGNAM
echo "Extracting the source archive(s) for $PRGNAM..."
tar -xvf ${SOURCE[0]}
[ "$USE_PATENTS" != "YES" ] && rm -rf libdvdcss
chown -R root:root *
chmod -R u+w,go+r-w,a-s *
cd ${PRGNAM}-${VERSION}

# Determine what X we're running (the modular X returns the prefix
# in the next command, while older versions stay silent):
XPREF=$(pkg-config --variable=prefix x11) || true
[ "$XPREF" == "" ] && XPREF='/usr/X11R6'

# Remove support for patent encumbered and possibly illegal code:
if [ "$USE_PATENTS" != "YES" ]; then
  DO_PATENTED="--disable-libdvdcss-internal \
              --disable-mp3lame --disable-mp3lame-lavc \
              --disable-faac --disable-faac-lavc \
              --disable-libamr_nb --disable-libamr_wb"
else
  DO_PATENTED=""
fi

echo Building ...
# MPlayer wants to automatically determine compiler flags,
# so we don't provide CFLAGS:
./configure --prefix=/usr \
            --mandir=/usr/man \
            --confdir=/etc/mplayer \
            --enable-gui \
            --enable-vdpau \
            --enable-menu \
            --enable-largefiles \
            --disable-arts \
            --codecsdir=${CODECSDIR} \
            --win32codecsdir=${CODECSDIR} \
            --realcodecsdir=${CODECSDIR} \
            --language="${LANGUAGES}" \
            ${EXTRACONFIGUREOPTIONS} \
            ${DO_PATENTED} \
            2>&1 | tee $OUTPUT/configure-${PRGNAM}.log
# So that MPlayer does not report "UNKNOWN" as it's version:
echo $VERSION > VERSION
make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log
make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log

# Build the html documentation (not all languages are available):
( cd DOCS/xml
  for i in $(echo $LANGUAGES | tr , ' ') ; do
    [ -d $i ] && make html-single-$i ;
  done
)

# Prepare the configfile:
mkdir -p $PKG/etc/mplayer
cp etc/example.conf $PKG/etc/mplayer/mplayer.conf.new

# Install our default skin:
cd $PKG/usr/share/mplayer/skins
tar -xvf ${SOURCE[1]}
chown -R root:root *
chmod -R u+w,go+r-w,a-s *
ln -s ${DEFSKIN} default
cd -

# Add this to the doinst.sh:
! [ -d $PKG/install ] && mkdir -p $PKG/install
cat <<EOINS >> $PKG/install/doinst.sh
# Handle the incoming configuration files:
config() {
  for infile in \$1; do
    NEW="\$infile"
    OLD="\`dirname \$NEW\`/\`basename \$NEW .new\`"
    # If there's no config file by that name, mv it over:
    if [ ! -r \$OLD ]; then
      mv \$NEW \$OLD
    elif [ "\`cat \$OLD | md5sum\`" = "\`cat \$NEW | md5sum\`" ]; then
      # toss the redundant copy
      rm \$NEW
    fi
    # Otherwise, we leave the .new copy for the admin to consider...
  done
}

# Installing a bitmap font is considered deprecated; use a TTF font instead.
# We try to link to an installed TTF font at install time.
# Configure a default TrueType font to use for the OSD :
if [ ! -f usr/share/mplayer/subfont.ttf ]; then
  for font in ${OSDFONTS}; do
    if [ -f .${XPREF}/lib${LIBDIRSUFFIX}/X11/fonts/TTF/\${font} ]; then
      ( cd usr/share/mplayer/
        ln -sf ${XPREF}/lib${LIBDIRSUFFIX}/X11/fonts/TTF/\${font} subfont.ttf
      )
      break
    fi
  done
fi

# Prepare the new configuration file
config etc/mplayer/mplayer.conf.new

if [ -x /usr/bin/update-desktop-database ]; then
  chroot . /usr/bin/update-desktop-database -q usr/share/applications
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x usr/bin/gtk-update-icon-cache ]; then
    chroot . /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

EOINS

# Add documentation:
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true
cp -a $SRCDIR/$(basename $0) $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mv $PKG/usr/doc/$PRGNAM-$VERSION/HTML-single $PKG/usr/doc/$PRGNAM-$VERSION/html
# Save a sample of all configuration files:
for i in etc/*.conf ; do
  cp $i $PKG/usr/doc/$PRGNAM-$VERSION/$(basename $i)-sample
done
# Save a transcript of all configured options for this specific build:
if [ -n $OUTPUT/configure-${PRGNAM}.log ]; then
  cat $OUTPUT/configure-${PRGNAM}.log \
    | sed -n "/^Config files successfully generated/,/^'config.h' and 'config.mak' contain your configuration options./p" \
    > $PKG/usr/doc/$PRGNAM-$VERSION/${PRGNAM}.configuration
fi
find $PKG/usr/doc -type f -exec chmod 644 {} \;

# Compress the man page(s):
if [ -d $PKG/usr/man ]; then
  find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \;
  for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
fi

# Strip binaries:
( find $PKG | xargs file | grep -e "executable" -e "shared object" \
  | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null )

# Add a package description:
mkdir -p $PKG/install
cat $SRCDIR/slack-desc > $PKG/install/slack-desc
if [ -f $SRCDIR/doinst.sh ]; then
  cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh
fi

# Build the package:
cd $PKG
makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
cd $OUTPUT
md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz.md5
cd -
cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt

# Warn about libdvdcss requirement (again):
if [ "$USE_PATENTS" != "YES" ]; then
  cat <<"EOT"
**
** Internal DECSS library was not built.
** If you want to play encrypted DVD's you need to install libdvdcss separately.
** You take full legal responsibility for any use of DeCSS.  We neither supply
** DeCSS code nor endorse any illegal use of it.
**
** If you are unaffected by patent concerns because you hold the required
** licenses and permission to use the patented code, or reside in a
** location where this is not a concern, and wish to include the patented
** and restricted code (you take all legal responsibility for doing so),
** then edit this SlackBuild script and change the line:
** USE_PATENTS=${USE_PATENTS:-"NO"}
** to:
** USE_PATENTS="YES"
**
EOT

fi


Daedra 10-23-2009 04:41 AM

Nevermind, I reinstalled the nvidia driver thinking maybe I over wrote or deleted the files, the reinstall worked. All is good.

ppr:kut 10-23-2009 04:41 AM

BTW, for anyone who wants to have proper SlackBuilds for libvdpau, plus a nvidia-driver script that's modified to work with the external libvdpau, I have them at my github repo http://github.com/pprkut/slackbuilds...e/master/beta/

slackd 10-23-2009 05:40 AM

Quote:

Originally Posted by Daedra (Post 3729599)
Nevermind, I reinstalled the nvidia driver thinking maybe I over wrote or deleted the files, the reinstall worked. All is good.

superb. :)


All times are GMT -5. The time now is 01:10 PM.