[mythtv-users] UPDATED: pdatranscode

Jeff volckaert jvolckaert at gmail.com
Fri Nov 10 16:22:14 UTC 2006


Here's my updated pdatranscode script.  I added David Cain's chmod
command so the files can be deleted later via a share.  I also am
using mencoder's lavc mpeg4 now.  This seems to give me the best video
and no sync issues.  The file size is about 140M for an hour long show
minus commercials.

Jeff


#!/bin/sh
# pdatranscode
#
# created by Jeff Volckaert (inspired by Zach White)
# modified 11/10/06
VIDEODIR=$1
FILENAME=$2
TITLE=$3
# Remove non-alpha characters from TITLE
TITLE=${TITLE//[^a-zA-Z0-9]/}
STARTTIME=$4

# Sanity checking, to make sure everything is in order.
if [ -z "$VIDEODIR" -o -z "$FILENAME" ]; then
        echo "Usage: $0 <VideoDirectory> <FileName> "<Title>" <Starttime>"
        exit 5
fi
if [ ! -f $VIDEODIR/$FILENAME ]; then
        echo "File does not exist: $VIDEODIR/$FILENAME"
        exit 6
fi

# Transcode the file (Uncomment the method you want to use)

# Transcode using Myth's Transocde for Low Quality
# mythtranscode -i  $VIDEODIR/$FILENAME -o
$VIDEODIR/pda/$TITLE-$STARTTIME.avi -l -p 29

# Transcode using mencoder Xvid
# mencoder -vf scale=320:240 -oac mp3lame -lameopts mode=0:cbr:br=96
-af volnorm -srate 32000 -ovc xvid -xvidencopts bitrate=300 -o
$VIDEODIR/pda/$TITLE-$STARTTIME.avi $VIDEODIR/$FILENAME -quiet

# Transcode Using lavc's mpeg4 (this is what I use)
mencoder -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=300:vhq:vpass=1 -vf
scale=320:240 -oac lavc -lavcopts acodec=ac3:abitrate=128 -ffourcc
DX50 -o $VIDEODIR/pda/$TITLE-$STARTTIME.avi $VIDEODIR/$FILENAME -quiet

chmod 664 $VIDEODIR/pda/$TITLE-$STARTTIME.avi

ERROR=$?
if [ $ERROR -ne 0 ]; then
        echo "Transcoding failed for ${FILENAME} with error $ERROR"
        exit 3
fi


More information about the mythtv-users mailing list