Virtualdub Batch Video DeShake
https://sourceforge.net/projects/virtualdub-batch-video-deshake/
Batch to compress [and deshake] all videos [or images] in folder
Installation:
Execute "DeShakInst.BAT"
VirtualDub2 44282; AviSynth+ 3.7.5 updated to C:\DVD
DESHAK.BAT updated to C:\UT and added to PATH
Usage:
DESHAK task[s] [parameters]
Tasks:
tp1: deshake pass1 LOG generation for 2nd pass
tp2: deshake pass2 and compress video and audio to MP3
tcomp: compress (no deshake)
twav: extract WAV and/or uses external WAV audio
Parameters (more in help):
vEXT: video extension (ie: vmov), default: vAVI
qN: h264 quality 1-9 (9=lossless), def: q3 (crf23)
aN: mp3 quality 1-5, def: a3 (192k)
* generates: ZZoriginalname.AVI
* inner settings on first lines ie: Audio synch delay (line 46)
Min Requirements:
XP; Win7x64 for aviSynth video NoiseReduction
Klite Mega Codec Pack (with LAME encoder)
Other Utilities:
LOG2CHAPS.BAT generate _OGG.txt chapters @ scene change
VID2AUD.BAT extract Audios
VID2MKV.BAT multiplex vid+aud+chapters
VIDJOIN.BAT merges videos to MKV
Features:
Help screen if no tasks
Secure: never modify/overwrite/delete any media file
Resume: skips already done ZZ*.* files
[twav] Task Wav: extract/uses eachfile.WAV audio
[tp1] Task Pass1: generete Deshake 1st pass eachfile.LOG
[tp2] Task Pass2: Deshake and Compress to ZZeachfile.AVI
[tcomp] Compress to ZZeachfile.AVI (no deShake)
[vAVI|vAVS|vDV|vM2T|vMKV|vMOV|vMP4|vMPG|vMTS|vWMV] video input extension {Default AVI}
[vBMP|vJPG|vPNG] input image: generate 120frames NTSC {set on lines 17-18} uses AviSynth
yXXXX generates AviSynth script:
[yFPS] force {line 18}frames per second {edit DESHAK.BAT}
[yTrim] trims {line 19}frames from end
[yBadPix] InpaintDelogo badpixel remove using MASK.BMP file on VDub folder
[yCrop] crops {lines 15-23} pixels, 1stPass too
[yReSz] resize to {line 22}, 1stPass too
[yALev] auto Levels
[yAWB] auto WhiteBalance
[yLev0.n|yLev1.n] reduce/increase Gamma Levels
[YV12|yRGB] avisynth output YV12 or RGB
[yNRnnn] noiseReduction degrainTemporalRatio=0..3,grainLev=0..3, postFFT=0/1/3 {x64,slow}
[yNRFnn] noiseReduction fast: deGrTR{temporal}=0..3,grainLev=0..3
[ySign] moving text shifting color during all video {lines 25-27}
[yTit] text title for 3s {warning: deshake may "shake" title} {lines 28-30}
cXXXX compress vid: [cH264[v]|cH265[v]|cLag[R]|cFFV[R]|cNO] {def. h264}
...[v] suffix: use VidForWin; Lagarith/FFV [R] suffix use RGB; cNO=q0 direct copy
qXXXX quality of h26x: [q1 - q9] {q9=lossless} {def. q4=crf21}
[q0] only for non h26x AVIs, directcopy video without any processing
[qvslow|qslower|qslow|qmed|qfast|qfaster|qvfast] speed vs size {def. qvslow}
[qFilm|qAnim|qGrain|qStill][qFDec][qZLat] h26x Tune {def.none}
[qb8|qb10|qb12] Bits select {def.qb8}
[qNtsc|qWNtsc|qXNtsc| qPal|qWPal|qXPal |qHDV| qTV]: SampleAspectRatio -ch265i
...10/11,40/33,32/27, 59/54,16/11,64/45, 4/3,3/4 {tv,tvW,dvdW HDV,TV} {Def 1/1}
fXXXX filters: [fColLtd|fColFul] Color space Limited|Full
[fGam[0.n^|1.n]] Gamma 0.n Decrease/ 1.n Increase levels {def. 1.4}
[fYadif] Deinterlace
[fBadPix] badpixel remove using delogo and BADPIXEL.BMP file on VDub folder
[fDeBlk] deblock, **x32 only plugin**
[fCrop] Crop {lines 32-33}pixels from Left,Right,Top,Bottom
[fSmooth] Smoother Spatial degrain
[fTemp] Temporal Smoother degrain
[fGray] Convert to Gray
[fRotL|fRotR|fRotA] rotate Left:90, Right:-90, Around:180
[fFPS2] duplicate frame rate
dXXXX Deshake parameters: [dCrop] 1st pass crop {lines 37-40}pixels
[dSmooth] strong 1st pass deNoise
[dMore] deshake extra stabilize X Y
[dNoX] no stabilize X Y movements {ie: for tripod footage}
[dNoR] no stabilize Rotation
[dNoZ] no stabilize Zoom {ie: for prime lens footage}
[dNoS] no Stabilize, only RS/deinterlace= dNoX + dNoR + dNoZ
[dIntB|dIntT] deInterlace by doubling frame rate use Bottom/Top field 1st
[dInc] for loRes dsBlkSz=15, analyze all pix, incr # prev/next border frames
[dT3i|dT5i|d70d|d80d|d5d] Correct Canon RollingShutter (56%/45%/62%/45%/70%)
rXXXX resize: [r720b] resize to 720x576 {AR 5:4}
[r640|r768|r960|r1440] 720x576, 640x480 768x576 960x720 1440x1080 {4:3}
[r1440b] 1440x1080 w/black bars to fill 1920x1080 {16:9}
[r720|r1620|r1080] 720x480 1620x1080 1080x720 {3:2}
[r1620b] 1620x1080 w/black bars to fill 1920x1080 {16:9}
[r852|r1280|r1920] 852x480 1280x720 1920x1080 {16:9}
[rHalf] halfSize, can combine ie: r640rHalf=320x240
aXXXX Audio options: [aNO] noAudio
[a0] no compression use PCM
[a1..a5] MP3 Bitrate 128/160/192/256/320 {default a3=192}
[aFL] flac ffmpeg lossless
[aCD] 44kHz sampleRate {default 48kHz}
[aMono] mono {default stereo}
[aXP] use acm mp3 codec instead of ffmpeg {for winXP}
[aDelay] delay {line 46}ms to fix audio/video synchro
/Switches: [/32] use vDub32 {def. if fDeBlk specified}
[/64] use vDub64 {def. under x64 win}
[/debug] extra info
[/keep] don't del temp *.Script/*.avs files
[/noDEL] on error don't del unfinished AVIs
[/noERR] on error continue with next file
[/noPAU] No Pause at end
[/OFF] Power off 8 minutes after end
[/sample] do only a few {line 47-48}frames {tp2/tcomp}
Presets: pCrop{=dCrop+fCrop}: Crop both passes
pVidN= fCropA qNtsc dInc dIntB : For ntsc dv/video8 footage
Needed files/plugins:
klite Mega Codec Pack: http://www.codecguide.com/download_k-lite_codec_pack_mega.htm
(make sure to install LAME encoder, and video encoders)
VirtualDub2: https://sourceforge.net/projects/vdfiltermod/files/VirtualDub%20pack/
deShaker v3.1: http://www.guthspot.se/video/deshaker.htm
For some options:
aviSynth+ >=v2.70: https://sourceforge.net/projects/avisynth2/files/?source=navbar
{For NR: AutoLevels, LSMASHSource, TemporalDegrain...avsi, BestSource, mvtools2, Neo-FFT3D, RgTools }
{For BadPix: AvsInPaint grunt InpaintDelogo.avsi masktools2 RT_Stats_x64 }
deLogo: http://www.softpedia.com/get/Multimedia/Video/Other-VIDEO-Tools/DeLogo.shtml
MSU_SmartDeblock_0.8 (x32 only): http://www.compression.ru/video/deblocking/smartdeblocking_en.html
x264vfw 8bit (for ch264v): https://sourceforge.net/projects/mpxplay/files/x264vfw/
x265vfw 8bit (for ch265v): https://sourceforge.net/projects/mpxplay/files/x265vfw/
dShutdown: http://dimio.altervista.org/eng/
Batch will try to find VirtualDub if not correctly specified on 2nd line.
Avoid international chars on filenames or LOGs may have to be manually renamed.
*** If running in a 64b OS, make shure to have latest VDUB2 x32 patched
*** using VdubFolder\extra\AuxSetup.exe (First checkbox: Enable LAA)
History:
v25.0528 x64=1 for vdub64, yBad yNR warning and ignored under x32
v25.0527 ZZ{dsPass}filename.AVS aviSynth script 1st pass for ycrop yres
v25.0525 ds1, ds2.script; fix bug since 25.0331: if "!doDeBlk!!dsPass!"=="12" instead of "10"
v25.0524 aviSynth yCrop
v25.0523 aviSynth yBadPix: InpaintDelogo badpixel remove using MASK.BMP file on VDub folder
v25.0515 fix help bug missing caret: yNR120^|yNRF12; defaults dcrop 1st "nCropPix1L=%nCropPixL%+4"
v25.0509 dNoXY is now: dNoX,dNoY; yNRFnn {fast noise reduction}
v25.0508 ylev1.0 nop; avsyNR instead of avsyTemporalDegrain2
v25.0505 yReSz line 30
v25.0504 dMore instead of dMovX
v25.0503 subGetKey bug under winXP; ynr help
v25.0413 renumber xerrlevel for avisynth from 110+, still images: check existance of ImageSeq.dll; added /x86=/32 etc
v25.0408 fGam=old [fLev] 0.n 1.n; xDebug ---; yAWB, yALev= old [yAutoWB,yLev]; yLev
v25.0406 q9 lossless
v25.0403 cFFV cFFVR; bug if AVS didn't have audio; bug: Lagarith settings REG ADD
v25.0402 cLag cLagR; subGetKey
v25.0331 fLev[n] levels 1.n ; dCrop/fCrop 1st/2nd pass for all borders; use "" in all SET
v25.0329 autolevels first, better error handling
v25.0326 subAvsyExist for plugin check
v25.0324 YV12/ yRGB, do yv12 only once; dsInterlTop bug
v25.0318 del temp bsindex, avsy files verify
v25.0317 aspect ratio includes deshaker now {dNTSC,etc}: qNtsc qWNtsc qXNtsc qPal qWPal qXPal qHDV qTV
v25.0309 fixed yNR convertToYV12; avsy order yfps fix
v25.0308 fixed avsy in using aviSource for vavs
v25.0305 /deb implies /kee; ynr validate numbers SUBGETNUM; dntsc2
v25.0209 /debug; avsyTemporalDegrain2
v24.0201 set vDub32,vDub64
v24.0131 mediainfo.exe for automatic canon camera detect/ dinc on 720p or lower
v24.0108 added yLev; aviSynth cache to same dir
v25.0103 SAR: dTV 3/4; qTV 3/4
v24.1023 r1080,r1620b
v24.1022 yFPS; dCro=dCrop1; avsyNumeratorFPS=avsyImgNumeratorFPS; no var avsyFPS
v24.1010 vM2T; dHDV 4/3; qHDV 4/3
v24.1002 fSmooth/fTemp filters applied after deShake
v24.0930 aDelay; yTrim; avsy..=avs..; fFPS2=fFPSx2; synonyms: rfhd=r1920, yawb=raut (=rautoWB), abbrev. some commands; better help
v24.0918 moved setlocal to top protecting external caller vars
v24.0907 admit - for switches; remove var FLMARK {=ZZ}
v24.0905 fTemp smoother; dInterlB=dint: 4/3 letter abbreviations for most commands unless not unique
v24.0904 del badFiles on /noErr; better error handling; switches with / instead of x
v24.0902 added quotes on some assignments; xDebug=xInfo; avs was not deleted on error
v24.0825 [-doBadPix] badPixFl= badpixel.bmp or !vdLoc:\=/!badpixel.bmp; only Warning on error
v24.0823 x265i qvfast missing; reverse order: qvslow priority
v24.0809 dInc dsBlkSz=15 instead of 20; yAutoWB
v24.0715 cNO, xInfo, fixed AVS, silent audio to stillImages
v24.0714 general doNumeratorFPS, doDenominatorFPS not in use yet; removed vidExt, inFilePathName=!inFilePath!!inFileName!
AVSzzFile w/path in AVSsript gen; images:doDeshake=0
v24.0610 FILE_NAME instead of ztitle; inFileExt=procExt; avs...=aviSynt...; doAVS flag
v24.0606 var rename: numeratorFPS=forceFPS, denominatorFPS=changeFPS, aviSynthPhotoFPS=avsNumeratorFPS; avsDenominatorFPS
v24.0604 add vAVS; r1440, r1440b; fFPSx2 2nd pass only move to last; fgray after deshake
v24.0603 moved 2ndpass only filters check to script generator, moved up most 2nd pass settings to common filters section
v24.0602 improved var names, replaced dsInterl=dsInt, dsBott=dsIntB, FLNM=inFileName, FLpath=inFilePath; inFilePathName, doneFile=outFilePathNameExt,
more vdub locations search, prefixed scripts vars with avs/vd: avsInFileName, vdInFile vdInFilePath vdInFilePathName
v24.0601 xSample beg-end; Use dsIntT in ds; dintb use dsIntB in bobdoubler instead of always tff; ds tp1 #18:"3" show 5x vectors
v24.0530 improved help, x prefix switches, fdeBlk check x32
v24.0530 moved [dsXY {and increased: dsRot, dsZoom}] to top {lines 21-27}, replaced parentheses with {} on texts
v24.0528 dNoS bug correction
v24.0310 better help, a44=aCD; qntsc2,qpal2 *except x265v pending*
v24.0309 better ReSize help, rvga,rfull as synonyms; added r720b{x576} r720{x480}
v24.0308 avsNumeratorFPS=numeratorFPS in line 13; dsBlkSz in line 24; nCropPix1{LRTB} 1st pass; dSmooth1; use "" in all IF
v24.0307 dsInc: dsBlkSz=20; POFF instead of OFF; better REMs; fFPSx2: dupe frame rate deshake will interpolate new frames
v24.0306 accept pVideo8N, pVid8N; pCropA preset crop ALL; dCrop1 crop only in 1st pass; dNoS as preset
v24.0227 better help
v24.0225 vdub version check x64 fix; fRotA around instead of fRotB bottom; deBlk forces vdub x32
v24.0221 vDV
v23.0825 aXP; aFL
v23.0511 set isiVersion; don't use twav if aNO, crop line order L R T B
v23.0509 pVideo8N rename to pVid8N and changed: dintb {interlace bottom}, removed q6
v23.0508 h265v sar
v23.0425 qNtscW qPalW
v23.0424 fix interl 2xFrames by adding: VirtualDub.video.filters.BeginUpdate / EndUpdate
v23.0423 pVideo8N: dintT; dntsc 10/11=0.909 instead of 0.09...; not exist vdub.exe: use new commands
v23.0422 rename fyadif=fdeint, pix=pixel, blk=block; PRESET pVideo8N; better deShake documentation; fCrop[]=cropX
v23.0419 %PARAM...% with ""; dsPixRat: dPal/dNtsc dInc:dsPixAll; dNoX dNoS dInt/dIntB: DeInterlace
v23.0214 resize use lanczos3 instead of bicubic; h265 default to qslow, echo ... for compressor settings
v23.0118 cropX=0 without leading space
v23.0117 enabled badPixel for x64; fRotX; validate delogo filter
v22.1124 aviSynthTrim: avisynth truncate # frames on line 13
v22.1120 if defined ProgramFiles(x86^)...
v22.1119 aviSynthTitDur on header; repl aviSynthTit, aviSynthColorTit, aviSynthSign, aviSynthColorBeg/End with aviSynthTitStr, aviSynthTitCol, aviSynthSignStr, aviSynthSignColBeg
v22.1117 vd32; default x64 on 64bit systems
v22.0919 better help, bug vdub path w/spaces; h26x presets: qTxxxx to qXxxx; dLoRes to dInc
v22.0917 change switches (no Z prefix) and iAVI to vAVI
v22.0818 added fCrop{LRTB} nCropPixX; better batch structure
v22.0805 qNtscDV is 8/9 instead of 9/8; corrected h265v AspectRatio settings
v22.0704 better help; added undocumented rful=r1920 resize to fullHD
v22.0628 added r1440x1080 with reSzCropX Y for black borders
v22.0627 still images with aviSynth iJPG iBMP iPNG
v22.0615 aviSynthColorTit; bugs: missing "" in del "%%~dpI!FLNM!.avs"; genAVS added ConvertFPS=true avoids dropping blank frames
v22.0531 ds.script h264x generation split; qPalDv/qNtscDv/qPalAn/qNtscAn
v22.0526 deshake enable detect scene change
v21.1104 CodePage: cp 1252 for filenames with foreign chars in avisynth
v21.0908 aviSynthColorBeg/End @line8
v21.0906 z64; qTxxxxx, qFDec, qZLat, qBn; cH264i/cH264v/cH265i/cH265v/cLagI/cLagV; default qb8
v21.0830 splited h264 internal/vfw params; changed [h26xPreset,vidCRF] to [xPreset,xCRF]
v21.0823 setOutputMatrix, better REM parameters explain
v21.0712 use vdub.exe for queryVersion, fColFul, fColLtd; Escaped all closed parenthesis: ^)
v21.0416 fCol: in/out full color space: setinputmatrix(2,2^), date based version
v3.13 201020 badpixel delogo refine parameters (4.0,5.0^)
v3.12 200703 fSmooth; Bug ytitle/ysign: wrong Audio InputDriver for .AVS (introduced in v3.10^)
v3.11 200516 more and better resize commands: r960x720 (only first 4 letters^), 1080 bug fix
v3.10 200511 badPixel stronger settings, use AVI driver for audio DirectStreamCopy (a0^)
v3.09 200323 r480: reSize to 852x480
v3.08 200121 better badPixel; added fDeInt (Yadif DeInterlace^)
v3.07 200120 r576: reSize to 720x576; added fGrey=fGray; Changed filters order: BadPix, deBlk, gray, deShak, reSize; Fixes: resize; vidColor
v3.06 191120 small v3.05 bug; always use more frames under w64 (auto dw64^): must Enable LAA using auxsetup.exe
v3.05 191007 fGray: Convert to grayscale; bug: fDeBlk (deBlock^) wasn't working; audio conversion if necessary
v3.04 191003 qb8/qb10/qb12 bits for internal h264/5 (qb12: h265i only^)
v3.03 190108 twav bug fix
v3.02 181210 added wmv, limited fut/past frames
v3.01 181128 added dSmooth{=dExtra=dMovX}, better help
v3.00 181119 major rename of options, added dNoRot, r1080p
v2.45 181113 chcp 1250 codepage for filenames with foreign chars in avisynth
v2.44 181109 delete temp aviSynth .AVS scripts, changed defaults h264/5: q4/q5
v2.43 181108 separate texts for aviSynth Signature and Title
v2.42 181106 vx64: more border frames (dsFrames^) on win64 platform, must have 4gb patch in 32b vdub
v2.41 181026 added r80d
v2.40 181022 defaults to x4i, added x5if, removed obsolete xf, compatibility for old VDub versions, no JUNK in WavHeader
v2.39 180826 added !vDub! (for vDub x64^), more border frames (dsFrames=72^) if x64
v2.38 180608 added rCol, speed presets, MPG
v2.37 180526 less dsFrames for non AVI (@275^)
v2.36 180506 r5d
v2.35 180505 added q7/q8=crf15/13; [f] suffix; internal set of !h26xPreset! h265i/5/4 to Medium/Slower/VerySlow, set x5i bits
v2.34 180414 xf1, xfd (fastdecode^); h26x params:--min-keyint 1 --keyint 180 --aq-mode 3; x5i 10bits
v2.33 180413 dirShowSrc in aviSynth
v2.32 180412 changed x1->x5i; added x4i,xL,xLi (lagarith^); better help; aviSynth for all extensions, color; auto convert audio to 16bit; removed aviSynth audiodelay=100
v2.31 180408 moved deBlock after deshaking, ytit: 8 sec text (replaces "ztitle" with filename^), ysign: moving text during all video (old vsyn^)
v2.30 180406 added rvga (reSz 640x480^), small fix (vlow^), audio defaults to a3, changed vhSz,v720 -> rhSz,r720
v2.29 180404 added .MTS; set input driver on line 4
v2.28 180331 p2n for recompress without deshake (replaces p2 vnd^), reversed/moved history to readme
v2.27 180329 small corrections
v2.26 180318 Use better deblock: MSUSmartDeblock, badpixel.bmp on vdub folder, better help/ readme
v2.25 180315 zNA, better delete if error ("" in del command), aviSynthText on 3rd line
v2.24 180313 error handling, zKF/del halfProcessed files
v2.23 180312 minor fixes, Changed am/an/t3/t5/t7/mo/mp/mk Are now: amo/ano/rt3i/rt5i/r70d/mov/mp4/mkv
v2.22 180310 Changed: v0..v7,vz,vx,vk,vh,vi,vl,vd,vy,vf; np,of,ks
To: q0..q7,vnz,vpix,vblk,vhsz,v720,vlow,vnd,vsyn,xf; znp,zof,zks
added extensions- mo: MOV, mp: MP4, mk: MKV
v2.21 180309 vf: enables fastDecode option in x264/x265
v2.20 180306 x1, vl implied if vi or vh; renamed w,vu to aw,x5
v2.19 180222 aCD 44KHz, default now is 48, added examples
v2.18 180220 use "Caching input driver" for WAV extracting
v2.17 180218 don't look for .WAVs if an (no audio)
v2.16 180217 inputDriver depending on directStreamCopy/ avs/ regular
v2.15 180213 dsFrames-5 if avysynth (vy), "AVIFile/Avisynth input driver (internal)" for avisynth opening
v2.14 180211 Changed old one letter commands (n o u)->(np of ks), added an: no audio
v2.13 180206 vu: use H265 (must have dshow x265vfw.....exe installed)
v2.12 180206 bug: avoid v0 in p1
v2.11 180203 procEXT, VDub open with: "Audio/video interleave input driver (internal)"
v2.10 161025 t7 rs=62%, dshutdown program, del script files after each pass (w, p1, p2)
v2.09 160925 t7 70d (rs=61%)
v2.08 160309 vy aviSynth auto audDelay=100ms, "por Isidro"
v2.07 160308 help example: extract wav only
v2.06 160201 default audDelay=0, avisynth moving text size/position
v2.05 151020 audDelay=133; t5i Rolling Shutter: 45 (other values: 41 for 24fps, 52 for 720/50, 55 for 480)
v2.04 150110 audDelay=100
v2.03 150109 Echo 2nd pass settings info
v2.02 150107 Improved help, added audDelay constant and warning if not 0
v2.01 150103 Added vi 1280x720 resize, clean vd code
v2.00 141224 Added v6, change to new H264 Nov-2014 format
v1.56a 141219 future frames=26 (avoid out of mem)
v1.56 141018 added [v6] hq deshake future frames=28; fix 1st example; noH264 on p1; deshaker v3.1, less deshake on 2nd pass (35xx to 15xx/8xx)
v1.55 131210 added [vl] [t5]
v1.54 h264 parameters update
v1.51 121209 minimize vdub; v1.52 avs bug, vx bug; v1.53 [vh] video half size
v1.5 25 two letter comands, [vx] badpixel, use ZZ as out prefix, [am] mono audio, [a1][a5], errorlevel
v1.41 24 bug zoom/turn off; added mandatory audio param: {a0..a4} (avoids unintended transform to mp3)
v1.4 23 added [vy] avisynth, added [vn] don't deshake in 2nd pass
v1.3 121121 added [a4] mp3 bitrates, added [v0] video DSC
v1.2 added [ak] deblock filter, and [n][z][u] end options, internal scripts generation
v1.02 added [a8] for 48Khz audio