Copyright 2022 - Custom text here

ConcatenateVideoFiles_Bis.pl

#!perl.exe
use File::Basename;
use Win32::process;


$vddir = "C:\\Program Files\\video_tools\\VirtualDub-1.6.12";

$directory = $ARGV[0];

$directory_bs = $directory;
$directory_bs =~ s/\\/\\\\/g; # with supplementary backslash
$vcf_file="conc.vcf";

open(VCF,">$vddir/conc.vcf") || die "Cannot open $vddir/conc.vcf: $!\n";

$i=0;
opendir D, $directory || die "Cannot open $directory:";
foreach $f (readdir D) {
    # We leave the special directories alone, or we'll never finish.
    next if $f =~ /^\.{1,2}$/;
    if( $f =~ /\.avi$/ ){
       print "$f\n";
        if( $i==0) {
                print VCF "VirtualDub.Open(\"$directory_bs\\\\$f\",0,0);\n";                              
        }else{
                print VCF "VirtualDub.Append(\"$directory_bs\\\\$f\");\n";
    }
    $i++;
    }
}
closedir D || die "Cannot close $directory: $!";
                       
print VCF <<balise_vcf;
VirtualDub.audio.SetSource(1);
VirtualDub.audio.SetMode(0);
VirtualDub.audio.SetInterleave(1,500,1,0,0);
VirtualDub.audio.SetClipMode(1,1);
VirtualDub.audio.SetConversion(0,0,0,0,0);
VirtualDub.audio.SetVolume();
VirtualDub.audio.SetCompression();
VirtualDub.audio.EnableFilterGraph(0);
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetCompression(0x78766964,0,10000,0);
VirtualDub.video.SetCompData(512,"zAEAAAAAAAAAAAAA4MgQAAAAgEABAAAAAAAAAAAAAAAAAAAAAAAAACwBAAAyAAAAIBFqAAAAMAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmpmZmZmZyT+amZmZmZnJPwIAAAAAAAAAAAAAAIACAADgAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOA/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAZAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAGM6XGRpdngubG9nAGM6XHRlc3QuZGl2eABjOlxtdmluZm8uYmluAGM6XG5ld3JjLnR4dAA=");
VirtualDub.video.filters.Clear();
VirtualDub.audio.filters.Clear();
VirtualDub.SaveAVI("$directory_bs.avi");
VirtualDub.Close();
balise_vcf
close(VCF);

Win32::Process::Create($ProcessObj,
    "$vddir\\VirtualDub.exe",
    "VirtualDub.exe /s\"$vcf_file\" /x /r",
    0,
    NORMAL_PRIORITY_CLASS,
    $vddir) || die ErrorReport();

    $exitcode = 1;

    $ProcessObj->Wait(60000000);
    $ProcessObj->GetExitCode( $exitcode );

if( $exitcode != 0 ){
    $ProcessObj->Kill( $exitcode );
    print "Process Killed<BR>\n";
}


sub ErrorReport{
       print Win32::FormatMessage( Win32::GetLastError() );
}
f t g m