summaryrefslogtreecommitdiffstats
path: root/abs/core/linhes-scripts
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-08-09 00:10:48 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-08-09 00:10:48 (GMT)
commiteb79c361fd072b1b5a7529f6694f5050d8373c3f (patch)
treeca77d6c7972a868dcb34f738f4b8870d564e02e7 /abs/core/linhes-scripts
parent15699db7cc8429c3f9d7a2b516b91889e010984d (diff)
parent90514910be147bd0aa416dc29ab4cb0791844cc4 (diff)
downloadlinhes_pkgbuild-eb79c361fd072b1b5a7529f6694f5050d8373c3f.zip
linhes_pkgbuild-eb79c361fd072b1b5a7529f6694f5050d8373c3f.tar.gz
linhes_pkgbuild-eb79c361fd072b1b5a7529f6694f5050d8373c3f.tar.bz2
Merge remote-tracking branch 'origin/testing' into testing
# By Cecil (8) and Michael Hanson (4) # Via Cecil (2) and Michael Hanson (1) * origin/testing: mplayer: nothing to see here bluez: update to 4.101 linhes-scripts:Corrected scripting errors in ripD_eject.sh. linhes-scripts:Modifed ripD_eject.sh to use HandBrakeCLI. mplayer: minor correction to PKGBUILD. No pkg built. handbrake:Bumped to 0.9.8. Closes #838. mythtv:Bumped to add deps for backing up DVD. mythtv:Bumped to compiles latest 0.25.2. Added DVD backup menu. mythplugins:Bumped to compiles latest 0.25.2. linhes-scripts:Added scripts to backup one's DVD. lsdvd:initial inclusion. For use with ripD. linhes-scripts: fix for myth2mkv Conflicts: abs/core/mplayer/PKGBUILD abs/core/mythtv/stable-0.25/git_src/git_hash abs/core/mythtv/stable-0.25/mythtv/PKGBUILD
Diffstat (limited to 'abs/core/linhes-scripts')
-rwxr-xr-xabs/core/linhes-scripts/LinHES-osd19
-rw-r--r--abs/core/linhes-scripts/PKGBUILD10
-rw-r--r--abs/core/linhes-scripts/myth2mkv7
-rwxr-xr-xabs/core/linhes-scripts/ripD_eject.sh125
4 files changed, 157 insertions, 4 deletions
diff --git a/abs/core/linhes-scripts/LinHES-osd b/abs/core/linhes-scripts/LinHES-osd
new file mode 100755
index 0000000..85f4a40
--- /dev/null
+++ b/abs/core/linhes-scripts/LinHES-osd
@@ -0,0 +1,19 @@
+#!/bin/bash
+# /usr/local/bin/KnoppMyth-osd
+# A script to put up text for on screen.
+#
+########################################################################
+FONT="-adobe-helvetica-bold-r-*-*-34-*-*-*-*-*-*-*" # Default
+OPTS="-f $FONT -s 2 -p bottom -A left -i 50 -l 5" # values.
+#-----------------------------------------------------------------------
+[ -r /etc/rip.cfg ] && . /etc/rip.cfg
+########################################################################
+# $1=text, $2=color, $3=delay.
+JUNK=$(killall osd_cat >& /dev/null)
+color='' ; delay=''
+[ -z "$1" ] && exit 0
+[ -n "$2" ] && color="--color=$2"
+[ -n "$3" ] && delay="--delay=$3"
+JUNK=$(echo -e "$1" | osd_cat $OPTS $color $delay &)
+########################################################################
+# End
diff --git a/abs/core/linhes-scripts/PKGBUILD b/abs/core/linhes-scripts/PKGBUILD
index 829694b..0fb3dee 100644
--- a/abs/core/linhes-scripts/PKGBUILD
+++ b/abs/core/linhes-scripts/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=linhes-scripts
pkgver=7
-pkgrel=41
+pkgrel=45
pkgdesc="Various scripts that help to make LinHES, LinHES."
arch=('i686' 'x86_64')
license=('GPL2')
@@ -51,13 +51,15 @@ find_orphans.py
acl_fix_fstab.py
stop_xss.sh
myth2mkv
+LinHES-osd
+ripD_eject.sh
)
build() {
cd ${srcdir}
install -d ${pkgdir}/usr/LH/bin
install -d ${pkgdir}/usr/LH/etc
- install -D -m755 myth2* *.sh *.pl *.py vdpau* run-* pause_* ${pkgdir}/usr/LH/bin/
+ install -D -m755 myth2* *.sh *.pl *.py vdpau* run-* pause_* LinHES* ${pkgdir}/usr/LH/bin/
install -D -m755 upgrade_screen_rc ${pkgdir}/usr/LH/etc/
mkdir -p ${pkgdir}/etc/sv/pause-mythcommflag/supervise
cp run-pause-mythcommflag ${pkgdir}/etc/sv/pause-mythcommflag/run
@@ -104,4 +106,6 @@ md5sums=('f56985b2d602e11dc1e10d3e7848b2a5'
'd8838461af9d446a1fd7e7883fdc75d1'
'cc9cdabcdfc969c2829b58c0e513488c'
'54a478660d0f8150fe10112a9ecf2740'
- '980423e07c8c6ffd0ea1bf9a1959fdc2')
+ '8fa34662c686b210c9943324b7df2feb'
+ 'b608044c9e7530a400d8f5b88fdfe6e6'
+ 'e2e24dd59d5d576cc33feafb329fa302')
diff --git a/abs/core/linhes-scripts/myth2mkv b/abs/core/linhes-scripts/myth2mkv
index 5035748..f180b31 100644
--- a/abs/core/linhes-scripts/myth2mkv
+++ b/abs/core/linhes-scripts/myth2mkv
@@ -2,7 +2,7 @@
#
# Convert video to AVC-1 / h264
#
-# version 0.25-001
+# version 0.25-002
#
# Prerequisites:
# - mythtv >= 0.25
@@ -156,6 +156,11 @@ if [[ ${FPS} = "29.970" ]] ; then
FPS="29.97"
fi
+# HandBrake does not like a framerate of 59.940, so let's drop the 0
+if [[ ${FPS} = "59.940" ]] ; then
+ FPS="59.94"
+fi
+
# A rough guestimation that if the video width is 1920, 1440, 852, 704, 640 or
# 528 pixels it is probably interlaced.
if [[ ${DEINT} = Y ]] ; then
diff --git a/abs/core/linhes-scripts/ripD_eject.sh b/abs/core/linhes-scripts/ripD_eject.sh
new file mode 100755
index 0000000..99947a8
--- /dev/null
+++ b/abs/core/linhes-scripts/ripD_eject.sh
@@ -0,0 +1,125 @@
+#!/bin/bash
+# /usr/LH/bin/ripD_eject.sh
+# A DVD rip and eject script.
+########################################################################
+DEV='/dev/sr0' # DVD device
+MPNT='media/cdrom' # Mount Point
+Ddir='/myth/video' # DVD output dir List
+Bsnd='/usr/share/sounds/init.wav' # Begin sound file
+Esnd='/usr/share/sounds/complete.wav' # End sound file
+DATE=$(date +%Y%m%d_%H%M) # current date/time
+LOG='/var/log/mythtv/ripD.log' # name of Log file.
+TRACK=$(lsdvd | grep -i longest | awk '{print $3}') #Finds longest track
+FILE=$TITLE
+#-----------------------------------------------------------------------
+FONT="-adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-*"
+OPTS="-f $FONT -s 2 -p bottom -A left -i 50 -l 4"
+#-----------------------------------------------------------------------
+[ -r /etc/rip.cfg ] && . /etc/rip.cfg
+#-----------------------------------------------------------------------
+LOCK=/tmp/.ripLock.$$
+[ "$DISPLAY" == "" ] && export DISPLAY=:0
+########################################################################
+function osd { # $1=text, $2=color, $3=delay
+ cmd="osd_cat $OPTS"
+ [ -n "$2" ] && cmd="$cmd --color=$2"
+ [ -n "$3" ] && cmd="$cmd -d $3"
+ killall osd_cat
+ echo -e "$1" | $cmd
+} >& /dev/null
+function osd_loop() {
+ FN=$1 ; shift
+# TXT="$MAX to $dir"
+ TXT="$MAX to $dir/$FILE"
+ N=0
+ while [ -f "$LOCK" ]; do
+ #osd "\nbacking up DVD: '$@'\n$TXT" gray 60
+ osd "\nbacking up DVD: '$TITLE'\n$TXT" gray 60
+ N=$(($N+1))
+ [ -d "$FN" ] && SIZE=$(du -sh $FN | awk '{print $1}')
+# TXT="$SIZE of $MAX @ $N min. elapsed"
+ TXT="$N min. elapsed"
+ done
+}
+########################################################################
+LinHES-osd "\nDetecting DVD" gray20 5 &
+echo "`date` detected DVD" >> $LOG
+rm -f /tmp/.ripLock.*
+#=======================================================================
+for dir in $Ddir ; do
+ if [ -d $dir -a -w $dir ]; then
+ break
+ fi
+done
+#-----------------------------------------------------------------------
+if [ ! -d "$dir" ]; then
+ echo "no $dir" >> $LOG
+ osd "\ndirectory: $dir\nnot found!" red 10 &
+ eject ; eject
+ exit 0
+fi
+if [ ! -w "$dir" ]; then
+ echo "$dir not writable" >> $LOG
+ osd "\ndirectory: $Cdir\nnot writable!" red 10 &
+ eject ; eject
+ exit 0
+fi
+#-----------------------------------------------------------------------
+mount $DEV >& /dev/null
+dev=$(readlink $DEV)
+df=$(df -h /dev/$dev | grep /dev/$dev)
+MAX=$(echo $df | while read d v r ; do echo $v ; done)
+echo " backup $MAX to $dir" >> $LOG
+#=======================================================================
+# first make sure DMA is on:
+sudo hdparm -d1 -u1 $DEV >& /dev/null
+# attempt to get the DVD information:
+TITLE=$(dvdbackup -i /dev/sr0 -I | grep information | awk '{ s = ""; for (i = 8; i <= NF; i++) s = s $i " "; print s }' | tr -d '"' | sed 's/ /_/g' | sed 's/_$//g')
+if [ "$TITLE" == "DVD_VIDEO" -o "$TITLE" == "" \
+ -o "$TITLE" == " " -o "$TITLE" == "[ ].*" ]; then
+ # if not a good title,
+ TITLE="dvdbackup_$DATE"
+fi
+echo " $TITLE" >> $LOG
+if [ $1 = m ]
+then
+ COMMAND="dvdbackup -M -i $DEV -o $dir -n $TITLE"
+ elif [ $1 = h ]
+ then
+# COMMAND="mencoder dvd://$TRACK -alang en -oac mp3lame -lameopts br=320:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq -vf scale -zoom -xy 720 -o $dir/$TITLE.avi"
+ COMMAND="HandBrakeCLI -i $DEV -o $dir/$TITLE.mp4 --preset "High\ Profile" --main-feature"
+ FILE=$TITLE.mp4
+ elif [ $1 = n ]
+ then
+# COMMAND="mencoder dvd://$TRACK -alang en -oac mp3lame -lameopts br=160:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq -vf scale -zoom -xy 512 -o $dir/$TITLE.avi"
+ COMMAND="HandBrakeCLI -i $DEV -o $dir/$TITLE.mp4 --preset "Normal" --main-feature"
+ FILE=$TITLE.mp4
+ elif [ $1 = l ]
+ then
+# COMMAND="mencoder dvd://$TRACK -alang en -oac mp3lame -lameopts br=96:cbr -ovc lavc -lavcopts vcodec=mpeg4:vhq -vf scale -zoom -xy 320 -o $dir/$TITLE.avi"
+ COMMAND="HandBrakeCLI -i $DEV -o $dir/$TITLE.mp4 --preset "Classic" --main-feature"
+ FILE=$TITLE.mp4
+ elif [ $1 = i ]
+ then
+ COMMAND="dd if=$DEV of=$dir/$TITLE.iso bs=2048"
+ FILE=$TITLE.iso
+fi
+{ # for the redir below:
+ # Begin:
+ touch $LOCK
+ osd_loop "$dir/$TITLE" "$TITLE" &
+ dvdbackup -i $DEV -I
+ sleep 1 ; aplay $Bsnd
+ $COMMAND
+ # Finish:
+ rm -f $LOCK
+ osd "\nfinish DVD: '$TITLE'\ninto $dir/$FILE" gray20 5 &
+ sleep 1 ; aplay $Esnd
+ # Eject the media:
+ sudo eject ; sudo eject
+} > $dir/.$TITLE.log 2>&1
+echo " `du -sh $dir/$FILE`" >> $LOG
+echo " `date` finished DVD" >> $LOG
+exit 0
+########################################################################
+# End