[mythtv-users] Removing commercials

Emery Guévremont emery.guevremont at gmail.com
Sat Nov 10 03:47:37 UTC 2007


Mike Perkins wrote:
> Emery Guevremont wrote:
>>
>> mythcommflag -f $VIDEODIR/$FILENAME
>> mythcommflag --gencutlist -f $VIDEODIR/$FILENAME
>> mythtranscode --mpeg2 --honorcutlist --showprogress -i 
>> $VIDEODIR/$FILENAME -o $VIDEODIR/$FILENAME.tmp
>> mythcommflag -f $VIDEODIR/${FILENAME} --rebuild
>> mythcommflag --clearcutlist -f $VIDEODIR/$FILENAME
>>
> The mythtranscode step above writes the output to 
> $VIDEODIR/$FILENAME.tmp.
> This file is not referenced by the following two steps. They operate 
> on the original. It's not surprising that you aren't losing the 
> commercials.
Well here's the detailed chunk of code:

mythcommflag -f $VIDEODIR/$FILENAME
ERROR=$?
if [ $ERROR -gt 126 ]; then
        echo "Commercial flagging failed for ${FILENAME} with error $ERROR"
        exit $ERROR
fi
mythcommflag --gencutlist -f $VIDEODIR/$FILENAME
ERROR=$?
if [ $ERROR -ne 0 ]; then
        echo "Copying cutlist failed for ${FILENAME} with error $ERROR"
        exit $ERROR
fi
mythtranscode --mpeg2 --honorcutlist --showprogress -i 
$VIDEODIR/$FILENAME -o $VIDEODIR/$FILENAME.tmp
ERROR=$?
if [ $ERROR -ne 0 ]; then
       echo "Transcoding failed for ${FILENAME} with error $ERROR"
       exit $ERROR
fi
rm -f $VIDEODIR/$FILENAME
mv $VIDEODIR/$FILENAME.tmp $VIDEODIR/$FILENAME
rm -f $VIDEODIR/$FILENAME.tmp.map
mythcommflag -f $VIDEODIR/${FILENAME} --rebuild
ERROR=$?
if [ $ERROR -ne 0 ]; then
        echo "Rebuilding seek list failed for ${FILENAME} with error $ERROR"
        exit $ERROR
fi
mythcommflag --clearcutlist -f $VIDEODIR/$FILENAME

> Mike Perkins


More information about the mythtv-users mailing list