Updated for Ubuntu 22.04. Also fixed merge videos cmin check
[videoscripts/.git] / mkv_extract_chapter
index d8825ae2b7ed0f4f015e65840784730d4215a037..273484b82c7ed0cb299e39d8f3ff5303e5fe36bd 100755 (executable)
@@ -39,7 +39,7 @@ use Getopt::Std;
 ####################################################################################################
 # Configuration parameters - CHANGE THESE TO SUITE YOUR NEEDS
 my $ffmpeg=`which ffmpeg`; chomp($ffmpeg);
-my $tmpfile = `tempfile`; chomp($tmpfile);
+my $tmpfile = `mktemp`; chomp($tmpfile);
 ####################################################################################################
 
 ####################################################################################################
@@ -129,7 +129,7 @@ if(!$progressive) {
 # For each chapter specified on the command line, use ffmpeg to extract a video clip from that chapter
 my @ffmpeg_info = `$ffmpeg -i $opt_i 2>&1`;
 foreach $line (@ffmpeg_info) {
-    if($line =~ /Chapter #\d+\.(\d+): start (\S+), end (\S+)/) {
+    if($line =~ /Chapter #\d+\:(\d+): start (\S+), end (\S+)/) {
        $chapter = $1;
        $start = $2;
         if($start > 0) { $start += 1; } # Add some margin to prevent taking a piece of the previous clip