Eric Cooper wrote:
On Tue, Jan 26, 2010 at 12:21:01PM -0600, Roger Heflin wrote:
Eric Cooper wrote:
My recent MythTV recordings are unwatchable on my mvpmc box due to
audio stuttering. [...]
There are 2 possible problems.

Either the bit rate is too high, and that is causing issues, or the audio is AC3 and not mp2, the AC3 audio is less well supported and I have never quite had it work right. [...] I transcode my digital streams down to normal stuff that the mvpmc will work with, this is done via a user job in mythtv, and takes about 1/2 of the runtime on a 7750 Athlon for 1080i hd -> 480p conversion.

As Roger suggested, the problem was indeed AC3 audio in the recordings
from my pcHDTV tuner.

The following seems to work well so far.  I'm just running it as a
cron job, since I haven't figured out how to use MythTV's transcoding
features.

    ffmpeg -alang eng -i inputfile.mpg -f mpegts \
       -vcodec copy -scodec copy -acodec mp2 outputfile.mpg

see the attached script.

It should handle all cases including trancoding down HD to SD.

#!/bin/bash
# Written by: Roger Heflin ([email protected])
#
# script to convert a video file into a form that is playable on a
# mvpmc box, used inside of MYTHTV to convert HD signals and other 
# files into forms that will work on the MVPMC box without using VLC
#
# Version 0.5   8/10/2007
#
# Version 0.52  11/05/2007 
# Changes:
#     Added code to use audio bitrate from original
#     Added code to use audio srate from original
#     Added code to remove audio preload - this seems to cause mvpmc to be
#          out of sync on *all* bitrates, not having the preload appears to
#          make the audio sync be wrong with mplayer - but we aren't using
#          mplayer for this are we.
#     Removed extra crap from mencoder sampling code
#     mplayer -identify only works with mplayer - not with mencoder - not sure
#              whoever added this option thought it out, and mplayer does not
#              appear to have a way to redirect to nowhere.
#     Added -lameopts and removed some lavcopts for audio that were basically
#          ignored
#     Changed scale to be in the y rather than the x (640) and use 400 rather
#          than 480, I found mencoder to sometimes decide to expand to 484 
#          with 480 as the setting and 484 won't play
#          on mvpmc
#     Set a lower audio srate and audio bps as some lower audio rates fail -
#          ie a srate of 12000 fails to produce any sound.
#
# Version 0.53  11/18/2007
# Changes:
#       Added code to rename the files, when the extension is .mpg
#       Used variables to reduce duplication of options in different locations
#       Change the default sws option from default to 0. (def=31.2fps/0=37.8fps)
#               on the conversion of video.  
#       Added code to print out cpu time and cpu percent used and to produce
#               a speed summary line.
#       Added more complicated code for scaling things to get to the biggest
#               size, 400 fails with some videos resulting in too large for
#               the mvpmc to play, and using 640 results in the y being too
#               big sometimes.
#
# Version 0.54  12/06/2007
# Changes:
#       On 1920x1080 video use -sws 2 (this is interlaced I believe)
#               otherwise you get some annoying artifacts, this may
#               need to be used on more than just that.   Not sure that
#               I understand this, only some programming on one of my
#               channels have these artifacts, it does not appear to be
#               releated to bit rate, and I cannot identify the difference
#               between the two programs.
#
# Version 0.55  1/9/2008
# Changes:
#       Corrected reporting of 0 size on missing filename
#       Changed debug to be > 0 rather than =0.
#       
# Version 0.56  1/11/2008
# Changes:
#       Added code to detect 528x480 mpeg file with ac3 (from qam cable
#               I believe, this also claims to have a bps of 15000 but
#               actually appears to really have 3000 bps that will actually
#               play on a mvpmc - reported by Mark Paulus.
#       Added code to catch any > 10000 bps and lower the bit rate.
#       Corrected a later if statement that did not have both possible mp3lib
#               strings that could be returned.
#
# Version 0.57  1/18/2008
# Changes:
#       Added nice  to mencoder to attempt to prevent slowness with 
#               backend operations
#       Increased crop frames to get past small regions with different 
#               crop - we may eventually have to do the entire show or
#               somehow sample the show and figure out from a number
#               of samples what the crop should be.
# Version 0.58  1/30/2008
# Changes:
#       Added code to deal with clips with no audio in them.
#
# Version 0.59  7/28/2008
# Changes:
#       Added code to check the average bitrate from the cropdetect since some 
videos
#               appear to claim high bitrates and really have low bitrates and 
don't
#               need a video transcode, and some claim high bitrates and have 
high bitrates,
#               often when the broadcasters screw up (ie 704x480 with abps of 
14.5mbit on a
#               subchannel that just days ago was 1920x1080).
#       Reduced abps default from 5500 to 2500.
#       Added check for height of 1088 on turning on of "-sws 2".       
#       
# Version 0.60 3/07/2009
# Changes:
#       Added some code from Adam Siegel to fix the seek table  
#
# How to add as a mythtv user job:
#
#       mythtv-setup -> general -> screen with user jobs
#               Add to a user job this:
#               "/usr/local/bin/makempeg2 mythjob %DIR% %FILE% >> 
/tmp/makempeg2_out.log"
#
#       You will need to enable user job and set it up to actually run on 
#               new recordings.
#       To test:
#               Watch Recordings -> Right Arrow -> Job Options -> select run 
user job 
#               The job should start in a minute or two.
#
echo $* >> /tmp/makempeg2.log
export DEBUG=1
export srate=48000
export abitrate=320
export mencoder=mencoder
export threadcnt=1

