|
|
| takbal |
| Posted: Oct 15 2009, 06:17 PM |
 |
|
Newbie

Group: Members
Posts: 2
Member No.: 26313
Joined: 15-October 09

|
Hi all,
I spotted this topic when I was looking for a place to share my mass deshaker script, which I use to process all my HD video footage with Gunnar's Deshaker. Funny that it just opened two weeks ago 
Installation is a bit complicated, but after that it is just moving files into directories and clicking on deshake.bat. I used the same tools you did here except for using cygwin for scripting and Gunnar's SmoothDeinterlace for deinterlacing. Practically I used to filter all my HD shots through it. As I want to edit the clips later, the output is generated with the Lagarith lossless codec to minimize recompression artifacts. It has 6 different Deshaker settings to play with. It compensates Deshaker's audio shift and trims the black message at the beginning adjusted for the FPS of the clip. It can also resize and trim the output.
More in the README.txt. Download it from here:
mass_deshaker1.0.zip
I have also opened a forum about it at:
http://forum.videohelp.com/topic374362.html#2014697 |
 |
| martin0reg |
| Posted: Nov 24 2009, 06:57 PM |
 |
|
Newbie

Group: Members
Posts: 3
Member No.: 26502
Joined: 24-November 09

|
There is a software called "dubman" which does batch processing fine. No problems with two passes, because you can load vcf-settings for each pass.
http://dubman.sourceforge.net/ you can even process all files in a folder (bulk configuration and wildcards)
BUT: the files must be opened automatically with VD. No problem with avi. But these mts files have to be loaded with two different clicks and that can't be done automatically. Any solutions?
|
 |
| MJ Peg |
| Posted: Nov 26 2009, 10:25 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 38
Member No.: 26241
Joined: 29-September 09

|
Can it be made to work with AviSynth AVI files? That's the best way I found to work with AVCHD Lite .mts clips. |
 |
| MJ Peg |
| Posted: Dec 30 2009, 07:25 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 38
Member No.: 26241
Joined: 29-September 09

|
I've just found a limitation to my batch deshake method - it didn't work with 97 clips in one go
Looks like wonderful DOS has a limit of 63 filename parameters it can handle and shift in the loop.
|
 |
| sean.duncan |
| Posted: Feb 19 2010, 03:47 AM |
 |
|
Newbie

Group: Members
Posts: 1
Member No.: 27057
Joined: 19-February 10

|
@MJ Peg, I would love to have your .vcf files (deshake1.vcf and deshake2.vcf) to see the settings you used in Deshaker, if you are still offering them.
edit: also if anyone is interested, here is another take on stabilization that is a variation of Deshaker : http://pages.cs.wisc.edu/~fliu/project/3dstab.htm |
 |
| Mister N. |
| Posted: Feb 28 2010, 11:38 PM |
 |
|
Newbie

Group: Members
Posts: 1
Member No.: 27121
Joined: 28-February 10

