X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;f=make_mkv;h=4c411529b887953d9e7a33df97ebedb4343cce14;hb=75913896fe5842b5783d61a8a0c9b709940faf5d;hp=ea3b50cda0238ed603ba06fe93acff191f76eed1;hpb=be9a9d1914a8f80b031631f902c9daae0b8f6d90;p=videoscripts%2F.git diff --git a/make_mkv b/make_mkv index ea3b50c..4c41152 100755 --- a/make_mkv +++ b/make_mkv @@ -6,7 +6,7 @@ # mkvtoolnix - http://www.bunkus.org/videotools/mkvtoolnix/ # ffmpeg -########################### +#################################################################################################### # Includes use File::Copy; use File::Basename; @@ -16,17 +16,19 @@ use DateTime; use DateTime::Duration; use DateTime::Format::Duration; -########################### -# Configuration parameters +#################################################################################################### +# Configuration parameters - CHANGE THESE TO SUITE YOUR NEEDS my $mkvmerge=`which mkvmerge`; chomp($mkvmerge); my $ffmpeg=`which ffmpeg`; chomp($ffmpeg); my $tmpfile = `tempfile`; chomp($tmpfile); my $chapter_file = $tmpfile; my $input_file_options = "-S"; my $output_file_options = "--chapters $chapter_file"; +#################################################################################################### -########################### -# Options + +#################################################################################################### +# Command Line Options getopts("st:o:i:h"); if(! -x $mkvmerge) { die "-E- Unable to find required program: mkvmerge\n"; } @@ -45,7 +47,7 @@ sub usage { return 1; } -########################### +#################################################################################################### # Helper Subroutines sub epoch_to_date { my ($epoch) = @_; @@ -53,7 +55,7 @@ sub epoch_to_date { return sprintf("%4d",$mtime->year)."-".sprintf("%02d",$mtime->month)."-".sprintf("%02d",$mtime->day)." ".$mtime->hms; } -########################### +#################################################################################################### # MAIN # Turn the list of input videos into a hash with a value equal to the modification time in epoch seconds @@ -123,8 +125,8 @@ if(! defined $opt_s) { if($errno > 1) { die "-E- mkvmerge encountered some errors with exit code $errno\n"; } } -# Remove the temporary file +# Remove the temporary file used for the chapter generation if(-e "$tmpfile") { unlink "$tmpfile"; } -########################### +####################################################################################################