if [ "${1}" == "mythjob" ] ; then
  export filename="${2}/${3}"
  cd ${2}
  export mythjob=1
else
  export mythjob=0
  export filename=${1}
fi

#
if [ ! -s "$filename" ] ; then
  echo "${0}: $filename has 0 size"
  exit -1
fi
if [ -L "$filename" ] ; then
  echo "${0}: $filename is a link - this program will not copy and replace 
properly with a link"
  exit -1
fi
#
# sample in several places
# -ovc copy fails to check for audio with DX50 file ... but appears to be fine 
with 
# everything else
#

# -vf scale=720:480 -vf expand=576:432
if [ -f "$filename" ] ; then
  # this really should work in bash - it is documented but does not actually 
appear to work
  ext=`echo "${filename}" | awk  '{ NF=split($0,parts,".") ;print parts[NF] }'`
  echo "Ext = ${ext}"
  obase=`echo "${filename}" | awk  '{ NF=split($0,parts,".") ;for 
(i=1;i<NF;i++) printf("%s",parts[i]) }'`
  echo "Base = ${obase}"
  fnonly=`echo "${obase}" | awk '{ NF=split($0,parts,"/") 
;printf("%s",parts[NF]) }'`
  export TMPFILE=/tmp/${fnonly}_tmp
  if [ $DEBUG -gt 0 ] ; then
    echo "${0}: Temp file is $TMPFILE"
  fi
  nice -n 10 ${mencoder} -of mpeg -frames 4000 -vf cropdetect -oac lavc -ovc 
raw -o /dev/null "$filename" 2>&1 > ${TMPFILE}
  nice -n 10 ${mencoder} -of mpeg -frames 4000 -oac lavc -ovc copy -o /dev/null 
"$filename" 2>&1 > ${TMPFILE}.avbps

else
  echo "Usage: ${0} <videofiletoconvert>"
  echo " "
  exit -1
fi

export oldfile="$filename"
export newfile="${filename}.tmp"
if [ $DEBUG -gt 0 ] ; then
  echo "${0}: Oldfile= $oldfile   newfile= $newfile"
fi


#
# success: format: 0  data: 0x0 - 0x5ae43e0c
#TS file format detected.
#DEMUX OPEN, AUDIO_ID: -1, VIDEO_ID: -1, SUBTITLE_ID: -1,
#PROBING UP TO 2000000, PROG: 0
#VIDEO MPEG2(pid=49)AUDIO A52(pid=52) NO SUBS (yet)!  PROGRAM N. 1
#Opened TS demuxer, audio: 2000(pid 52), video: 10000002(pid 49)...POS=564
#VIDEO:  MPEG2  1920x1080  (aspect 3)  29.970 fps  65000.0 kbps (8125.0 kbyte/s)
#[V] filefmt:29  fourcc:0x10000002  size:1920x1080  fps:29.97  ftime:=0.0334
#Opening audio decoder: [liba52] AC3 decoding with liba52
#AC3: 2.0 (stereo)  48000 Hz  384.0 kbit/s
#AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
#Selected audio codec: [a52] afm:liba52 (AC3-liba52)

