Workflow for converting mini DV tapes in Linux

I had a ton of home videos on miniDV tapes that I wanted to have available on my media PC, so I set up a few scripts to make this happen.

With the magic of inotify, it made the process fairly straightforward.

The first step is to start the inotify watch:

#!/bin/sh
#
# 
set -u
set -e
set -o noclobber

while true
do
	FILENAME=`inotifywait -r . -e close_write --format %f 2> /dev/null`
	echo $FILENAME

	if [[ "$FILENAME" = *.dv ]]
	then
		nice -20 ffmpeg -i $FILENAME -target ntsc-dvd completed/$FILENAME.vob
		rm $FILENAME
	fi
done

Then, start the file transfer:

dvgrab -f raw -autosplit -size 0 -showstatus -t -rewind

With short clips, the files are occasionally missed because ffmpeg is still running, so a final pass takes care of the missed files:

for i in *.dv; do ffmpeg -i $i -target ntsc-dvd completed/$i.vob && rm $i; done

Leave a Reply

Your email address will not be published. Required fields are marked *