From Video Camera to DVD

From Nearline Storage
Jump to: navigation, search

To go from the Super Hi8 camcorder to a DVD

(These DVDs will play in standard DVD player)

  1. Pull the inputs from the back of the cable set top box and plug into the camera. (Use right (red) audio lead for audio output.)
  2. Exit Myth UI and do "sudo service mythbackend stop"
  3. Do "cat /dev/video > video.mpg" and then push play
  4. Do Ctrl-C when tape has finished
  5. Move the video off of the MythTV box
  6. Use avidemux to edit the MPG
    • Save as:
      • Video = Copy
      • Audio = Copy
      • Format = MPEG-PS (A+V)
  7. Use the prep4dvd script to convert to DVD-ready MPG format.
    • Experiment with the bitrate and the audio_routing settings as required (Ctrl-C during pass 1 will cause pass 2 to stop at the same spot, when it runs out of data in divx2pass.log)
      • The source bitrate off the PVR150 card is about 5000 kbps so no need to go higher than that
      • 4500 kbps took a full tape (7412.83 seconds = 2:03:32.83, 4.5GB) and shrank it enough to fit on a 4.4GB DVD-R (4.2GB). It took about an hour to process the video.
      • Assuming you used the right (red) lead to feed the audio from the camera then audio_routing="1:1:1:0" will create a mono soundtrack.
  8. Use DVDStyler to build the DVD ISO if you have multiple videos and need menus
  9. If you only have one video and you don't need menus, run these two commands to build the VIDEO_TS/AUDIO_TS structure in /home/dlk/dvd:
    • dvdauthor -t -o /home/dlk/dvd -f video.mpg
    • dvdauthor -T -o /home/dlk/dvd
  10. Burn DVD using K3B

prep4dvd Script

#!/bin/sh

bitrate="4500"
audio_routing="1:1:1:0"  #  number of channels : number of routings : from : to ...
audio_routing="2"  #  stereo, leave it alone
audio_shift="-delay 0.05"

#  Starting and ending position 
# startstop="-ss 00:00:22.522 -endpos 00:00:59.826"

#  Crop the garbage off the edges
# crop=",cropdetect"
crop=",crop=672:464:0:0 -zoom -xy 720"

#  Set host-specific options
mencoder="mencoder"
case "${HOSTNAME%%.*}" in
  mythtv)
    output_path="/storage/"
    ;;
  fang)
    output_path=""
#    mencoder="/home/dlk/src/mplayer/mencoder"
    ;;
  *)
    echo "Unknown host, please edit script to set output_path for this host"
    exit
    ;;
esac

#  Get input filename
input=$*
while [ -z "$input" ]; do
  read -p "Enter name of input file: " input
  if [ ! -e "$input" ]; then
    echo "Cannot find $input"
    unset input
  fi
done

for file in $input; do
  title=`basename "$file"`
  output="${output_path}${title%.*}.mpg"
  ctr=0
  while [ -e "${output}" ]; do
    output="${output_path}${title%.*}-${ctr}.mpg"
    ctr=$(( $ctr + 1 ))
  done

  $mencoder $startstop -nosound -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:480,harddup${crop} -lavcopts acodec=ac3:abitrate=128:vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=${bitrate}:keyint=15:vstrict=1:aspect=4/3:vpass=1 -ofps 30000/1001 -o /dev/null "$file"

  if [ "$crop" != ",cropdetect" ]; then
    $mencoder $startstop $audio_shift -oac lavc -af channels=${audio_routing},volnorm=2 -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:480,harddup${crop} -lavcopts acodec=ac3:abitrate=192:vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=${bitrate}:keyint=15:vstrict=1:aspect=4/3:vpass=2 -ofps 30000/1001 -o "$output" "$file"
  fi

  rm divx2pass.log
done