View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 1 post ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Sat Jun 26, 2010 7:23 am 
Offline
Joined: Tue Aug 08, 2006 7:08 pm
Posts: 557
Location: UK
On some recent recordings, on trying to transcode to "top and tail" the recordings, mythtranscode would generate an error (232) and in the logfiles would have something like:
Code:
Deadlock detected
One buffer is full when the other is empty! Aborting

Doing a search resulted in this page here.

So from this, I created this script:
Code:
#!/bin/bash
# to fix mythtranscode error 232 files

USAGE="Usage: `basename $0` [-v] [-h] -f filename"
VERBOSE=false
OUTPUTDEV="/dev/null"
TEST=false

ID=false
PARAMETER=" "

while getopts f:vh OPTION ; do
   case "$OPTION" in
       f)SOURCEFILE="$OPTARG" ;;
       v)VERBOSE=true ;;
       h)echo "$USAGE" ;
        exit 1
        ;;
   esac
done

#Now we have arguments and options, we now need to check
#what parameters have been passed and do we need to process them

#Very little preprocessing for input filename, should really put in some file name
#sanity checking

TEMPNAME=${SOURCEFILE%.mpg}

#Add the extensions and the temporary file name part
SOURCENAME=${TEMPNAME}.mpg
TEMPFILENAME=${TEMPNAME}.tmp.mpg

if [ "$VERBOSE" = true ] ; then
   echo "SOURCEfile = $SOURCENAME"
   echo "TEMPfile = $TEMPFILENAME"
fi


if [ ! -e "$SOURCENAME" ] ; then
   #Check for the existence of the input file
   echo "$SOURCENAME not found."
   exit 1
fi

ffmpeg -i "$SOURCENAME" -acodec copy -vcodec copy "$TEMPFILENAME"

if [ $? -ne 0 ]
then
   #either ran out of space or file too damaged.
   echo "Demux failed!"
   exit 1
fi

 if [ "$VERBOSE" = true ] ; then
         mv -vf "$TEMPFILENAME" "$SOURCENAME"
else
         mv -f "$TEMPFILENAME" "$SOURCENAME"
fi

if [ $? -ne 0 ]
then
      #check that move completed
      echo "File Moved failed!"
      exit 1
else
      echo "Move OK"
fi

mythtranscode --mpeg2 --buildindex --allkeys --showprogress --infile "$SOURCENAME"

if [ $? -ne 0 ]
then
      #check that move completed
      echo "Build Index failed!"
      exit 1
else
      echo "Build Index OK"
fi

exit 0


The sequence I found useful is:
Remove cut points
Run the fix232 script
Edit the file, put the cut points back in
Transcode to remove the unwanted bits of the file
Transcode again, as the previous transcode does not seem to rebuild the frame index correctly.

The script is invoked by fix232.sh -f <filename> for example
/home/mythtv/bin/fix232 -f 1002_20100626190000.mpg

Script is is to be used at owners risk, no responsibility for any data loss is accepted.

Bruce S.

_________________
Updated 2019/01/31: AthlonII X2 265 Asus M5A78L-M LE
2Gb PC 1333 DDR3, 1TB+2TB SATA HDD,
SATA DVD-RW TSSTcorp SH-224DB , Onboard Radion HD3000
Hauppauage Nova-T 500, Nova-T LinHes R7.1


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu