Difference between revisions of "Convert VHS to DVD"
From RonWareWiki
Line 37: | Line 37: | ||
syntax() | syntax() | ||
{ | { | ||
− | + | cat <<'EOF' | |
+ | |||
Converts video from your FireWire device to a DVD. | Converts video from your FireWire device to a DVD. | ||
Syntax: dvd [options] [targetname] | Syntax: dvd [options] [targetname] | ||
Line 50: | Line 51: | ||
Make sure you have a blank DVD-R in your writer, and that the video feed has | Make sure you have a blank DVD-R in your writer, and that the video feed has | ||
begun, before you launch this script. | begun, before you launch this script. | ||
− | + | ||
+ | EOF | ||
} | } | ||
getopt_simple() | getopt_simple() | ||
Line 86: | Line 88: | ||
growisofs -dvd-compat -Z $writer=$target.iso | growisofs -dvd-compat -Z $writer=$target.iso | ||
echo "Done!" | echo "Done!" | ||
+ | |||
</pre> | </pre> |
Revision as of 19:51, 27 June 2007
Introduction
I've been trying to convert old VHS tapes of family events to DVD, so they would remain intact in the future. It is maddeningly difficult to get everything working under Linux, and there doesn't seem to be a "point-and-click" solution which works completely. This page is a guide to how I solved that problem in a manner satisfactory to me.
Requirements
You don't need a lot, but you will need:
- A VCR player with audio/video output. Most VCRs will work.
- An analog-to-digital converter. Mine is "Firewire" connected, which is recommended for capturing video streams.
- A DVD writer, and DVD-R media
- 'ffmpeg', with patches
- 'dvdauthor'
- 'mkisofs'
- 'growisofs'
Problems
Lots of things went wrong, trying to convert a simple VHS tape to DVD.
- At first I tried using Kino, but it always crashed at some point
- Using "dvgrab" to get the DV (digital video) directly, worked ok - but required over 20G for a 120 minute tape, and another 4G for the mpeg etc. Too much disk space.
- ffmpeg without options gave a nice small mpeg file, but it was in the wrong format to convert to DVD
- ffmpeg with the '-target dvd' option make a good mpeg for DVD, but a two-hour tape made an mpeg which was too big
- the burned DVD would not play in one of my players
- Saving DV and then converting to mpeg takes almost twice the runtime of the video
Example script
I call this script 'dvd'. Invoke it with the name of the ISO image you will want to create (without the .iso extension). Start playing your VCR, put a blank DVD-R in your writer, and after a bit you'll have a playable DVD of your VHS tape:
#!/bin/bash qscale=10 # MPEG quality duration=7200 # 2 hour tape target=video # name of the final ISO file device=/dev/dv1394-0 # Firewire device writer=/dev/hdc # device for DVD writer syntax() { cat <<'EOF' Converts video from your FireWire device to a DVD. Syntax: dvd [options] [targetname] Options: -30, -60, -120, -240 - record for that many minutes -d devname - set 'devname' to be your FireWire device (default: /dev/dv1394-0) -w devname - set 'devname' to be your DVD writer (default: /dev/hdc) -h - print this help If you don't provide a 'targetname', 'video' will be used (e.g. 'video.iso' will ultimately be produced). Make sure you have a blank DVD-R in your writer, and that the video feed has begun, before you launch this script. EOF } getopt_simple() { while [ ! -z "$1" ] do case "$1" in '-30' ) duration=1800 ; qscale=1 ;; '-60' ) duration=3600 ; qscale=5 ;; '-120' ) duration=7200 ; qscale=10 ;; '-240' ) duration=14400 ; qscale=15 ;; '-d' ) device=$2 ; shift ;; '-w' ) writer=$2 ; shift ;; '-h' ) syntax ; exit ;; * ) target=$1 ;; esac shift done } getopt_simple $* echo "Generating mpeg from raw DV" ffmpeg -f dv1394 -i $device -target dvd -t $duration -qscale $qscale $target.mpg echo "Turning the mpeg into a video DVD file system" dvdauthor -o $target.fs -t $target.mpg dvdauthor -o $target.fs -T echo "Making ISO" mkisofs -dvd-video -o $target.iso $target.fs echo "Burning DVD" growisofs -dvd-compat -Z $writer=$target.iso echo "Done!"