projects
/
videoscripts
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
75451c9
)
Tweaked start time by 1 sec to avoid getting piece of earlier clip
author
Alan J. Pippin
<alan@pippins.net>
Sat, 19 Nov 2011 01:42:29 +0000
(18:42 -0700)
committer
Alan J. Pippin
<ajp@pippins.net>
Sat, 19 Nov 2011 01:42:29 +0000
(18:42 -0700)
mkv_extract_chapter
patch
|
blob
|
history
diff --git
a/mkv_extract_chapter
b/mkv_extract_chapter
index 53d3cb741d016820b0ebef43cd21370d2b9a55a1..9f5fd81a5949d6a70a0d71e4a712095bbd6a55c2 100755
(executable)
--- a/
mkv_extract_chapter
+++ b/
mkv_extract_chapter
@@
-1,6
+1,7
@@
#!/usr/bin/perl
# Author: Alan J. Pippin
# Description: Extract the given chapter(s) from an mkv file into separate video files
#!/usr/bin/perl
# Author: Alan J. Pippin
# Description: Extract the given chapter(s) from an mkv file into separate video files
+# Requires: Newer version of ffmpeg to be installed that supports MKV chapters
# MOV:
# major_brand : qt
# MOV:
# major_brand : qt
@@
-113,6
+114,7
@@
foreach $line (@ffmpeg_info) {
if($line =~ /Chapter #\d+\.(\d+): start (\S+), end (\S+)/) {
$chapter = $1;
$start = $2;
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
$end = $3;
$duration = $end - $start;
if($duration < 0) { die "-E- Unexpected negative duration detected for chapter $chapter\n"; }
$end = $3;
$duration = $end - $start;
if($duration < 0) { die "-E- Unexpected negative duration detected for chapter $chapter\n"; }