export vtype=`cat ${TMPFILE} | awk '$1 ~ "VIDEO:" { print $2}'`
export vbps=`cat ${TMPFILE} | awk '$1 ~ "VIDEO:" { for (i=1;i<NF;i++) if ($i ~ 
"kbps" ) printf("%6.0f", $(i-1))}'`
export avbps=`cat ${TMPFILE}.avbps | awk '$1 ~ "Video" { printf("%d",$3)}'`
export size=`cat ${TMPFILE} | awk '$4 ~ "size:" { print $4}'`
export hsize=`echo $size | awk -F: '{split($2,parts,"x");print parts[1]}'`
export vsize=`echo $size | awk -F: '{split($2,parts,"x");print parts[2]}'`
export atype=`cat ${TMPFILE} | awk '$1 ~ "Selected" && $2 ~ "audio" { print $6 
}'`
export abitrate=`cat ${TMPFILE} | awk '$1 ~ "AUDIO:" { printf("%d",$7) }'`
export srate=`cat ${TMPFILE} | awk '$1 ~ "AUDIO:" { print $2 }'`
export fps=`cat ${TMPFILE} | awk '$1 ~ "VIDEO:" && $6 ~ "fps" { print $5 } $1 ~ 
"VIDEO:" && $7 ~ "fps" { print $6} '`

export SWS="-sws 0"
if [ ${hsize} -eq 1920 ] && [ ${vsize} -eq 1080 ] ; then
  echo "${0}: Interlaced video - using default sws of 2"
fi

if [ ${vbps} -eq 0 ] ; then 
  vbps=2000
fi
echo " "
echo "${0}: ABITRATE = ${abitrate} TMPFILE is ${TMPFILE}"
echo " "
#cat ${TMPFILE}

export AUDIOEXTRA="-audio-preload 0.0"

if [ ! $?srate ] ; then
  echo "No audio found in this clip"
  export AUDIOEXTRA="-nosound"  
  # some options to get to to pass through without audio
  export srate=22050
  export atype=none
  export abitrate=192
else
  if [ ${srate} -le 22050 ] ;  then
  # certain audio rates seem to fail.
  # ie 12000 fails either with VLC or transcoded, so set
  # a lower limit.   Lower limits may work, and/or only certain
  # ones may not work - not enough testing has been done to determine
  # which work and which fail.
    export srate=22050
    export abitrate=128
  fi
  if [ ${abitrate} -gt 320 ] ; then
  #
  # lame limits to 320
  #
    echo "${0}: abitrate is ${abitrate} limited to 320kbit/second"
    export abitrate=320
  elif [ ${abitrate} -lt 64 ] ; then
    echo "${0}: abitrate is ${abitrate} limited to min of 64kbit/second"
    export abitrate=64
  fi
fi

if [ -z "$vsize" ] || [ -z "$hsize" ] || [ -z "$atype" ] || [ -z "$vbps" ] ||
  [ -z "$atype" ] || [ -z "$vtype" ] ; then
  cat ${TMPFILE}
  echo "${0}: ERROR: file $filename had a empty size or video or audio decoder 
- or "
  echo "${0}:       the information was parsed incorrectly"
  echo "${0}: $size is $hsize x $vsize with vtype = $vtype at $vbps bps and 
atype $atype with $crop"
  exit -1
fi
echo "Cropping calculation with hsize=${hsize} vsize=${vsize}"
export crop=`grep  "Crop area" ${TMPFILE}*  | awk -v hsize=${hsize} -v 
vsize=${vsize} 'BEGIN { cropminx=hsize;cropminy=vsize;cropmaxx=0;cropmaxy=0} 
{for (i=1;i<NF;i++) { if ($i ~ "-vf") split($(i+1),crop,"[=:)]") ; if ( crop[1] 
== "crop" ) { if ( crop[2] > cropmaxx ) cropmaxx=crop[2] ; if ( crop[3] > 
cropmaxy ) cropmaxy=crop[3] ; if (crop[4] < cropminx ) cropminx=crop[4] ; if 
(crop[5] < cropminy ) cropminy=crop[5]}}} END { if ((cropmaxx != 0) && ( 
cropmaxy != 0) ) 
printf("crop=%d:%d:%d:%d,",cropmaxx,cropmaxy,cropminx,cropminy)}'`
if [ "${crop}" == "" ] ; then
  echo "No crop found - using full size"
  export crop=" "
fi
if [ $? != 0 ] ; then
  exit
