summaryrefslogtreecommitdiff
path: root/Tools/schnitt/cut2.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/schnitt/cut2.pl')
-rwxr-xr-xTools/schnitt/cut2.pl39
1 files changed, 39 insertions, 0 deletions
diff --git a/Tools/schnitt/cut2.pl b/Tools/schnitt/cut2.pl
new file mode 100755
index 0000000..6131e88
--- /dev/null
+++ b/Tools/schnitt/cut2.pl
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+$titel = $ARGV[0];
+
+chdir ("/x2/temp");
+
+@files=<teil*.mpg>;
+$cd = 1;
+mkdir "/x2/temp/$cd";
+open (FF,">/x2/temp/$cd/$titel\ CD\ $cd");
+close (FF);
+
+foreach $file (@files)
+ {
+ $size = -s $file;
+ $total += $size;
+ if ($total <= 660*1024*1024)
+ {
+ print "Moving $file\n";
+ system ("mv /x2/temp/$file /x2/temp/$cd/$file");
+ }
+ else
+ {
+ print "Splitting $file\n";
+ $file =~ s/\.mpg$//;
+ $total -= $size;
+ $size = (660*1024*1024) - $total;
+ $cd = `cut3.pl /x2/temp $cd $file $size \'$titel\' < $file.mpg`;
+ chomp $cd;
+ $total = 0;
+ @files2=</x2/temp/$cd/teil*>;
+ foreach $file2 (@files2)
+ {
+ $total += -s $file2;
+ }
+ print "CD: $cd Total $total\n";
+ unlink "$file.mpg";
+ }
+ }