setlocal move %1 %2 REM The variables below need to be changed to match your setup REM Please don't change the presence or absence of quotation marks as it may interfere with the functionality of the batch file Set CUTDIR=c:\Project\Converted set CAPDIR=c:\Project\misc set VDir=c:\VirtualDub SET WORKDIR=c:\PROJECT set SDIR=c:\Project\source set DG="%WORKDIR%\DGIndex.exe" set LM="%WORKDIR%\Lame.exe" Set WV="%WORKDIR%\Wavemp3.exe" set COMSKIP="%WORKDIR%\comskip.exe" set VDUB="C:\VirtualDub\vdub.exe" Set DC="%WORKDIR%\delaycut.exe" Set BS="c:\Besweet\BeSweet.exe" SET AVIWAV="%WORKDIR%\AVI2WAVCMD.exe" REM Set Program Locations set AVISYNTH1=LoadPlugin("%WORKDIR%\DGDecode.dll") set AVISYNTH2=LoadPlugin("%WORKDIR%\SimpleResize.dll") set AVISYNTH3=LoadPlugin("%WORKDIR%\Leakkerneldeint.dll") set AVISYNTH4=LoadPlugin("%WORKDIR%\MSharpen.dll") set AVISYNTH5=audio = WAVSource("%CAPDIR%\%~n2.wav") set AVISYNTH6=AudioDub(video, audio) REM Replace these example AVISynth commands here with your commands. Add more variables if required. start "Virtualdub" /low /wait %VDUB% /c rem *** %VDUB% /c rem %COMSKIP% %2 rem *** %DG% -IA=2 -FO=0 -OM=2 -AIF=[%2] -OF=[%~dpn2] -exit start "dgindex" /low /wait %DG% -IA=2 -FO=0 -OM=2 -AIF=[%2] -OF=[%~dpn2] -exit FOR %%G IN (%CAPDIR%\*ms.mpa) DO %DC% -auto -out %CAPDIR%\cutaudio.mpa "%%G" rem *** "%BS%" -core( -input "%CAPDIR%\cutaudio.mpa" -output "%CAPDIR%\%~n2.wav" -2ch -logfilea "C:\besweet\BeSweet.log" ) -profile( ~~~~~ Default Profile ~~~~~ ) start "besweet" /low /wait "%BS%" -core( -input "%CAPDIR%\cutaudio.mpa" -output "%CAPDIR%\%~n2.wav" -2ch -logfilea "C:\besweet\BeSweet.log" ) -profile( ~~~~~ Default Profile ~~~~~ ) del %CAPDIR%\*.mpa rem %CAPDIR:~0,2% REM Change working drive to CAPDIR's drive cd %CAPDIR% REM Change working directory to CAPDIR echo %AVISYNTH1% >>"%CAPDIR%\%~n2.avs" echo %AVISYNTH2% >>"%CAPDIR%\%~n2.avs" echo %AVISYNTH3% >>"%CAPDIR%\%~n2.avs" echo %AVISYNTH4% >>"%CAPDIR%\%~n2.avs" rem 4:3 screen echo Video=MPEG2Source("%CAPDIR%\%~n2.d2v").Crop(6, 6, -6, -6).LeakKernelDeint(1,10,false,false,false,false,false,0).LanczosResize(624,464).MSharpen(20,130) >>"%CAPDIR%\%~n2.avs" REM Widescreen rem echo Video=MPEG2Source("%CAPDIR%\%~n2.d2v").Crop(6, 60, -6, -60).LeakKernelDeint(1,10,false,false,false,false,false,0).LanczosResize(624,352).MSharpen(20,130) >>"%CAPDIR%\%~n2.avs" echo %AVISYNTH5% >>"%CAPDIR%\%~n2.avs" echo %AVISYNTH6% >>"%CAPDIR%\%~n2.avs" REM Create AVS files REM Add AVISynth commands to avs file created above. Add more lines if required REM Replace these example VirtualDub script commands here with your commands. Add more variables if required. echo VirtualDub.Open (u"%CAPDIR%\%~n2.avs"); > "%CAPDIR%\initial.txt" type "%CAPDIR%\%~n2.vcf" >> "%CAPDIR%\initial.txt" echo VirtualDub.audio.SetSource(1); >> "%CAPDIR%\initial.txt" echo VirtualDub.audio.SetMode(0); >> "%CAPDIR%\initial.txt" echo VirtualDub.audio.SetInterleave(1,500,1,0,0); >> "%CAPDIR%\initial.txt" echo VirtualDub.audio.SetClipMode(1,1); >> "%CAPDIR%\initial.txt" echo VirtualDub.audio.SetConversion(0,0,0,0,0); >> "%CAPDIR%\initial.txt" echo VirtualDub.audio.SetVolume(); >> "%CAPDIR%\initial.txt" echo VirtualDub.audio.SetCompression(); >> "%CAPDIR%\initial.txt" echo VirtualDub.audio.EnableFilterGraph(0);>> "%CAPDIR%\initial.txt" echo VirtualDub.video.SetInputFormat(0); >> "%CAPDIR%\initial.txt" echo VirtualDub.video.SetOutputFormat(7); >> "%CAPDIR%\initial.txt" echo VirtualDub.video.SetMode(1); >> "%CAPDIR%\initial.txt" echo VirtualDub.video.SetFrameRate(0,1); >> "%CAPDIR%\initial.txt" echo VirtualDub.video.SetIVTC(0,0,-1,0); >> "%CAPDIR%\initial.txt" echo VirtualDub.video.SetRange(0,0); >> "%CAPDIR%\initial.txt" echo VirtualDub.video.SetCompression(0x64697678,0,10000,0); >> "%CAPDIR%\initial.txt" echo // > "%VDIR%\VirtualDub.jobs" echo // $numjobs 2; >> "%VDIR%\VirtualDub.jobs" echo // >> "%VDIR%\VirtualDub.jobs" echo // $job "Job 1" >> "%VDIR%\VirtualDub.jobs" echo // $input "%CAPDIR%\%~n2.avs" >> "%VDIR%\VirtualDub.jobs" echo // $output "%CAPDIR%\%~n2.avi" >> "%VDIR%\VirtualDub.jobs" echo // $state 0 >> "%VDIR%\VirtualDub.jobs" echo // $start_time 0 0 >> "%VDIR%\VirtualDub.jobs" echo // $end_time 0 0 >> "%VDIR%\VirtualDub.jobs" echo // $script >> "%VDIR%\VirtualDub.jobs" type "%CAPDIR%\initial.txt" >> "%VDIR%\VirtualDub.jobs" type "%WORKDIR%\pass1.vcf" >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.video.filters.Clear(); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.audio.filters.Clear(); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.project.ClearTextInfo(); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.SaveAVI (u"%CAPDIR%\%~n2.avi"); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.audio.SetSource(1); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.Close(); >> "%VDIR%\VirtualDub.jobs" echo // $endjob >> "%VDIR%\VirtualDub.jobs" echo // >> "%VDIR%\VirtualDub.jobs" echo // $job "Job 2" >> "%VDIR%\VirtualDub.jobs" echo // $input "%CAPDIR%\%~n2.avs" >> "%VDIR%\VirtualDub.jobs" echo // $output "%CAPDIR%\%~n2.avi" >> "%VDIR%\VirtualDub.jobs" echo // $state 0 >> "%VDIR%\VirtualDub.jobs" echo // $start_time 0 0 >> "%VDIR%\VirtualDub.jobs" echo // $end_time 0 0 >> "%VDIR%\VirtualDub.jobs" echo // $script >> "%VDIR%\VirtualDub.jobs" type "%CAPDIR%\initial.txt" >> "%VDIR%\VirtualDub.jobs" type "%WORKDIR%\pass2.vcf" >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.video.filters.Clear(); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.audio.filters.Clear(); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.project.ClearTextInfo(); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.SaveAVI (u"%CAPDIR%\%~n2.avi"); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.audio.SetSource(1); >> "%VDIR%\VirtualDub.jobs" echo VirtualDub.Close(); >> "%VDIR%\VirtualDub.jobs" echo // $endjob >> "%VDIR%\VirtualDub.jobs" echo // >> "%VDIR%\VirtualDub.jobs" echo //-------------------------------------------------- >> "%VDIR%\VirtualDub.jobs" echo // $done >> "%VDIR%\VirtualDub.jobs" start "Virtualdub" /low /wait %VDUB% /r rem *** %VDUB% /r rem del %CAPDIR%\*.wav rem del %CAPDIR%\*.mp3 del %CAPDIR%\*.wav del %CAPDIR%\*.mp3 @%VDUB% /i %WORKDIR%\extractwav.vcf %CAPDIR%\%~n2.avi %CAPDIR%\%~n2.wav rem *** %LM% --preset cbr 192 "%CAPDIR%\%~n2.wav" "%CAPDIR%\%~n2.mp3" start "lame" /low /wait %LM% --preset cbr 192 "%CAPDIR%\%~n2.wav" "%CAPDIR%\%~n2.mp3" rem *** %WV% -q "%CAPDIR%\%~n2.mp3" start "Wavemp3" /low /wait %WV% -q "%CAPDIR%\%~n2.mp3" echo VirtualDub.Open (u"%CAPDIR%\%~n2.avi"); > "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.SetSource (u"%CAPDIR%\%~n2.wav"); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.SetMode(0); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.SetInterleave(1,500,1,0,0); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.SetClipMode(1,1); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.SetConversion(0,0,0,0,0); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.SetVolume(); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.SetCompression(); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.EnableFilterGraph(0); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.video.SetInputFormat(0); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.video.SetOutputFormat(7); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.video.SetMode(0); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.video.SetFrameRate(0,1); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.video.SetIVTC(0,0,-1,0); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.video.SetCompression(); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.video.filters.Clear(); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.audio.filters.Clear(); >> "%CAPDIR%\%~n2Audio.vcf" echo VirtualDub.SaveAVI (u"%CUTDIR%\%~n2.avi"); >> "%CAPDIR%\%~n2Audio.vcf" REM Merge compressed audio with AVI start "Virtualdub" /low /wait %VDUB% /s "%CAPDIR%\%~n2Audio.vcf" rem *** %VDUB% /s "%CAPDIR%\%~n2Audio.vcf" move %2 %SDIR% echo. >> c:\project\logfile.txt echo trancoded video files >> c:\project\logfile.txt rem dir c:\project\source\*.mpg >> c:\project\logfile.txt rem echo. >> c:\project\logfile.txt dir c:\project\converted\*.avi >> c:\project\logfile.txt echo. >> c:\project\logfile.txt del %CAPDIR%\*.avi del %CAPDIR%\*.vcf del %CAPDIR%\*.wav del %CAPDIR%\*.mp3 del %CAPDIR%\*.mpg del %CAPDIR%\*.mpa del %CAPDIR%\*.d2v del %CAPDIR%\*.avs del %CAPDIR%\*.txt endlocal