[Mplayer-users] updated script

jason pepas j.pepas at mail.utexas.edu
Fri Jul 20 07:10:14 CEST 2001


i updated that playback script i was working on.

it prints out a menu of all the vob files, or gives you the option of playing htem all sequentially

also, i split it into two files so that one you can start from x and one without x running.

from x, just type dvd
without x running, just type dvdnox

-jason
jason at pepas.com

file: dvd (put in /sbin, run as root)
------------------------------------------------
#!/bin/bash
#variables
#(set up for your system)
DVDDRIVE=/dev/hdb
MOUNTPOINT=/cdrom

# get a dvd
clear
echo -n "ejecting dvd... "
eject $DVDDRIVE
echo "done."
echo ""
echo "insert a dvd."
echo "press any key to close drawer."
read -s -n 1
echo ""
echo -n "closing drawer... "
eject -t $DVDDRIVE
echo "done."

# mount dvd
echo -n "mounting dvd... "
mount $DVDDRIVE $MOUNTPOINT
echo "done."

# menu
clear
echo "--- DVD MENU ----------"
PS3="enter your selection: "
select input in `cd $MOUNTPOINT/video_ts;/bin/ls *.vob` "play all files" "quit"
do
 if [ "$input" == "play all files" ];
 then
   echo "trying "$input" vs "$filename
   for filename in `cd $MOUNTPOINT/video_ts;/bin/ls *.vob`
   do
    mplayer -dvdauth $DVDDRIVE $MOUNTPOINT/video_ts/$filename
    clear
   done
 elif [ "$input" == "quit" ];
 then
  break
 else
  for filename in `cd $MOUNTPOINT/video_ts;/bin/ls *.vob`
  do
   if [ "$input" == "$filename" ];
   then
    echo "playing $filename..."
    mplayer -dvdauth $DVDDRIVE $MOUNTPOINT/video_ts/$filename
    clear
   fi
  done
 fi 
done

# eject dvd
clear
echo -n "unmounting dvd... "
umount $MOUNTPOINT
echo "done."
echo -n "ejecting dvd... "
eject $DVDDRIVE
echo "done."
echo ""
echo "remove your dvd."
echo "press any key to close drawer."
read -s -n 1
echo ""
echo -n "closing drawer... "
eject -t $DVDDRIVE
echo "done."
clear


file: dvdnox (put in /sbin and run as root)
--------------------------------------------------------
#!/bin/bash
#variables
#(set up for your system)
DVDDRIVE=/dev/hdb
MOUNTPOINT=/cdrom
PLAYSCRIPT=/sbin/dvd

# start x
echo "starting X... "
# set up geometry to the xterm will take up the full screen
# this way, the xterm always has focus for key commands,
# even if you move your mouse.
# 102x39 works for 1024x768 
xinit -geometry 102x39 -fn 10x20 -rv -e $PLAYSCRIPT




_______________________________________________
Mplayer-users mailing list
Mplayer-users at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-users



More information about the MPlayer-users mailing list