fi
if [ $DEBUG -gt 0 ] ; then
  #echo "START >>>>>>"
  #cat ${TMPFILE}*
  #echo "<<<<<<<END"
  #grep -i CROP ${TMPFILE}*
  echo "${0}: $size is $hsize x $vsize with vtype = $vtype at $vbps bps and 
atype $atype with $crop"
fi

if [ ${vbps} -gt 20000 ] ; then 
  # ATSC is limited to about 20Mbps
  export vbps=20000
fi
# Cut the bps down by replacing 480 with 360 to reduece by 75%, 
# a factor of 2 causes some annoying artifacts.
export abps=`expr ${vbps} \* 640 / ${hsize} \* 480 / ${vsize} / 2`
if [ "${vtype}" != "MPEG1" ] && [ "${vtype}" != "MPEG2" ] ; then
  export abps=`expr ${abps} \* 6`
fi
if [ ${abps} -gt 2500 ] ; then 
  export abps=2500
fi

if [ ${abps} -eq 0 ] ; then 
  # probably not needed unless doing the / 2 to reduce size
  # this reduces to just above 1GB/hour.
  if [ ${hsize} -eq 848 ] && [ ${vsize} -eq 480 ] ; then
    # video from digital camera
    export abps=3000
  else
    export abps=1000
  fi
fi
export mbps=`expr ${abps} \* 2`

echo "${0}: New Average bps = ${abps} Max bps = ${mbps}"
echo "${0}: Crop is: ${crop}"
echo "${0}: srate = ${srate} abitrate=${abitrate}"

#rm ${TMPFILE}*

export AUDIOOPTS="-srate ${srate}  -oac lavc -lavcopts 
acodec=mp2:abitrate=${abitrate}"
#
# Note that the -ofps is only needed if the original file is at a different 
fps, this may
# need to be adjusted for PAL usage.
#
# 1000.000 seems to come out of wmv files
# 29.970 comes from avi and is not supported for mpeg
#if [ "${fps}" == "29.970" ] || [ "${fps}" == "1000.000" ] || [ "${fps}" == 
"59.940" ] ; then
  export fps="30.0"
#fi
echo "${0}: FPS = ${fps}"
export MENCODEROPTS="nice -n 10 ${mencoder} -of mpeg -mpegopts format=dvd -ofps 
${fps}"


export SCALE=`echo "${crop} 640 480" | awk ' { thsize=$2; tvsize=$3 ; 
split($1,cropd,"=") ; split(cropd[2],croplim,":") ; hsize=croplim[1]-cromlim[3] 
; vsize=croplim[2]-croplim[4]; factor=thsize/hsize ; nhsize=thsize ; 
nvsize=factor*vsize ; if ( nvsize > tvsize ){ factor=tvsize/vsize ; 
nhsize=factor*hsize ; nvsize=tvsize } ; printf("scale=%d:%d",nhsize,nvsize)}'`
if [ $? != 0 ] ; then
  exit
fi
if [ ${DEBUG} -gt 0 ] ; then
  echo "${0}: scale = ${SCALE}"
fi
export EXPAND="expand=640:480"
if [ $hsize == 1920 ] && ( [ $vsize == 1080 ] || [ $vsize == 1088 ] ) ; then
  export CONVERSION="1920x1080 convertion selected"
  # this is interlaced video - sws 0 produces annoying artificats
  export SWS="-sws 2"
  export VIDOPTS="-ovc lavc -vf ${crop}${SCALE},${EXPAND},harddup -lavcopts 
threads=${threadcnt}:vcodec=mpeg2video:keyint=18:vrc_buf_size=1835:vrc_maxrate=${mbps}:vbitrate=${abps}"
elif [ $hsize == 1280 ] && [ $vsize == 720 ] ; then

  export CONVERSION="1280x720 convertion selected"
  export VIDOPTS="-ovc lavc -vf ${crop}${SCALE},${EXPAND},harddup -lavcopts 
threads=${threadcnt}:vcodec=mpeg2video:keyint=18:vrc_buf_size=1835:vrc_maxrate=${mbps}:vbitrate=${abps}"
elif ( ( [ $hsize == 704 ] && [ $vsize == 480 ] ) ||
       ( [ $hsize == 720 ] && [ $vsize == 480 ] ) || 
       ( [ $hsize == 528 ] && [ $vsize == 480 ] ) || 
       ( [ $hsize == 640 ] && [ $vsize == 480 ] ) ) &&  
       ( [  "$vtype" == "MPEG1" ] || [ "$vtype" == "MPEG2" ] ) ; then
    echo "hsize = $hsize  vsize = $vsize  vtype = $vtype "
    export VIDOPTS="-ovc copy"
    if [ $avbps -gt 3000 ] ; then
      echo "${0}: Warning this files actual average bps is sampled as ${avbps} 
