use Time::localtime;
# Early command line options processing
-getopts("qrh:tvs:");
+getopts("qkh:tvs:");
my $srcpathname = $opt_s;
####################################################################################################
my $video_title_prefix = "HomeVideos:"; # What text to put on the front of the title for the merged video being created
my $find_cmd = "find \"$srcpathname/\" -iregex \".*\.mov\" -o -iregex \".*\.3gp\" -o -iregex \".*\.mp4\" -o -iregex \".*\.mts\"";
my $handbrake='HandBrakeCLI';
+my $handbrake_options='--strict-anamorphic --crop 0:0:0:0 -E ac3';
my $interlaced_requantize_quality=0.85;
my $progressive_requantize_quality=0.7;
####################################################################################################
print " -h <compute host> specify the remote compute host to submit the mkvmerge job to\n";
print " -v verbose mode; print extra information about what is being found/merged\n";
print " -t test mode; print what will happen, but don't do anything\n";
- print " -r remove merged video clips; after a merge, remove the individual video files that were merged\n";
+ print " -k keep the individual video files that are merged. By default, after a merge, individual video files that were merged are removed\n";
print " -q Requantize MTS input videos to decrease output video size (requires HandBrakeCLI)\n";
return 1;
}
print " Re-quantizing input video content: $video\n";
my $handbrake_cmd = "";
if($use_compute_host) { $handbrake_cmd .= "ssh $compute_host 'cd \"$pwd\";"; }
- $handbrake_cmd .= "$handbrake $deinterlace_option $requantize_option -E ac3 -i $srcvideo -o \"$video\" > /dev/null 2>&1";
+ $handbrake_cmd .= "$handbrake $deinterlace_option $requantize_option $handbrake_options -i $srcvideo -o \"$video\" > /dev/null 2>&1";
if($use_compute_host) { $handbrake_cmd .= "'"; }
if(! defined $opt_t) {
my $errno = system("$handbrake_cmd");
die "-E- handbrake encountered some errors with exit code $errno\n";
} else {
# Remove the original srcvideo since we created a new version of it that we are going to keep instead
- if(defined $opt_r) {
+ if(!defined $opt_k) {
system("rm -f $srcvideo\n");
}
}
if(defined $opt_t) {
print "\n-> Creating \"$video\"\n";
print "$cmd\n";
- if(defined $opt_r) {
+ if(!defined $opt_k) {
foreach $video (@{$videos{$ext}{$video}}) {
print("rm -f $video\n");
}
system("chgrp $group \"$video\"");
system("chmod $mode \"$video\"");
# Remove the individual video files
- if(defined $opt_r) {
+ if(!defined $opt_k) {
foreach $video (@{$videos{$ext}{$video}}) {
system("rm -f $video");
}