Difference between revisions of "Convert VHS to DVD"
From RonWareWiki
Line 55: | Line 55: | ||
getopt_simple $* | getopt_simple $* | ||
− | + | ||
− | |||
− | |||
− | |||
− | |||
if [ -z "$1" ] | if [ -z "$1" ] | ||
then | then | ||
− | echo "Syntax: dvd | + | echo "Syntax: dvd ISO-name" |
exit | exit | ||
fi | fi |
Revision as of 19:35, 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 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 ;; * ) target=$1 ;; esac shift done } getopt_simple $* if [ -z "$1" ] then echo "Syntax: dvd ISO-name" exit fi 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!"