2005-06-02, 22:20
i made a small and very dirty proof of concept for a replacement script for the mythranscode binary. it works, but don't ask how. it's purpose is to convert my mpeg2 nuvs to fake xvid nuv's. it does this without commercial skipping (i think) and user mencoder to recode the mpeg2 stream. the resulting nuv xvid file can be played by the xbmcmythv mplayer and also within windows. the mpeg4 transcoded stream from the original mythtranscode can't (see my former posting):
Quote:#/bin/bash
echo -e "\n\n===============================" >>/tmp/mythtranscode.out
echo "mythtranscode $*" >>/tmp/mythtranscode.out
sql () {
mysql -u root mythconverg -e "$*" >>/tmp/mythtranscode.out 2>&1
echo "$*" >>/tmp/mythtranscode.out
}
partfile=`echo $6|tr -cd "1234567890"`
channel=$4
starttime=`echo $6|tr "t" " "`
echo "partfile=$partfile" >>/tmp/mythtranscode.out
cd /mnt/disk3/video/tv/
name="`ls $channel\_$partfile*.nuv`"
echo "name: $name" >>/tmp/mythtranscode.out
sql "update jobqueue set status=4 where chanid=$channel and starttime='$starttim
e'"
nice -n +20 mencoder $name -ovc xvid -oac mp3lame -lameopts br=128 \
-vf scale=480:480 -o $name.tmp -xvidencopts bitrate=1000\
>/tmp/mencoder.out 2>>/tmp/mythtranscode.out
if [ $? -eq 0 ]; then
if [ ! -f $name.tmp ]; then
sql "update jobqueue set status=8 where chanid=$channel and starttime='$star
ttime'"
echo "failed!" >>/tmp/mythtranscode.out
return 99
else
sql "update jobqueue set status=5 where chanid=$channel and starttime='$star
ttime'"
echo "success!" >>/tmp/mythtranscode.out
sleep 5
return 0
fi
else
rm -rf $name.tmp
sql "update jobqueue set status=8 where chanid=$channel and starttime='$startt
ime'"
echo "failed!" >>/tmp/mythtranscode.out
return 99
fi