Last active
August 29, 2015 14:03
-
-
Save parastuffs/dbefc770532336238e75 to your computer and use it in GitHub Desktop.
Merge taht
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
#Add the mkvtoolnix install directory to your system's PATH. | |
use strict; | |
use warnings; | |
my (@videos); | |
my $baseName; | |
# Where you want the muxed videos to end up in. | |
my $outDir = "output"; | |
# Create the dir. | |
open(FD1,"mkdir $outDir |"); | |
close(FD1); | |
# Get all the video names from the current dir. | |
open(FD1,"dir /b | findstr \"^.*\.mkv$\" |"); #end with | to keep the filehandle open. | |
@videos = <FD1>; | |
close(FD1); | |
foreach my $l (@videos) { | |
chomp $l; | |
} | |
for(my $i=0;$i<@videos;$i++) { | |
$videos[$i] =~ m/(.*)(\.mkv)$/; | |
$baseName = $1; #MKV name without the ".mkv" | |
my $subTrack4 = $baseName.'_track4_fre.ass'; | |
my $subTrack5 = $baseName.'_track5_fre.ass'; | |
open(FD1, "mkvmerge -o \"$outDir/$videos[$i]\" --default-track 0:yes --forced-track 0:no --display-dimensions 0:704x528 --language 1:fre --track-name \"1:Audio francais\" --default-track 1:yes --forced-track 1:no --language 2:jpn --track-name \"2:Audio japonais\" --default-track 2:no --forced-track 2:no -a 1,2 -d 0 -S -T --no-global-tags --no-chapters \"$videos[$i]\" --language 0:fre --track-name \"0:Scenes coupees\" --default-track 0:yes --forced-track 0:yes -s 0 -D -A -T --no-global-tags --no-chapters \"$subTrack4\" --language 0:fre --track-name \"0:Sous-titres français\" --forced-track 0:no -s 0 -D -A -T --no-global-tags --no-chapters \"$videos[$i]\" --language 0:fre --track-name \"0:Sous-titres français\" --forced-track 0:no -s 0 -D -A -T --no-global-tags --no-chapters \"$subTrack5\" --track-order 0:0,0:1,0:2,1:0,2:0 |"); | |
while(defined(my $l = <FD1>)) { | |
print $l; | |
} | |
close(FD1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment