#!/bin/bash cd /mnt/bigstore/Centos5/mythrecs # prototype is # echo " mencoder -aid 0 -oac copy -ovc copy -of mpeg -mpegopts format=dvd:tsaf \ " # echo " -o outfile.mpg infile.mpg0 " # # if [[ fileexists $1.mpg ] and [ not fileexists $1.mpg0 ]] # then # mv $1.mpg $1.mpg0 # fi # echo "Output $1.mpg has video(0) and audioStream(0) " echo "copied from video(0) and audioStream($2) of " echo "the input mythtv recording previously renamed " echo "from $1.mpg to $1.mpg0 " echo echo "Stream ids can often be found from ffmpeg -i $1.mpg0 " echo echo "Expected Command Line is of the form ./mpg_axx 2703_20070927190000 0x0 " echo if [ $# -lt 2 ] then echo "Error: needs two arguments " ffmpeg -i $1.mpg0 cd ~ exit 1 fi echo "Command generated this time is " echo echo " mencoder -aid $2 -oac copy -ovc copy -of mpeg -mpegopts format=dvd:tsaf \ " echo " -o $1.mpg $1.mpg0 " echo # now issue command # mencoder -aid $2 -oac copy -ovc copy -of mpeg -mpegopts format=dvd:tsaf \ -o $1.mpg $1.mpg0 # # and rebuild the Keyframe Index # mythtranscode --mpeg2 --buildindex --showprogress --infile $1.mpg # echo "Output file is $1.mpg " echo cd ~ exit 0