and is likely too high"
      echo "${0}:      to play on the mvpmc - reducing the bitrate to ${abps}"
      export VIDOPTS="-ovc lavc -vf harddup -lavcopts 
threads=${threadcnt}:vcodec=mpeg2video:keyint=18:vrc_buf_size=1835:vrc_maxrate=${mbps}:vbitrate=${abps}"
    fi
    if [ "${atype}" != "(mp3lib" ]  && [ "${atype}" != "mp3lib" ] ; then
      echo "${0}: Audio is $atype and will not work - transcoding the audio"
      export CONVERSION="Audio is ${atype} and will not work - transcoding the 
audio"
    elif [ "${VIDOPTS}" == "-ovc copy" ] ; then
      echo "${0}: This movie should play on the MVPMC - no transcoding needed"
      echo " "
      exit 0
    fi
elif [ $hsize == 320 ] && [ $vsize == 240 ] && [ "$vtype" != "MPEG2" ] ; then 
    # plays as postage stamp size
    # rescale to something that will play
    abps=`expr ${abps} / 4`
    mbps=`expr ${mbps} / 4`
    export CONVERSION="320x240 non-mpeg2 to mpeg2 conversion selected"
    export VIDOPTS="-ovc lavc -vf ${crop}scale=320:240,harddup -lavcopts 
threads=${threadcnt}:vcodec=mpeg2video:acodec=mp2:keyint=18:vrc_buf_size=1835:vrc_maxrate=${mbps}:vbitrate=${abps}"
elif [ $vbps -gt 10000 ] ; then
  echo "${0}: This file has a bit rate of $vbps and is to high to play on MVPMC 
- transcoding video to lower rate"
  export CONVERSION="bps to high convertion selected"
  export VIDOPTS="-ovc lavc -vf ${crop}${SCALE},${EXPAND},harddup -lavcopts 
threads=${threadcnt}:vcodec=mpeg2video:keyint=18:vrc_buf_size=1835:vrc_maxrate=${mbps}:vbitrate=${abps}"
elif [ "$vtype" != "MPEG1" ] && [ "$vtype" != "MPEG2" ] ; then
  echo "${0}: This file is not MPEG1 or MPEG2 - transcoding"
  export CONVERSION="non-mpeg2/mpeg1 to mpeg2 conversion selected"
  abps=`expr ${abps} / 2`
  mbps=`expr ${mbps} / 2`
if [ $hsize -eq 480 ] && [ $vsize -eq 480 ] ; then   
    export mbps=`expr ${vbps} \* 2`
    export VIDOPTS="-ovc lavc -vf ${crop}scale=640:480,harddup -lavcopts 
threads=${threadcnt}:vcodec=mpeg2video:keyint=18:vrc_buf_size=1835:vrc_maxrate=${mbps}:vbitrate=${vbps}"
 
  else
    export VIDOPTS="-ovc lavc -vf ${crop}${SCALE},${EXPAND},harddup -lavcopts 
threads=${threadcnt}:vcodec=mpeg2video:keyint=18:vrc_buf_size=1835:vrc_maxrate=${mbps}:vbitrate=${abps}"
 
  fi
elif [ "$atype" != "(mp3lib" ] && [ "$atype" != "mp3lib" ] ; then
  #
  # there is probably an audio bps limit - I have not yet seen a failure around 
it so won't
  # worry about the audio bps at this time
  #
  echo "${0}: This file does not use mp3lib audio and will not play correctly 
on audio on MVPMC (ac3 will play but be out of sync)"
  exit 0
elif ( [ $hsize == 352 ] && [ $vsize == 240 ] ) ||
     ( [ $hsize == 480 ] && [ $vsize == 480 ] ) ||
     ( [ $hsize == 528 ] && [ $vsize == 480 ] ) || 
     ( [ $hsize == 704 ] && [ $vsize == 480 ] ) || 
     ( [ $hsize == 720 ] && [ $vsize == 480 ] ) ; then
  echo "${0}: This video file is believed to work on MVPMC correctly - no 
changes needed"
  exit 0
