summaryrefslogtreecommitdiffstats
path: root/abs/core/linhes-scripts/myth2mp3
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/linhes-scripts/myth2mp3')
-rwxr-xr-xabs/core/linhes-scripts/myth2mp311
1 files changed, 6 insertions, 5 deletions
diff --git a/abs/core/linhes-scripts/myth2mp3 b/abs/core/linhes-scripts/myth2mp3
index 89181c1..504322e 100755
--- a/abs/core/linhes-scripts/myth2mp3
+++ b/abs/core/linhes-scripts/myth2mp3
@@ -1,6 +1,6 @@
#!/bin/sh
# convert recordings to as mp3 audio only
-# version 0.9
+# version 1.0
# usage:
# first parameter must be %DIR%/%FILE% of the recording
@@ -23,13 +23,14 @@ TMPNAME=toMP3-$$
TMPFILE=/myth/tmp/$TMPNAME.mp3
TMPCUTFILE=/myth/tmp/$TMPNAME.mpg
FFINPUTFILE=$1
+TITLE=`echo $2 | sed 's/\//_/g'`
# log file location
LOGFILE=/var/log/mythtv/myth2mp3.log
CDate="`date`"
echo "" >> $LOGFILE
echo $CDate >> $LOGFILE
-echo "File to encode: $1 Name: $2" >> $LOGFILE
+echo "File to encode: $1 Name: $TITLE" >> $LOGFILE
# start timer
beforetime="$(date +%s)"
@@ -46,15 +47,15 @@ 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"
+/usr/bin/nice -n19 /usr/bin/ffmpeg -i "$FFINPUTFILE" -vn -acodec libmp3lame -ab $BITRATE -ar 44100 -ac 2 -vol 2048 "$TMPFILE"
ERROR=$?
# make output filename unique
-OUTPUTFILE=$OUT_DIR/$2.mp3
+OUTPUTFILE=$OUT_DIR/$TITLE.mp3
i=1
while [ -e "$OUTPUTFILE" ]
do
- OUTPUTFILE=$OUT_DIR/$2-$i.mp3
+ OUTPUTFILE=$OUT_DIR/$TITLE-$i.mp3
i=`expr $i + 1`
done