[mythtv-users] Using mencoder by converting cutlist to mencoder's EDL file : Please see

VJ vijay.s.gill at gmail.com
Thu Jul 7 11:06:48 EDT 2005


Hi,
   I am currently using mythtranscode + mencoder to encode my mpeg2
recordings from PVR350. I have found that using mythtranscode slows
down the encoding quite a bit. If I encode the same file using
mencoder directly it adds up 10-20(sometimes up to 30) frames per
second to the encoding speed. So I thought why not use mencoder's EDL
feature to get the effect of removing commercials (the cutlist). So I
developed following script.

Could somebody else comment on this script, whether I am doing it
right or wrong. I used it on one program and it worked fine.

If it works fine, I will be glad that I shared some knowledge with mythtv users.

Currently it is very crude (it just displays the edl entries on the
screen, but I will polish it later)

Regards from
VJ

#!/bin/bash
HOWCALLED=`basename $0`

MYSQL="mysql -u mythtv -h 10.1.0.1 mythconverg -s"
MYSQL="mysql -u root mythconverg -s"

function usage() {
   echo "usage: $HOWCALLED [Myth NUV files]";
}

function frame2time() {
  ms=`echo $1 \* 1000 / 25.0  | bc`
  s=`echo $ms / $sdiv | bc`
   ms=`echo $ms % $sdiv | bc`
  echo "$s.$ms"
}

echo -e "Processing..."
for arg in $*
do
   arg=`basename $arg`
   cutlist=`echo "use mythconverg; select
replace(replace(coalesce(cutlist, ''),' ', ''), '\n', ' ') from
recorded where concat(chanid, '_',
DATE_FORMAT(starttime,'%Y%m%d%H%i%s'), '_',
DATE_FORMAT(endtime,'%Y%m%d%H%i%s'), '.nuv') = '$arg'" | $MYSQL`
   if [ "$cutlist" == "" ]
   then
     s1="${s1}$title \n"
     continue
   fi
   cutlist=`echo $cutlist`
   for clip in $cutlist
   do
     f1=`echo $clip | cut -d "-" -f1`
     if test $f1 -gt 40
      then
        f1=`echo $f1 - 1 | bc`
      else
        f1=0
      fi
     f2=`echo $clip | cut -d "-" -f2`
      f2=`echo $f2 + 1 | bc`
     t1=`frame2time $f1`
     t2=`frame2time $f2`
     echo "$t1 $t2 0"
   done
done


More information about the mythtv-users mailing list