else

  echo "${0}: Unknown MPEG1/MPEG2 with mp3 audio $hsize x $vsize it may or may 
not play correctly"
  exit 0
fi



echo "${0}: Conversion Type: " $CONVERSION
echo "${0}: Command line: "
echo "${0}: ${MENCODEROPTS} ${SWS} ${VIDOPTS} ${AUDIOOPTS} ${AUDIOEXTRA} 
${filename} -o ${filename}.mpg"
/usr/bin/time --verbose -o ${TMPFILE}.time ${MENCODEROPTS} ${SWS} ${VIDOPTS} 
${AUDIOOPTS} ${AUDIOEXTRA} "${filename}" -o "${filename}.mpg" 2>&1 | tee 
${TMPFILE}.transcode
if [ $? == 0 ] && [ -s "${filename}.mpg" ] ; then
  # only rename to original if original extension is .mpg or .mpeg
  if [ "${ext}" = "mpg" ] || [ "${ext}" = "mpeg" ] || [ "${ext}" = "MPG" ] || [ 
"${ext}" = "MPEG" ] ; then
    echo "${0}: Extension is a mpeg type extension - renaming "
    if [ -f "${filename}.orig" ] ; then
      echo "${0}: File ${filename}.orig already exists renaming original 
${filename}.orig to .2"
      if [ -f "${filename}.orig.2" ] ; then
        mv "${filename}.orig.2" "${filename}.orig.3"
      fi
      mv "${filename}.orig" "${filename}.orig.2" 
    fi
    mv "${filename}" "${filename}.orig"
    mv "${filename}.mpg" "${filename}"
  else
    echo "${0}: Original extension was not a mpeg extension"
    if [ -f "${obase}.mpg" ] ; then
      echo "${0}: File ${obase}.mpg already exists - not using"
    else
      echo "${0}: Renaming ${filename}.mpg to ${obase}.mpg"
      mv "${filename}.mpg" "${obase}.mpg"
    fi
  fi
fi
ls -l ${TMPFILE}.time ${TMPFILE}.transcode "${obase}"*
CPUpercent=`grep "Percent of CPU" ${TMPFILE}.time | awk '{print $7}'` 
ElapsedTime=`grep "Elapsed " ${TMPFILE}.time | awk '{print $8}'` 
Vbps=`grep "Video stream" ${TMPFILE}.transcode | awk '{print $3}'`
Abps=`grep "Audio stream" ${TMPFILE}.transcode | awk '{print $3}'`
Vsize=`grep "Video stream" ${TMPFILE}.transcode | awk '{print $8}'`
Vtime=`grep "Video stream" ${TMPFILE}.transcode | awk '{print $10}'`

logger -p info -t transcode  "Transcoded ${filename} 
(${hsize}x${vsize}-${Vtime} sec) in ${ElapsedTime} with ${CPUpercent} CPU to 
mvpmc with vbps=${Vbps}Kbps and abps=${Abps}Kbps"
echo "${0}: Transcoded ${filename} (${hsize}x${vsize}-${Vtime} sec) in 
${ElapsedTime} with ${CPUpercent} CPU to mvpmc with vbps=${Vbps}Kbps and 
abps=${Abps}Kbps"
date >> /tmp/makempeg2.log
echo "${0}: Transcoded ${filename} (${hsize}x${vsize}-${Vtime} sec) in 
${ElapsedTime} with ${CPUpercent} CPU to mvpmc with vbps=${Vbps}Kbps and 
abps=${Abps}Kbps" >> /tmp/makempeg2.log
if [ ${mythjob} -eq 1 ] ; then
#
# Code changes from Adam Siegel to fix seek table
#
  rm -rf ${filename}.orig
  FILESIZE=$(stat -c%s "${filename}")
  NAME=$(basename ${filename})
  CHAN=$(echo $NAME | sed -e 's/\(.*\)_\(.*\)\.mpg/\1/')
  START=$(echo $NAME | sed -e 's/\(.*\)_\(.*\)\.mpg/\2/')
  mysql -u mythtv -pmythtv mythconverg -e "update recorded set
  filesize=$FILESIZE where chanid=$CHAN and starttime='$START'"
  mythtranscode --mpeg2 --buildindex --allkeys --infile ${filename}
  mythcommflag -f ${filename} --queue
fi
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Mvpmc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mvpmc-users
mvpmc wiki: http://mvpmc.wikispaces.com/

Reply via email to