Suspend to disk

Started by davidb, 2013/02/27, 18:00:59

Previous topic - Next topic

piper

Using a mythtv server, Transcoding (when you decode video compressed in one format, and re-encode it in another) several recordings using something like
mythtranscode --chanid 1358 --starttime 2013-4-2-20-00-00 --mpeg2 --mycutlist
then do a ota hdtv to dvd with AC3 stream copy transcode
#!/bin/sh

# Step 1, generate DVD resolution file from HDTV content, preserving AC3 audio streams
# produce less log output with the -quiet switch
/usr/bin/nice -19 /usr/bin/mencoder -quiet -oac copy -of mpeg \
-mpegopts format=dvd:tsaf -vf scale=720:-3,harddup -ovc lavc -lavcopts \
vcodec=mpeg2video:vbitrate=4000:keyint=15 /myth/tv/$1 -o /myth/tv/$1.tmp

if [ "$?" -ne "0" ]; then
  echo "mencoder died"
  /usr/bin/nice -19 rm /myth/tv/$1.tmp
  exit
fi


# Step 2, replace orig HDTV file with transcoded DVD file
/usr/bin/nice -19 mv /myth/tv/$1.tmp /myth/tv/$1

# Step 3, clean up MPEG2 sync issues and using mythtranscode.  Output is a .tmp file.
/usr/bin/nice -19 /usr/bin/mythtranscode --mpeg2 -i /myth/tv/$1 --showprogress

# Step 4, replace DVD file with cleaned DVD file
/usr/bin/nice -19 mv /myth/tv/$1.tmp /myth/tv/$1

# Step 5, update index in database
/usr/bin/nice -19 /usr/bin/mythcommflag --rebuild -f /myth/tv/$1

# OPTIONAL Step 6, Flag commercials on final file
/usr/bin/nice -19 /usr/bin/mythcommflag -f /myth/tv/$1

#Only thing to sort out is updating the MySQL DB for the new filesize after transcoding
# to reflect the new file size. Any ideas on how to do this easily??

# ANSWER:
# You can do something like this:
SIZE=`ls -l $MYTHDIR/$1 | awk '{print $5}'`

mysql --user=(your username) --password=(your password) mythconverg << EOF
update recorded set filesize = '$SIZE' where basename = '$1';
EOF
build siduction and surf the web, all at the same time :)

I have done the above with a system with 2gbs of ram and 1gb of  swap, of course all my systems have at the least 4 gigs  now except my main. I never had any problems ;)
I have a Lucky Rabbit:    "Svoot" ..... (It's Swedish)

I am MAGA

davidb

I solved the problem with setting resume="/dev/sda8"
Thx for your help!