|
Bonjour ! (by the way sorry for my english)
I don't know if someone is still interested in this problem but with the help of this thread I succeeded into making a batch file for the Deshaker filter and I'm so happy that I need to share it ! It's the first time I "program" something useful (actually it's the first time I program something outside MatLab at school...) and I didn't think I could make it !
As I don't know anything about batch programming I just did some cut and past from the stephanV's one (big thanks for you and MJ Peg !!). I change the loop : for one video, it does pass 1 and 2, then it goes to the next video, etc. The major change though is that I modified the deshake1.vcf in order to make a preview for the 1st pass (the "preview output" needed to write the deshaker log). So I need to pass a parameter (the source file) to the VirtualDub script. Also I don't use avisynth because my videos are Quicktime MJPEG (however in the futur I may use mts files, thanks to my panasonic TZ7) but it doesn't change a lot of thing.
So I have 3 files, all in "C:\Video\input" : - Deshake1.vcf : the parameters of VirtualDub for the 1st pass of Deshaker, modified with a preview command - Deshake2.vcf : the parameters of VirtualDub for the 2nd pass of Deshaker - Deshake.bat : drag'n'drop a few files and it works like a charm ! The output goes in "C:\Video\output". Yes I like to be simple and my Windows partition is used only for this kind of stuff (I'm running VMWare Fusion on a macbook) so I can make a mess in the C root...
Deshake.bat
| CODE | set VDUBPATH=C:\VirtualDub set TARGETPATH=C:\Video\output
"%VDUBPATH%\vdub.exe" /c
:add_to_job
if [%1]==[] goto :start_job
set SOURCEFILE=%~1 set TARGETFILE=%~n1
"%VDUBPATH%\vdub.exe" /i C:\Video\input\deshake1.vcf "%SOURCEFILE%" /p "%SOURCEFILE%" "%TARGETPATH%\%TARGETFILE%stab.avi" "%VDUBPATH%\vdub.exe" /s C:\Video\input\deshake2.vcf /p "%SOURCEFILE%" "%TARGETPATH%\%TARGETFILE%stab.avi" /r /x
shift
goto :add_to_job
:start_job
pause exit |
deshake1.vcf : the source is passed and a preview is made to make the log of Deshaker (that's the new part that bothered me for a while). I cut the lines which are too long and messed up the layout of the forum, don't forget to delete the "enter" (I don't how it's called).
| CODE | declare source; source=VirtualDub.params[0]; VirtualDub.Open(source); VirtualDub.audio.SetSource(0); VirtualDub.audio.SetMode(1); VirtualDub.audio.SetInterleave(1,500,1,0,1000); 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.SetInputFormat(0); VirtualDub.video.SetOutputFormat(7); VirtualDub.video.SetMode(3); VirtualDub.video.SetSmartRendering(0); VirtualDub.video.SetPreserveEmptyFrames(0); VirtualDub.video.SetFrameRate2(0,0,1); VirtualDub.video.SetIVTC(0, 0, 0, 0); VirtualDub.video.SetCompression(0x78766964,0,10000,0); VirtualDub.video.SetCompData(138,"LWJ2MSA1MDAwMDAwIC12YnYgOTcwODQwMCw2MjkxNDU2LDYyOTE0NTYgLWRpciAiQ zpcRG9jdW1lbnRzIGFuZCBTZXR0aW5nc1xBZG1pbmlzdHJhdG9yXEFwcGxpY2F0aW9uIERhdGFcRGl2WFxEaXZYIENvZGVjIiAtYiAxIC1wcm9maWxlPTQA"); VirtualDub.video.filters.Clear(); VirtualDub.video.filters.Add("Deshaker v2.4"); VirtualDub.video.filters.instance[0].Config("12|1|30|4|1|0|1|0|640|480|1|2|1|1000|1000|1000|3000|4|1|1|2|5|40|300|4| C:\\Video\\input\\Deshaker.log|0|0|0|0|0|0|0|0|0|200|200|0|0|1|15|15|5|15|1|1|30|30|0|0|0|0|1|1|1|10|1|15|1000|1|88"); VirtualDub.Preview();
|
Deshake2.vcf : classic, FYI. Note the audio interleave to synchronize with the video. I encode with DivX for archive. I'll use MJPEG high quality to import in iMovie (the only codec I found that iMovie accept !). Maybe I'll change the quality (2 passes ? mpeg4 ?) and the stabilization parameters but I just discovered Deshaker and VirtualDub so… I need time. I cut the lines which are too long and messed up the layout of the forum, don't forget to delete the "enter" (I don't how it's called).
| CODE | VirtualDub.audio.SetSource(1); VirtualDub.audio.SetMode(1); VirtualDub.audio.SetInterleave(1,500,1,0,1000); 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.SetInputFormat(0); VirtualDub.video.SetOutputFormat(7); VirtualDub.video.SetMode(3); VirtualDub.video.SetSmartRendering(0); VirtualDub.video.SetPreserveEmptyFrames(0); VirtualDub.video.SetFrameRate2(0,0,1); VirtualDub.video.SetIVTC(0, 0, 0, 0); VirtualDub.video.SetCompression(0x78766964,0,10000,0); VirtualDub.video.SetCompData(138,"LWJ2MSA1MDAwMDAwIC12YnYgOTcwODQwMCw2MjkxNDU2LDYyOTE0NTYgLWRpciAiQ zpcRG9jdW1lbnRzIGFuZCBTZXR0aW5nc1xBZG1pbmlzdHJhdG9yXEFwcGxpY2F0aW9uIERhdGFcRGl2WFxEaXZYIENvZGVjIiAtYiAxIC1wcm9maWxlPTQA"); VirtualDub.video.filters.Clear(); VirtualDub.video.filters.Add("Deshaker v2.4"); VirtualDub.video.filters.instance[0].Config("12|2|30|4|1|0|1|0|640|480|1|2|1|1000|1000|1000|3000|4|1|1|2|5|40|300|4| C:\\Video\\input\\Deshaker.log|0|0|0|0|0|0|0|0|0|200|200|0|0|1|15|15|5|15|1|1|30|30|0|0|0|0|1|1|1|10|1|15|1000|1|88"); VirtualDub.audio.filters.Clear();
|
Voilà !
Thank you for your help, I hope I'll help someone too ! Deshaker is awesome on my ski videos ! |
 |
| Vegas |
| Posted: Apr 26 2010, 05:14 PM |
 |
|
Newbie

Group: Members
Posts: 1
Member No.: 27491
Joined: 26-April 10

|
I tried the first script from MJ Peg, but since I am using mpegs and not MTS files, I think its the reason why its not functioning. It seems to want to popup a dos box every 3-4 seconds and then disappear. I have to delete the picker.bat to stop the process. Could also be I screwed up the paths, but I have been through it several times.
| CODE | @echo off
rem MJ Peg's Deshake Batch Echo Scheduling Deshaker for files ...
rem Check for no files specified, exit if so if [%1]==[] goto :exit
rem Initialse batch scheduler picker.bat echo @echo off > I:\@deshaker\Picker.bat echo echo Picking next file... >> I:\@deshaker\Picker.bat
rem --- Loop --- Process selected files :do_another call :do_clip %1 shift if not [%1]==[] goto do_another rem --- End Loop ---
rem Create final stage of Picker scheduler echo echo All files processed >> I:\@deshaker\Picker.bat echo pause >> I:\@deshaker\Picker.bat
rem All done, finish up goto :New_Session
rem ------- "sub routine" called once per clip :do_clip echo %1
rem Make AVS script file for the clip if exist %1.avs del %1.avs echo FFMpegSource2("%1",atrack=-1)++\ > %1.avs echo FFMpegSource2("buffer.mpg",atrack=-1) >> %1.avs echo DelayAudio(1.2) >> %1.avs
if exist %1.ffindex del %1.ffindex
rem Add to scheduler batch echo If exist %1.avs I:\@deshaker\2deshaker1.bat %1 >> I:\@deshaker\Picker.bat
GOTO:EOF rem ------- End Sub
:New_Session rem Now call NewSesh for new session to launch picker start NewSesh.vbs
:exit rem All done
|
| CODE | @echo off rem MJ Peg's Deshake1 Batch (thanks to stephanV for vdub help) rem called from Picker.bat (written by Deshake.bat) for each avs file that exists
rem Check for no files specified, exit if so if [%1]==[] goto :exit
echo Deshake %1
rem Clear Deshaker log file if exist C:\Users\Vegas 2010\AppData\Local\Deshaker\Deshaker.log del C:\Users\Vegas 2010\AppData\Local\Deshaker\Deshaker.log if exist %1-failed.txt del %1-failed.txt
rem Clear ffindex files that might stop the clip loading if exist buffer.mpg.ffindex del buffer.mpg.ffindex
rem Pass 1 I:\@deshaker\virtdub196\vdub.exe /c /s deshake1.vcf /p %1.avs %1.avi /r /x rem if exist %1.ffindex del %1.ffindex if exist buffer.mpg.ffindex del buffer.mpg.ffindex
rem Check for error, abandon this try, get picker to try again if NOT exist C:\Users\me\AppData\Local\Deshaker\Deshaker.log goto exit
rem Pass 2 I:\@deshaker\virtdub196\vdub.exe /c /s deshake2.vcf /p %1.avs %1.avi /r /x
rem Delete the avs file so Picker doesn't choose it again if exist %1.avs del %1.avs if exist %1.ffindex del %1.ffindex if exist buffer.mpg.ffindex del buffer.mpg.ffindex
rem Check for error? (no longer used since retry technique) if NOT exist C:\Users\Vegas 2010\AppData\Local\Deshaker\Deshaker.log echo FAILED > %1-failed.txt
:exit rem Done One, won't do it again, now call NewSesh for new session for any next ones start NewSesh.vbs |
I tried the script from Mister N and I have to say Merci!! It makes the whole process much easier.
I am noticing I still have the audio sync problem, although i have interleaving delay 1000ms. Also, Is there a way to append a 1 second file to keep the clip from cutting off 1 second short? AND.....Is there a way to automatically trim the first 30 seconds of the black clip from deshaker?
|
 |
| MJ Peg |
| Posted: May 17 2010, 02:37 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 38
Member No.: 26241
Joined: 29-September 09

|
I've just checked back here and logged in for the first time in months. Please note that I'm not around for answering queries about my scripts - sorry. I've given up on video until YouTube stops mangling the framerates of my uploads - all my 25fps stuff gets transcoded to 29.97 against my wishes and looks awful. I've been waiting ages for them to fix it but there's no progress yet.
Also, I've been made redundant and had to leave my nice fast work PC and net connection behind. These days I have a brief daily wifi websurf on a netbook (not Windows), and my home PC hardly ever gets fired up. I haven't bothered getting deshaking working on it yet.
All the best. |
 |
| Cela |
| Posted: May 21 2010, 08:47 PM |
 |
|
Member
 
Group: Members
Posts: 18
Member No.: 27492
Joined: 26-April 10

|
| QUOTE (MJ Peg @ May 17 2010, 02:37 PM) | | ... Also, I've been made redundant and had to leave my nice fast work PC and net connection behind... | It will not console you, but let me express my sympathy and my thankfulness!
Your excellent process descriptions enabled me from practically zero knowledge to setup your Deshaker job. It works great! I will use it for all my future camcorder recordings! These very special features spice the life!
I wish there were more Advanced users like you and Forum gods around in the forums, which really help us not so experienced users. I wish you that you will quickly regain a nice fast work PC and net connection!
Thank you very much! All the best to you! |
 |
| isidro |
| Posted: Sep 28 2012, 05:50 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 82
Member No.: 7195
Joined: 8-November 03

|
I made another approach for same thing, and made a BATch and three vdub scripts for that. I convert (no recompression), all of my .MOVs to .AVI using Mp4Cam2AVI. Just put all AVIs in a folder and run DESHAK.BAT For all AVI it will: 1) extract audio to "avifilename.WAV", 2) deshak analyse and generate "avifilename.LOG", and finally 3) deshake and compress h264 crf25/mp3 lame256k generating a new: VDavifilename.AVI. It doesn't repeat already done files (you should delete any interrupted half done file before running batch again). You can specify partial tasks: "DESHAK 12" will not do task 3 (so you can process WAVs with cooledit before doing final deshaked avi. DESHAK will not process any avi starting with "VD" to avoid double deshaking avis. Note that audio will be from extracted WAV files and not from the original AVI, this allows further external audio processing if needed (don't delete wavs if you need to do task 3)
Needs H264, lame (custom install klite megacodec pack), deshake v3 plugin and modify vdub path in batch to its location. And the three vdub scripts in next post copied in vdub folder. You can try your own deshake options, save it for later (Ctrl+Shift+F7) and copy from virtualdub.jobs the lines with your options to my vdub scripts.
DESHAK.BAT
| CODE | @echo off echo Deshakes and extract WAVs from all AVIs in current dir, compress to H264 crf 25 echo 1: Generate WAVs, 2: Deshake LOGs, 3: deshakes ^& compress to h264 VDxxxxx.AVIs echo Usage: DESSHAK [123] (Don't separate digits, each digit is a task type to do, defaults to all tasks) echo Doesn't redo already done files. If interrupted delete half processed file (newest) and rerun. echo Must edit virtualdub path, have scripts and deshaker plugin, echo and Klite Mega Codec pack with h264 and lame enabled when installed echo -- DESHACK.BAT v1.0 by isidroco echo/
rem Put virtualdub path here: set vdloc=c:\DVD\VDUB\
setlocal enableextensions enabledelayedexpansion
set PARAM=x%1
:1 rem 1- Direct stream copy audio in all .AVIs, generates .WAVs rem If no params or there is a "1" executes this part IF not %PARAM%==x IF %PARAM:1=% == %PARAM% goto :2 rem Repeat for each AVI: FOR %%I in (*.avi) do ( rem FLTYP= First to chars of avi filename set FLTYP=%%~nI set FLTYP=!FLTYP:~0,2! rem Don't process VD*.avi, skip already extracted WAVs IF not !FLTYP! == VD IF not exist %%~dpnI.wav ( echo Extracting audio from: path: %%~dpI - file: %%~nI.avi start /wait /low %vdloc%VirtualDub.exe /x /i %vdloc%extractwav.script "%%~dpnI" echo Done !errorlevel! File: %%~nI.wav ) ELSE echo .WAV already extracted: %%~dpnI.wav )
:2 rem 2- Deshake first pass analyse all .AVIs, generates .LOGs rem If no params or there is a "2" executes this part IF not %PARAM%==x IF %PARAM:2=% == %PARAM% goto :3 FOR %%I in (*.avi) do ( set FLTYP=%%~nI set FLTYP=!FLTYP:~0,2! rem Don't process VD*.avi, skip already analysed avis IF not !FLTYP! == VD IF not exist %%~dpnI.log ( echo Deshake analysis of: %%~dpI %%~nI.avi start /wait /low %vdloc%VirtualDub.exe /x /i %vdloc%deshake1pass.script "%%~dpnI" echo Done !errorlevel! File: %%~nI.log ) ELSE echo .LOG already done, for reanalysing delete: %%~dpnI.log )
:3 rem 3- Deshake .AVIs, needs .LOGs, generates VDxxxxxx.AVIs IF not %PARAM%==x IF %PARAM:3=% == %PARAM% goto :4 FOR %%I in (*.avi) do ( set FLTYP=%%~nI set FLTYP=!FLTYP:~0,2! rem Don't process VD*.avi, skips if already deshaked or missing log/wav IF not !FLTYP! == VD IF not exist %%~dpIVD%%~nI.avi ( IF exist %%~dpnI.log ( IF exist %%~dpnI.wav ( echo Deshaking video: %%~dpI %%~nI.avi start /wait /low %vdloc%VirtualDub.exe /x /i %vdloc%deshake2pass.script "%%~nI" "%%~dpI" echo Done !errorlevel! File: VD%%~nI.avi ) ELSE echo WAV missing: %%~dpnI.wav ) ELSE echo LOG missing: %%~dpnI.log ) ELSE echo .avi already done, for regenerating delete: %%~dpIVD%%~nI.avi )
:4 IF not %PARAM%==x IF %PARAM:4=% == %PARAM% goto :5 rem 4- Add your own task here...
:5 goto :EOF
rem VirtualDub command line parameters: rem /h (disable exception filter) rem /x exit when complete (for batchs) rem /i scriptFile [parameters] rem /cmd <command> (run quick script command) rem /c (Clera job list) rem /p <srcFl> <destFl> (add a batch job using the current settings) rem /b <srcDir> <destDir> (adds jobs to process an entire directory into another) rem /r (Run job queue) rem virtualdub /s mySettings.vcf /p source.avi dest.avi /x rem virtualdub /s mySettings.vcf /c /b source dest /r /x
rem VirtualDub script useful commands: rem Use VirtualDub.subset.Delete() or VirtualDub.video.length. rem VirtualDub.subset.AddRange(0,240); rem VirtualDub.video.SetRange();
:EOF
| |
 |
| isidro |
| Posted: Sep 28 2012, 05:56 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 82
Member No.: 7195
Joined: 8-November 03

|
extractwav.script
| CODE | // VirtualDub job list (Sylia script format) // This is a program generated file -- edit at your own risk. // Parameter: file name MUST NOT include extension, CAN contain full path // generates <sameFileName>.wav
declare flFull; flFull= VirtualDub.params[0];
// For pausing script, uncomment following line // Sylia.MessageBox( flFull, "Extracting audio from");
VirtualDub.Open( flFull+".avi","",0);
VirtualDub.audio.SetSource(1); VirtualDub.audio.SetMode(0); VirtualDub.audio.SetInterleave(1,500,10,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.SetInputFormat(0); VirtualDub.video.SetOutputFormat(7); VirtualDub.video.SetMode(0); VirtualDub.video.SetSmartRendering(0); VirtualDub.video.SetPreserveEmptyFrames(0); VirtualDub.video.SetFrameRate2(0,0,1); VirtualDub.video.SetIVTC(0, 0, 0, 0); VirtualDub.video.SetCompression(); VirtualDub.video.filters.Clear(); VirtualDub.audio.filters.Clear(); VirtualDub.project.ClearTextInfo(); // VirtualDub.video.SetRange(); // VirtualDub.subset.Delete();
VirtualDub.SaveWAV( flFull+".wav");
VirtualDub.Close();
|
deshake1pass.script
| CODE | // VirtualDub job list (Sylia script format) // This is a program generated file -- edit at your own risk. // Parameter: file name MUST NOT include extension, CAN contain full path // Generates <sameFileName>.LOG for deshaking
declare flFull; flFull= VirtualDub.params[0];
// For pausing script, uncomment following line // Sylia.MessageBox( flFull, "Deshaking first pass (analyse)");
VirtualDub.Open( flFull+".avi","",0);
VirtualDub.audio.SetSource(0); VirtualDub.audio.SetMode(0); VirtualDub.audio.SetInterleave(1,500,10,0,0); VirtualDub.audio.SetClipMode(1,1); VirtualDub.audio.SetConversion(0,0,0,0,0); VirtualDub.audio.SetVolume(); VirtualDub.audio.SetCompressionWithHint(85,48000,2,0,24000,1,12,"AQAEAAAAQAIBAAAA","LAME MP3"); VirtualDub.audio.EnableFilterGraph(0); VirtualDub.video.SetInputFormat(0); VirtualDub.video.SetOutputFormat(7); VirtualDub.video.SetMode(3); VirtualDub.video.SetSmartRendering(0); VirtualDub.video.SetPreserveEmptyFrames(0); VirtualDub.video.SetFrameRate2(0,0,1); VirtualDub.video.SetIVTC(0, 0, 0, 0); // VirtualDub.video.SetCompression(0x34363278,0,10000,0); // VirtualDub.video.SetCompData(4720,"AgAAAA........"); VirtualDub.video.filters.Clear(); VirtualDub.video.filters.Add("Deshaker v3.0");
VirtualDub.video.filters.instance[0].Config("18|1|30|6|1|0|1|0|640|480|0|2|3000|3000|3000|4000|1|1|0|2|1.66|40|300|4|"+flFull+".log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|75|75|35|35|1|1|25|25|0|0|1|0|1|1|0|4|600|1|55|1|1|20|5000|100|20|0");
VirtualDub.audio.filters.Clear(); //VirtualDub.subset.Clear(); //VirtualDub.subset.AddRange(0,103); //VirtualDub.video.SetRange(); VirtualDub.project.ClearTextInfo();
VirtualDub.RunNullVideoPass();
VirtualDub.audio.SetSource(1); VirtualDub.Close();
|
deshake2pass.script
| CODE | // VirtualDub job list (Sylia script format) // This is a program generated file -- edit at your own risk. // Parameter: file name MUST NOT include extension, CAN contain full path // Generates deshaked VD<filename>.avi with no audio, same name .LOG must be present
declare flName, flPath, flFull; flName= VirtualDub.params[0]; flPath= VirtualDub.params[1]; flFull= flPath+ flName;
// For pausing script, uncomment following line // Sylia.MessageBox( flFull, "Deshaking video");
VirtualDub.Open( flFull+".avi","",0);
// For no audio replace next line with: VirtualDub.audio.SetSource(0); VirtualDub.audio.SetSource(flFull+".wav", "");
VirtualDub.audio.SetMode(1); VirtualDub.audio.SetInterleave(1,500,15,0,0); VirtualDub.audio.SetClipMode(1,1); VirtualDub.audio.SetConversion(0,0,0,0,0); VirtualDub.audio.SetVolume(); VirtualDub.audio.SetCompressionWithHint(85,48000,2,0,32000,1,12,"AQAEAAAAAAMBAAAA","LAME MP3"); VirtualDub.audio.EnableFilterGraph(0); VirtualDub.video.SetInputFormat(0); VirtualDub.video.SetOutputFormat(7); VirtualDub.video.SetMode(3); VirtualDub.video.SetSmartRendering(0); VirtualDub.video.SetPreserveEmptyFrames(0); VirtualDub.video.SetFrameRate2(0,0,1); VirtualDub.video.SetIVTC(0, 0, 0, 0); VirtualDub.video.SetCompression(0x34363278,0,10000,0); VirtualDub.video.SetCompData(4720,"AgAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAFwAAAPoAAAAgAwAAAQAAAAAAAAAAAAAAAQAAAC5ceDI2NC5zdGF0cwAAcwB0AGEAdABzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="); VirtualDub.video.filters.Clear(); VirtualDub.video.filters.Add("Deshaker v3.0");
VirtualDub.video.filters.instance[0].Config("18|2|30|7|1|0|1|0|640|480|0|2|3100|3300|3200|3400|2|1|0|2|1.5|40|300|4|"+flFull+".log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|81|83|32|34|1|1|45|46|0|0|1|0|1|1|0|4|600|1|55|1|1|20|5000|100|20|0");
VirtualDub.audio.filters.Clear(); // VirtualDub.subset.Clear(); // VirtualDub.subset.AddRange(0,103); // VirtualDub.video.SetRange(); VirtualDub.project.ClearTextInfo();
VirtualDub.SaveAVI(flPath+ "VD"+ flName+ ".avi");
VirtualDub.audio.SetSource(1); VirtualDub.Close();
| |
 |
| isidro |
| Posted: Jan 4 2015, 01:35 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 82
Member No.: 7195
Joined: 8-November 03

|
I have perfectioned a BATCH file to do the whole process (no aux script files needed), can post it (or send it) if anyone is interested, help shown when run is:
DESHAK.BAT v2.02 by isidroco at gmail Process all AVIs in current dir: [Deshakes pass1 and 2], [extract WAVs] and [compress to H264] Usage: DESHAK actions [videooptions] audiooptions [n][o][u]
Actions: {[w][p1][p2]} w: Extracts & uses .WAVs; p1: Deshake 1st pass, make .LOGs p2: Process AVIs [deshakes] [& compress], outputs to: ZZfilename.AVI
Video options: [v1..v6|v0][vz][vx][vk][vd][vy][vh|vi] [t3|t5] v1..v6: CRF qual (v1:lo=27, v6:Hi=17)(Default v3=23) v0: DirectStremCopy don't process/compress video (overrides other settings) vz: noZoom deshake; vx: badpixel remove; vk: deblock; vh/vi: halfsize/1280x720 vd: don't deshake only compress; vy: generate/use avisynths .AVSs for each avi vl: low res video (720p or less) t3,t5: canon T3i/T5i (56%/47% RollingShutter, 48kHz audio)
Audio options (MUST SPECIFY in P2): {a1..a5|a0}[a8][am] a1..a5: MP3 Bitrate: 128/160/192/256/320; a0: DirectStreamCopy (no recompress) a8: 48kHz sampleRate source (def.44); am: mono (def.stereo)
End options: n: no pause; o: Turn off pc; u: don't del temp .scripts
doesn't redo already done files, doesn't process any ZZ*.AVI if interrupted, delete newest halfprocessed file and rerun batch audio source sample rate/channels must be correctly specified parameter order and separators are unimportant Must have virtualdub, deshaker v3.1 plugin, h264/lame (custom install klite MegaCodec Pack) [psshutdown.exe for autoshutdown] [deblock.vdf plugin: www.compression.ru/video/deblocking/index_en.html ]
Examples: DESHAK p1p2a3 (Deshakes and compress to h264 crf23/mp3 192k 44KHz) DESHAK p1wvz (Extract WAVs, 1st pass Deshake generates LOGs ignoring zoom) DESHAK p2 v5 vk wa0 (2nd pass: deblock and compress to high quality h264 and copy audio from WAVs) DESHAK p2 w a0 v0 ([extracts WAVs] join all WAVs with AVIs without recompress) DESHAK p2 w a3 v0 (join all WAVs to 192k mp3 without recompress AVIs) DESHAK w p1 p2 vz vx t3 am a3 (extract WAVs, deshake with t3i RS and no zoom, remove bad pixel, audio: t3i 48k, mono, 192k mp3 DESHAK p2 vd a3 vy (no deshake: just recompress A/V, use avisynth script) DESHAK v1 vh vd vy a8 a2 p2 (halfsize video, use avisynth, 160 48KHz audio) deshak p2 w vx t3 am a4 v5 (wav high quality audio mono t3i, 2nd pass hq video) DESHAK w p2 vd t5 vi v4 a4 (use WAVs, nodeshake, t5:48khz, resize 720p) |
 |
|