# 2) mencoder : http://www.mplayerhq.hu/homepage/design7/dload.html
# 3) transcode : vi sources.list; deb ftp://ftp.nerim.net/debian-marillat sarge main
# apt-get install transcode
+# 4) avimerge : apt-get install transcode-utils
use Getopt::Std;
$merge_dir = "daily_clips";
$default_tape_name = "home_video";
$playlist_extension = "pls";
-$dvgrab = "/usr/local/bin/dvgrab";
+$dvgrab = "/usr/bin/dvgrab";
$mencoder = "/usr/bin/mencoder";
$mplayer = "/usr/bin/mplayer";
$avimerge = "/usr/bin/avimerge";
#$max_dv_clip_size_in_mb = "22000"; #avisplit still doesn't seem to do things right for large clips
# max_tape_grab_time=7200 Allows Max time of 2 hours to allow a tape to be dumped (good for 90 min tape)
# max_tape_grab_time=5400 Allows Max time of 1.5 hours to allow a tape to be dumped (good for 60 min tape)
-$max_tape_grab_time = 5400;
-$dvgrab_options = "--autosplit --timestamp --format dv2 --opendml --buffers 500";
+$max_tape_grab_time = 7200;
+#$dvgrab_options = "--autosplit --timestamp --format dv2 --opendml --buffers 2048 --rewind";
+#$dvgrab_options = "-autosplit -timestamp -format dv2 -opendml -buffers 2048 -rewind";
+$dvgrab_options = "-autosplit -timestamp -format dv2 -opendml -rewind";
$encode_options_pass1 = "-mc 0 -oac mp3lame -lameopts cbr:cbr=128 -ffourcc XVID -fps 29.97 -ovc lavc ";
$encode_options_pass1.= "-lavcopts vcodec=mpeg4:vhq:vbitrate=$bitrate:keyint=15:vpass=1 -vf pp=ci";
$encode_options_pass2 = "-mc 0 -oac mp3lame -lameopts cbr:cbr=128 -ffourcc XVID -fps 29.97 -ovc lavc ";
alarm(0);
sleep 5; # Give some time to catch an interrupt if needed
print "-> Done grabbing video from camera\n\n";
+
+ # Now see if we need to add a ".avi" extension to the video files dvgrab created
+ opendir(VIDEODIR, $video_directory) or die "-E- Could not open: $video_directory";
+ my @all_files = readdir VIDEODIR;
+ closedir(VIDEODIR);
+ foreach $file (@all_files) {
+ if(($file =~ /$opt_n/) && ($file !~ /$opt_n.*?\.avi/)) { rename("$file","$file.avi"); }
+ }
}
sub encode_videos {