summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/linhes-scripts/myth2mp3
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-10-23 18:17:40 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-10-23 18:19:39 (GMT)
commitadbcf19958300e9b6598990184c8815b945ba0ee (patch)
treef4283c850ac0ac202c17e78a637ee7ca8147621b /abs/core-testing/linhes-scripts/myth2mp3
parent61a68250df10d29b624650948484898334ff22d0 (diff)
downloadlinhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.zip
linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.gz
linhes_pkgbuild-adbcf19958300e9b6598990184c8815b945ba0ee.tar.bz2
Removed old core and extra from repo. Renamed -testing to core/extra. This will setup the base for the testing branch.
Diffstat (limited to 'abs/core-testing/linhes-scripts/myth2mp3')
-rwxr-xr-xabs/core-testing/linhes-scripts/myth2mp382
1 files changed, 0 insertions, 82 deletions
diff --git a/abs/core-testing/linhes-scripts/myth2mp3 b/abs/core-testing/linhes-scripts/myth2mp3
deleted file mode 100755
index 89181c1..0000000
--- a/abs/core-testing/linhes-scripts/myth2mp3
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-# convert recordings to as mp3 audio only
-# version 0.9
-
-# usage:
-# first parameter must be %DIR%/%FILE% of the recording
-# second parameter must be the desired base name of the output
-# third parameter must be %CHANID% if you set USECUTLIST=Y
-# fourth parameter must be %STARTTIME% if you set USECUTLIST=Y
-# In the mythtv setup screen invoke this script like this:
-# MYTHTV User Job Command:
-# /usr/LH/bin/myth2mp3 "%DIR%/%FILE%" "%TITLE% - %SUBTITLE%" "%CHANID%" "%STARTTIME%"
-
-# options:
-BITRATE=256k #ie. 128k, 160k, 192k, 224k, 256k
-USECUTLIST=Y #Y or N
-
-# where the converted audio is stored
-OUT_DIR=/myth/music
-
-# create temp filename so multiple instances won't conflict
-TMPNAME=toMP3-$$
-TMPFILE=/myth/tmp/$TMPNAME.mp3
-TMPCUTFILE=/myth/tmp/$TMPNAME.mpg
-FFINPUTFILE=$1
-
-# log file location
-LOGFILE=/var/log/mythtv/myth2mp3.log
-CDate="`date`"
-echo "" >> $LOGFILE
-echo $CDate >> $LOGFILE
-echo "File to encode: $1 Name: $2" >> $LOGFILE
-
-# start timer
-beforetime="$(date +%s)"
-
-# check if using cutlist
-if [ $USECUTLIST = Y ];then
- MYTHCOMMFRAMES=`mythcommflag --getcutlist -f "$FFINPUTFILE" | grep 'Cutlist:' | cut -d \ -f 2`
- if [ -n "$MYTHCOMMFRAMES" ]; then
- echo "Extracting Cutlist..." >> $LOGFILE
- /usr/bin/nice -n19 /usr/bin/mythtranscode --chanid "$3" --starttime "$4" --outfile "$TMPCUTFILE" --mpeg2 --honorcutlist
- FFINPUTFILE=$TMPCUTFILE
- fi
-fi
-
-# run ffmpeg to do conversion
-echo "Encoding..." >> $LOGFILE
-/usr/bin/nice -n19 /usr/bin/ffmpeg -i "$FFINPUTFILE" -vn -acodec libmp3lame -ab $BITRATE -ar 44100 -ac 2 "$TMPFILE"
-ERROR=$?
-
-# make output filename unique
-OUTPUTFILE=$OUT_DIR/$2.mp3
-i=1
-while [ -e "$OUTPUTFILE" ]
-do
- OUTPUTFILE=$OUT_DIR/$2-$i.mp3
- i=`expr $i + 1`
-done
-
-# move temp file to output location
-chown mythtv "$TMPFILE" && mv "$TMPFILE" "$OUTPUTFILE"
-
-# stop timer
-aftertime="$(date +%s)"
-seconds="$(expr $aftertime - $beforetime)"
-
-if [ $ERROR -eq 0 ]; then
- echo "File Encoded Sucessfully: $OUTPUTFILE" >> $LOGFILE
- hours=$((seconds / 3600))
- seconds=$((seconds % 3600))
- minutes=$((seconds / 60))
- seconds=$((seconds % 60))
- echo "Encoding Time: $hours hour(s) $minutes minute(s) $seconds second(s)" >> $LOGFILE
-else
- echo "ERROR: $ERROR" >> $LOGFILE
-fi
-
-# clean up left over files
-unlink $TMPFILE 2> /dev/null
-unlink $TMPCUTFILE 2> /dev/null
-unlink $TMPCUTFILE.map 2> /dev/null