View Full Version : Deshaker questions
bololo
14th April 2010, 09:00
Hello Everyone!
I would like to aplpy Gunnars deshaker using avisynth, but i came up with two questions.
1) somewhere in this forum i saw the avisynth call of this filter:
#pass1, no motion vectors --> works
#deshaker("8|1|30|4|1|0|1|0|640|480|1|2|1|400|400|400|1500|4|0|1|2|5|40|300|4|C:\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|15|15|5|15|0|0|30|30|0|100|0|0|1|0|0")
How can i adjust this line to my needs? Is there some export function in this filter when i use virtualdub?
2) it seems, that it is not possible to deactivate particular corrections - eg: i know for sure that there is no rotationshake, but the filter does not allow to set the max correction limits to zero in 2nd pass. Is there any way to deactivate parts of this filter?
best regards,
bololo
runforlife
14th April 2010, 12:39
http://avisynth.org.ru/docs/russian/index.htm
LoadVirtualDubPlugin("filename", "filtername", preroll)
This loads a plugin written for VirtualDub. "filename" is the name of the .vdf file. After calling this function, the filter will be known as "filtername" in avisynth. VirtualDub filters only supports RGB32. If the video happens to be in RGB24-format, then you must use ConvertToRGB32 (ConvertToRGB won't suffice).
Some filters output depends on previous frames; for those preroll should be set to at least the number of frames the filter needs to pre-process to fill its buffers and/or updates its internal variables.
I do not know how exactly with deshaker, but with delogo:
LoadVirtualDubPlugin("C:\Program Files\VirtualDub 1.7.7 (stable)\plugins\delogo.vdf","DeLogo")
Ctemp=DeLogo(Ctemp, 1, "", "", "", "", "D:/10_03_2008.bmp", 15, 40, 1, 0)
I think this script will works with deshaker:
LoadVirtualDubPlugin("deshaker.vdf","DeShaker")
DeShaker(last, "8|1|30|4|1|0|1|0|640|480|1|2|1|400|400|400|1500|4|0|1|2|5|40|300|4|C:\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|15|15|5|15|0|0|30|30|0|100|0|0|1|0|0")
AVIL
14th April 2010, 15:33
Hi,
IMHO, previous to use deshaker in avisynth you must train yourself in virtualdub. Deshaker is a filter with two stages. In the first stage you must create deshaker.log (no video output is created) and, in the second stage, deshaker.log is used to provide deshaked video. In avisynt the stages are the same. You must create two scripts and run it in sucession. E.G:
Stage 1, creation of deshaker.log:
loadvirtualdubplugin("D:\> c\virtualdub\plugins\DeShaker.VDF","DeShaker",0)
AviSource("p2_lags.avi").deshaker("9|1|20|4|1|0|1|0|640|480|0|1|1|1500|1500|1500|1500|4|0|0|2|5|60|300|4|C:\\Deshaker.log|0|1|96|128|64|0|0|0|0|0|0|0|0|1|2|2|2|1|1|1|30|30|0|70|0|0|1|1|1|10|1|15")
Stage 2 : Output ot deshaked video:
loadvirtualdubplugin("D:\abc\virtualdub\plugins\DeShaker.VDF","DeShaker",0)
AviSource("p2_lags.avi").deshaker("9|2|20|4|1|0|1|0|640|480|0|1|1|1500|1500|1500|1500|4|0|0|2|5|60|300|4|C:\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|2|2|2|1|1|1|30|30|0|70|0|0|1|1|1|10|1|15")
Be careful. These are only examples. The real parameters depend on your footage (and the first 30 frames are lost if not repeated).
Customize the filter in virtualdub and, after each stage, save the settings with Ctrl+S. You will obtain a file of type vcf with a script like this :
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.SetInputFormat(0);
VirtualDub.video.SetOutputFormat(7);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetSmartRendering(0);
VirtualDub.video.SetPreserveEmptyFrames(0);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("Deshaker v2.0");
VirtualDub.video.filters.instance[0].Config("9|2|20|4|1|0|1|0|640|480|0|1|1|1500|1500|1500|1500|4|0|0|2|5|60|300|4|C:\\Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|2|2|2|1|1|1|30|30|0|70|0|0|1|1|1|10|1|15");
VirtualDub.audio.filters.Clear();
The string after VirtualDub.video.filters.instance[0].Config( is the string you need to feed in your avisynt script.
Good luck
guth
14th April 2010, 17:10
2) it seems, that it is not possible to deactivate particular corrections - eg: i know for sure that there is no rotationshake, but the filter does not allow to set the max correction limits to zero in 2nd pass. Is there any way to deactivate parts of this filter?
Set the motion smoothness to 0 for the types of corrections you don't want.
bololo
15th April 2010, 10:11
Thank you for all your answers, i hope i will be able to fix the shaking!
bololo
16th April 2010, 08:41
Hello again
i set motion smoothness to 0 for disabling zoom correction in pass 2 but in the resulting file there is heavy zoomin and zoom out. watching it causes dizzyness.
The rotation correction disabling worked (i think)
Ow, btw. Its may of interest: I want to deshake this cartoon (http://forum.doom9.org/showthread.php?t=154019).
best regards,
bololo
2Bdecided
16th April 2010, 11:10
You're right bololo, setting the "motion smoothness" for zoom to zero doesn't disable it, but makes it instant. Unfortunately with some sources DeShaker makes mistakes with zoom, so an instant "correction" is very bad!
However, I think you can set the "max correction limits" for zoom to zero to disable it completely.
Cheers,
David.
2Bdecided
16th April 2010, 11:15
From the other thread...
I cant help you with the deshake because Im having the same problems as you. Your source has many similarities with film artifacts so taking a glance to the 8mm restoration thread (http://forum.doom9.org/showthread.php?t=144271)could give you many clues.Yes, I think you're right.
Forget VirtualDub Deshaker and try AVIsynth Stab() or the deshaking in the 8mm restoration script.
Hope this helps.
Cheers,
David.
guth
16th April 2010, 17:03
Here's from my Deshaker page, where the setting "motion smoothness" is explained:
"These values determine how smooth the motion will be. You can set a parameter to 0 to turn off the smoothing completely. This can be useful if you don't want to stabilize zoom for example. But you must use a rather high zoom smoothness if you use adaptive zoom as edge compensation, or the video will zoom in and out very fast to avoid the borders."
Simply change the type of edge compensation to get rid of that zoom effect.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.