Fixed some bugs found in re-testing
[videoscripts/.git] / make_mkv
index c4f37072f1c075cb2d2ee2ed8e817a6d1a3d26d6..c3a23987ada1b60fb104d5708d4046218dbf55bf 100755 (executable)
--- a/make_mkv
+++ b/make_mkv
@@ -17,19 +17,12 @@ use DateTime::Duration;
 use DateTime::Format::Duration;
 
 ####################################################################################################
-# Configuration parameters - CHANGE THESE TO SUITE YOUR NEEDS
-my $mkvmerge='mkvmerge';
-my $ffmpeg='ffmpeg';
-my $handbrake='HandBrakeCLI';
-my $tmpfile = `tempfile`; chomp($tmpfile);
-my $chapter_file = $tmpfile;
-my $input_file_options = "-S";
-my $output_file_options = "--chapters $chapter_file --compression -1:none";
-my $timezone = `cat /etc/timezone`; chomp($timezone);
-my $interlaced_requantize_quality=0.85;
-my $progressive_requantize_quality=0.7;
-####################################################################################################
-
+# Configuration parameters
+$mydir = `cd \$(dirname $0) 2>/dev/null; pwd`; chomp($mydir); unshift @INC,("$mydir");
+# Default configuration values
+require "organize_videos.conf";
+# Override defaults with local customizations
+if( -f "$mydir/organize_videos.conf.local") { require "organize_videos.conf.local"; }
 
 ####################################################################################################
 # Command Line Options
@@ -165,7 +158,7 @@ foreach my $video (sort{$videos{$a} <=> $videos{$b}} keys %videos) {
        # Use HandBrake to requantize/deinterlace the input video
        my $video_mp4 = $video; $video_mp4 =~ s/\.[^.]*$//; $video_mp4 .= ".hb.mp4";
        print "   Re-quantizing input video content: $video_mp4\n";
-       my $handbrake_cmd = "$handbrake $deinterlace_option $requantize_option -E ac3 -i \"$video\" -o \"$video_mp4\" > /dev/null 2>&1";
+       my $handbrake_cmd = "$handbrake $deinterlace_option $requantize_option $handbrake_options -i \"$video\" -o \"$video_mp4\" > /dev/null 2>&1";
        if(! defined $opt_s) { 
            my $errno = system("$handbrake_cmd");
            $errno = $errno >> 8;