View Full Version : Deshaker by Gunnar Thalin
Pages :
[
1]
2
3
4
5
6
7
8
9
10
11
WarpEnterprises
26th March 2003, 09:07
As there was no announcement here and the filter seems (after some tests) to perform really good and transparent to the user (in opposition to SteadyHand et. al.) a little bump from me.
Get it here
http://www.guthspot.se/video/deshaker.htm
Was that from before or after I posted this (http://forum.doom9.org/showthread.php?s=&threadid=43362#post285208) ? :rolleyes:
WarpEnterprises
26th March 2003, 11:33
before... I was accidently stumbling over it at the VD everwicked forum :cool:
mustardman
2nd April 2003, 23:31
I have tried Deshaker (and most of the other cheapie/free motion stabilisers out there) and found Deshaker to be very good.
One thing I would really like to see is the ability to change the parameters without having to go in and manually edit the first pass file.
It also does things like the other stabilisers do, which are annoying, and could probably be fixed, making it a real kick-a-s deshaker.
For example, I do a zoom in. Deshaker smooths it out (very well) but at the end when I stop zooming, deshaker will continue to zoom and then pull back, giving quite a nasty look. It would assist a lot if you could specify (graphically or otherwise) "the zoom stops here, so don't do the overshoot and pull back trick".
Any thoughts from the author, Gunnar?
Thanks.
guth
15th April 2003, 08:19
Sure, here are some thoughts from the author... :)
I agree that's it's very annoying when video stabilizers overshoot, especially when it comes to panning. That's the main reason why i made this filter. It it designed never to overshoot. That's why it needs two passes. If it does overshoot, then there's a bug somewhere, but I have a feeling that what you're experiencing is the zooming applied to avoid the black borders. If you don't want that effect (and I can understand it if you don't), choose another edge compensation (such as 'none').
One thing I would really like to see is the ability to change the parameters without having to go in and manually edit the first pass file.
What do you mean? You *can* change the parameters during the first pass.
Guest
15th April 2003, 18:41
Welcome, Gunnar! It is fabulous to see you here. :)
guth
15th April 2003, 19:19
Thanks!! :)
I've stopped by here a few times before but you and other people seem to do such a great job here so I haven't really felt needed. Also, I'm not a very active filter maker anymore...
Ookami
15th April 2003, 21:39
Originally posted by guth
Thanks!! :)
I've stopped by here a few times before but you and other people seem to do such a great job here so I haven't really felt needed. Also, I'm not a very active filter maker anymore...
Wow. It really humbles me when I read/see how many video guru's dwell here :) .
Welcome.
Cheers,
Mijo.
WarpEnterprises
15th April 2003, 21:45
not a very active filter maker it's the quality that matters
lex3
17th April 2003, 17:39
Hi, All!
Is there any chance to call this filter from Avisynth?
I tuned it in VD, saved processing settings, then called it from Avisynth.
It loads thr log file ("Deshaking..." message), but it does no changes to the clip.
Here is the script:
AVISource("C:\Video\clip.avi")
loadvirtualdubplugin("C:\VirtualDub-1_4_10\plugins\Deshaker.vdf","Deshaker")
ConvertToRGB()
Deshaker("2|2|30|1|1|0|1|0|352|288|0|1|1|50|100|0|0|1|1|3|2|50|2|500|1|C:\\Video\\clip.log|0|1|0|0|8|0|0|0|0|0|0|0|0|1|2|4|1|1")
guth
17th April 2003, 22:02
I don't know what could be wrong. It works for me. I assume you generated the log file in a pass before this second pass? And did you try running the second pass from within VirtualDub too with these very settings? Did it work the way you intended? In that case, I have no idea... :(
guth
17th April 2003, 22:55
Another thing...
In your settings you're using size 352x288, which is a typical PAL size (half of 704x576). Yet you're using square pixels as pixel aspect ratio. You should probably use PAL instead.
lex3
18th April 2003, 10:12
Thank you for answers.
Yes, I did all that you said:
- generated log during 1st pass in VD
- tested settings of the 2nd pass in VD
- saved processing settings (and tested their load too :) )
But when tried them in the above mentioned script it seemed that the call of the filter makes no changes to the clip.
Finally I found a workaround - old good frameserving from VD :)
Thanks for pixel aspect ratio note, but I have no idea about the source of the .mpg file (it is an old russian cartoon about dreams of a bear - ftp://mp3.int.ru/pub/mp3/DISK_5/tmp/medvezhut.mpg
- no language required :) ). And it seams that square pixels look good enougth.
BTW, could you give another piece of advice:
Can these settings be used for stabilazing small shakes of digitized film material?
They have no rotation and are usually less than 1% (1% and 1 degree are the minimal values of "Max. correction limit" fields of the 2nd pass - but they cannot be lowered, right?).
guth
18th April 2003, 11:00
Can these settings be used for stabilazing small shakes of digitized film material? Are you talking about camera shakes or shakes of the film itself? If you just want to stabilize film shakes but not the contents, you might be able to specify a film edge to stabilize on. It worked for this guy (http://www.8mm.filmshooting.com/scripts/forum/viewtopic.php?t=1589&highlight=deshaker).
Anyway, having a differential search range of only 1 sounds a little dangerous. It will have a hard time matching moving objects and areas around it. You'll just have to try what works best, I guess.
lex3
18th April 2003, 13:59
Yes, I'm about film shakes - jitter.
Unfortunately there is no film edge to stabilize on, because I just convert clips, but not digitize films myself.
Well, to find jitter as little global motion may it be useful to skip all fast motion objects, so differential search range = 1 is ok?
Or it is necessary to find all motion types to get the global one?
guth
18th April 2003, 14:24
If you don't have an edge to stabilize on, you have to stabilize on content just as you would for normal stabilization, and the contents can move a lot more than the jitter, so you really should increase the search range, both the initial and the differential. Otherwise it won't be able to match at all under some circumstances and the results will be unreliable. That's what I would do anyway.
lex3
21st April 2003, 11:20
Thanks, I'll try.
Flexy
23rd February 2004, 04:39
hi,
can someone point me to a link/example how to use deshaker w/ vdubmod or avisynth in a script ??? I need to automate the task of deshaking a bunch of vids...but i dont have any docs how to use deshaker in a vdub script...and manual woud take a long time (especially since it's two passes)
thanks !
Edit:
Hi guys,
i just compared deshaker w/ vdubmod vs. 'SteadyHand' by DynaPel.
Deshaker beats SteadyHand hands down - it's not even a comparison how much better the results with Deshaker are...two different worlds..
[At least in my case, did some test-runs on vids of mine so other's results might differ]
Now i just need a script/batch function in deshaker and get rid of that 'lil annoying '2 pass'.... (why not combine the two passes internally ?)
greets
guth
23rd February 2004, 18:48
Thanks for liking it. :)
To see how to use deshaker from a script, just make the settings in VirtualDub and save a settings (vcf) file (as described above by lex3). Then look at it in a text editor. It should work. If you really want to know what all the parameters are, let me know. But I recommend making the settings from within VirtualDub.
Unfortunately it's impossible to do both passes internally. :(
Finally, I would never batch process clips with deshaker. You most probably won't get as good results as you could if you spent some time and finetuned the settings for each clip (and even parts of a clip). Also, personally I would never use the default settings. They are only good for beginners. ;)
WarpEnterprises
23rd February 2004, 23:00
First let me say that your words are quite an understatement - this filter is really great and the commercial products are bad jokes compared to it.
Second: all the parameters are stored in one string. Correct?
Third - a question: while the pass1 values are more or less obvious, I am missing a (more technical) description of the "motion smoothness" values (which are at the heart of the operation). So, can you detail a bit:
- what range are they
- what maths lies behind the process
Thanks!
guth
23rd February 2004, 23:46
Thanks! :)
Yes, all parameters are in a single string. The reason is that VirtualDub can only handle up to 10 parameters (I think... correct me if I'm wrong).
Smoothness range is -1 to 100000 (where -1 and 0 are special cases). The upper limit is arbitrarily chosen. (If you really want, you should be able to go higher if you do it from a script.)
The math.... is a secret :p
Well, not really. Without going into specifics I solve four huge equation systems (pan x, pan y, rotation and zoom) where I try to minimize both the motion curvature and the corrections at the same time. The smoothness values are weights that control which of those are more important to minimize. Higher values results in less curvature. I don't think this will help you a lot in choosing good values, but you asked. :)
Flexy
24th February 2004, 09:55
hi guys, i need help there :)
The problem right now is that this script crashes...what i did (as read elsewhere on a forum) generated jobs and try to load the jobs and run it...but VDubmod crashes. (I have the latest version). Maybe one of you knows more what i do wrong..
I put in some comments in the script for things i have qeustions on :) Thanks for any help !
guth: Yeah i was the one also emailing you about it. Thanks for reply ! :)
>>> snip <<<
// VirtualDub job list (Sylia script format)
// This is a program generated file -- edit at your own risk.
//
// $numjobs 2
//
// $job "Job 5"
// $input "C:\DATA\test_short.avi"
// $output "C:\DATA\dummy.avi"
// $state 0
// $start_time 0 0
// $end_time 0 0
// $script
VirtualDub.Open("C:\\DATA\\test_short.avi","",0);
VirtualDub.RemoveInputStreams();
VirtualDub.stream[0].SetSource(0x73647561,0);
VirtualDub.stream[0].DeleteComments(1);
VirtualDub.stream[0].AdjustChapters(1);
VirtualDub.stream[0].SetMode(0);
VirtualDub.stream[0].SetInterleave(1,500,1,0,0);
VirtualDub.stream[0].SetClipMode(1,1);
VirtualDub.stream[0].SetConversion(0,0,0,0,0);
VirtualDub.stream[0].SetVolume();
VirtualDub.stream[0].SetCompression();
VirtualDub.stream[0].EnableFilterGraph(0);
VirtualDub.stream[0].filters.Clear();
VirtualDub.video.DeleteComments(1);
VirtualDub.video.AddComment(0x00000002,"ISFT","VirtualDubMod 1.5.10.1 (build 2366/release)");
VirtualDub.video.AdjustChapters(1);
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression(0x67706a6d,0,9000,0);
VirtualDub.video.SetCompData(28,"TUpQRxgAAAAAAAAAAgAAAAgAAAACAAAAAQAAAA==");
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("Deshaker v1.6");
VirtualDub.video.filters.instance[0].Config("4|1|30|4|1|0|1|0|640|480|1|2|1|400|400|400|1500|4|1|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");
VirtualDub.subset.Clear();
VirtualDub.subset.AddRange(0,50);
VirtualDub.SaveAVI("C:\\DATA\\dummy.avi");
//
// actually, i do not WANT to save anything here, but i dont know
// how else to create a job for deshaker Pass 1 ??????
//
VirtualDub.Close();
// $endjob
//
// Now PASS 2 <------ !!!!
//--------------------------------------------------
// $job "Job 6"
// $input "C:\DATA\test_short.avi"
// $output "C:\DATA\result.avi"
// $state 0
// $start_time 0 0
// $end_time 0 0
// $script
VirtualDub.Open("C:\\DATA\\test_short.avi","",0);
VirtualDub.RemoveInputStreams();
VirtualDub.stream[0].SetSource(0x73647561,0);
VirtualDub.stream[0].DeleteComments(1);
VirtualDub.stream[0].AdjustChapters(1);
VirtualDub.stream[0].SetMode(0);
VirtualDub.stream[0].SetInterleave(1,500,1,0,0);
VirtualDub.stream[0].SetClipMode(1,1);
VirtualDub.stream[0].SetConversion(0,0,0,0,0);
VirtualDub.stream[0].SetVolume();
VirtualDub.stream[0].SetCompression();
VirtualDub.stream[0].EnableFilterGraph(0);
VirtualDub.stream[0].filters.Clear();
VirtualDub.video.DeleteComments(1);
VirtualDub.video.AddComment(0x00000002,"ISFT","VirtualDubMod 1.5.10.1 (build 2366/release)");
VirtualDub.video.AdjustChapters(1);
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression(0x67706a6d,0,9000,0);
VirtualDub.video.SetCompData(28,"TUpQRxgAAAAAAAAAAgAAAAgAAAACAAAAAQAAAA==");
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("Deshaker v1.6");
VirtualDub.video.filters.instance[0].Config("4|2|30|4|1|0|1|0|640|480|1|2|1|400|400|400|1500|4|1|2|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");
VirtualDub.subset.Clear();
VirtualDub.subset.AddRange(0,50);
VirtualDub.SaveAVI("C:\\DATA\\result.avi");
VirtualDub.Close();
// $endjob
//
//--------------------------------------------------
// $done
Flexy
24th February 2004, 10:05
It should work. If you really want to know what all the parameters are, let me know. But I recommend making the settings from within VirtualDub.
yeah..the parms are not the problem..i can just save a job/settings and have it in a script. Problem is ratehr i cannot run the script because it crashes. (See other posting)
Unfortunately it's impossible to do both passes internally. :(
Finally, I would never batch process clips with deshaker. You most probably won't get as good results as you could if you spent some time and finetuned the settings for each clip (and even parts of a clip). Also, personally I would never use the default settings. They are only good for beginners. ;) [/B]
i dont use deshaker for *that* long, so i didnt go in-depth and experimetned with all settings. The defaults are 'good' for my first testing...and i have good results with my vids. 'Tuning'...i can do that later when i have time :)
An average 'vacation' movie for me consists of about ~50 smaller clips..at elast the last one did and teh next movie might get even bigger. I think i would sit there 'til the year 3000 if i'd analyze each single clip (assuming it's 50 and more)..maybe even each *scene* in each clip....and then do a manual deshake with different params for each clip...that would just be extremely insane work.
I had nice results applying a deshakeover my final result video (which is the 50 clips joined together in Sonic Foundry Vegas)..so...the deshaking looks nice....PROBLEM is the titles....i need to apply the Deshake to the individual clips *before* i render the resulting video in vegas for the titles and everything ok.
WarpEnterprises
24th February 2004, 13:25
@guth:
another "technical" question:
How are scenechanges handled?
When do you make the filter snap back to the "0" position?
Is this connected to the value "skip frame" (more precise to the 0,0,1-results generated)?
Is this the same as if a line in the file is manually deleted (as you suggest for human guidance)?
Or summing up: when is in the results (of the motion equations) a "forced" zero crossing?
I may look very curious but although the docu is quite good, some things/settings may be completely clear for you - but not for me, and I can't sleep until I have understood it from the base line :)
guth
24th February 2004, 19:20
@Flexy:
You're right! It totally crashes! :)
I looked into it now (I never ran jobs before) and it crashes because VirtualDub calls my functions in a slighty unpredictable order (EndProc is called before StartProc and InitProc). Next version will be able to cope with this (I'll send you an unofficial version with a fix by email soon too).
@Warp:
I'm not completely sure I completely understand what you mean, but I think so...
It never snaps back to the 0 position during a single processing. You'll need to split the processing into several parts in order to do that.
Yes, a 0,0,0,1 row is the same as if the row was missing.
The only zero-crossings are the first and last frames that were processed in pass 1 (unless you use adaptive zoom, then there are none).
Flexy
25th February 2004, 06:31
Originally posted by guth
[B]@Flexy:
You're right! It totally crashes! :)
I looked into it now (I never ran jobs before) and it crashes because VirtualDub calls my functions in a slighty unpredictable order (EndProc is called before StartProc and InitProc). Next version will be able to cope with this (I'll send you an unofficial version with a fix by email soon too).
hi gunnar,
thanks !I knew that there was a problem ebcause i read about these crashes before somewhere on another forum where they tried the same and they got these crashes.
Ok..the new version works BETTER :) and the first couple of runs worked like a charm ! But i just found a minor bug: it crashes when i create a script with the Deshaker option 'no motion vectors shown'...but with the vectors displayed on it seems to work !!! Still testing around :)
thanks !
WarpEnterprises
25th February 2004, 09:00
@guth: that means there is no special treatment of scenechanges.
If I want to treat each scene separated I have to filter it separated.
Wouldn't that be a useful feature to add a scenechange marker (e.g. by manually editing the first frame entry of a scene after the first pass - which will probably already be a 0,0,0,1 row if it is a scenechange) to tell it to _result_ in a 0,0,0,1 ?
@all: it seems the preset of 400 for the smoothing values is pretty low. What are your preferred settings?
guth
25th February 2004, 18:04
@Flexy:
My guess is that it crashes because you're using a codec to encode the output of pass 1 that can't handle the extremely small video output (8x8 pixels). It works for me.
@Warp:
Yeah, I guess that could be a useful feature. But it means a lot of work, and I hate programming. :)
We'll see...
I use all kinds of smoothness values (400-100000). It depends on the clip.
mrg
26th February 2004, 19:52
Hi,
it is possibly to use Deshaker for DV without lost the DV Timecode?
Thanks
WarpEnterprises
26th February 2004, 22:06
No. Only with direct stream copy, and then you can't use a filter.
Flexy
27th February 2004, 02:16
guys, i am in heaven :)
My next vacation vid will be awesome :)
I just found a very useful freee program called 'dubman' which aids in creating vdubmod jobs....you can select wildcards for directories etc.
1) save vdubmod processing settings for deshaker pass1
2) save vdubmod processing sttings for deshaker pass2
use these two *.vcf files in 'wildcard' mode in 'dubman' and go thru a whole directory...right now i am deshaking a whole directory in the background...yay :)
BUT....i have one, related, question...maybe someone can help:
- I am using Deshaker to deshake my clips.
- I am using Dynapel's Motionperfect to convert my 15fps to 24fps. Motionperfect fills in the missing frames...and the results (even if not perfect) are FAR better than what i had with my original 15fps videos !
QUESTION:
What should i do first:
) FIRST convert my clips to a higher fps with MotionPerfect and THEN deshake them ?
) or FIRST deshake them and THEN convert them to higher framerate with MP ?
Logic tells me first to deshake and stabilize the 15fps clips and then let Motionperfect work (which i a doing now) fill in mroe frames
Any tips ?
Also...keep in mind my vids all come in 15fps originally..using MotionPerfect...would you convert them to 24 or should i go NTSC 29,9 fps ????
I figure 24 would be beter since MP would not have to fill in too many 'artificial' frames [artifacts]..but on the other hand if i am planning to make NTSC VCDs...maybe i should just let it generate 29,9 fps instead of only 24 ? (Vide wold be smoother and suited for NTSC VCD..but i'd get more artifacts)
greetings
mustardman
1st March 2004, 22:34
Why on earth are you starting with 15fps? Are you using one of those memory stick recorders, or perhaps an old film camera?
Personally, I would convert from 15fps to 30fps, and then use VDub to set the rate to 29.999fps (if you feel it is really necessary).
The reason being (apart from your destination) is that MotionPerfect will then always generate a frame exactly in between the existing frames. I would imagine that doing 15->24 would not work as well. Mind you, having only used MP once (it didn't work with my source - unusual content :) ) I can't say I have a lot of experience in this area.
Flexy
1st March 2004, 23:55
Originally posted by mustardman
Why on earth are you starting with 15fps? Are you using one of those memory stick recorders, or perhaps an old film camera?
Personally, I would convert from 15fps to 30fps, and then use VDub to set the rate to 29.999fps (if you feel it is really necessary).
The reason being (apart from your destination) is that MotionPerfect will then always generate a frame exactly in between the existing frames. I would imagine that doing 15->24 would not work as well. Mind you, having only used MP once (it didn't work with my source - unusual content :) ) I can't say I have a lot of experience in this area.
hi,
it's not by choice that i us 15fps ! I have a very tiny Canon S230 which does 640x480 vids at 15fps.
HOWEVER - i have *very* good results using deshaker now and MP....not perfect - but far better than ther original vids.
(I guess the 15fps are what you have to live with when you have a cam which would fit into the palm of your hand....still love it because of it's size :)
Regarding the fps:
I did some testing, but still need more. You're right, MP generates frames in between when i do exacly 30fps (and NOT 29.97 :)....however i have to figure out stll whether the results aer better than with 23.976 fps. Reason is a) File size...and b) the fact that twice as much fps via MP means that half of the movie is 'artifcial' while with 24fps only ~60% of frames are added by MP.
mustardman
2nd March 2004, 10:20
More getting to the issue of wheter MP does calculate a frame exactly in the middle (15 -> 30) or whether it calculates a frame that is "closer" to the preceeding one or the following one. Could give funny looking results? (Again, not used it for that, so I don't know).
If you are going to NTSC video (DVD, videotape, VCD, etc) go to 30fps for the extra little bit of space. Hard drives are pretty cheap these days!
WarpEnterprises
2nd March 2004, 11:02
MP leaves the original frame only when it is EXACTLY at the same point in time.
ALL other frames are reconstructed using an interpolation algo (based on motion vectors).
So if you have 15fps and go to 25 fps you get:
Source:
1s - 2s - 3s - 4s - 5s - 6s - 7s
Result:
1=1s - 2 - 3 - 4 - 5 - 6=4s - 7 - 8 - 9 - 10 - 11=7s
From 6 resultframes only 1 is an untouched source frame !
khmann
18th April 2005, 05:00
yea, so this is pretty ugly and not recently tested, but it used to work for me. When capturing DV, I use a utility that automatically breaks all the scenes into separate files. Then I drop the individual .AVIs onto this batch file and it makes a virtual dub job so that I can do all my motion-analysis in one place.
you shold probably change the paths, and modify the line "echo VirtualDub.video.filters.instance[0].Config" to the set|of|pipe|options apropriate to how you want the pass 1 done.
@echo off
set basename=%0
set path=c:\khmann\bin;%path%
set chain=%temp%\KHJPGTMP.BAT
set chain=d:\dvproc\joblist.jobs
del %chain%
rem cd /d %temp%
echo VDMod auto deshaker. Drag and drop .JPG files here
echo.
:loop
if !%1!==!! goto done
echo %1
echo // $job "autojob" >>%chain%
echo // $input "%1" >>%chain%
type d:\dvproc\_prcbdy1.txt >> %chain%
echo VirtualDub.Open("%1","",0); >>%chain%
type d:\dvproc\_prcbdy2.txt >> %chain%
echo VirtualDub.video.filters.instance[0].Config("4|2|24|4|1.21519|4|1.21519|4|720|480|0|1|1|900|600|0|0|1|1|0|2|1|25|350|30|%1.ds|1|0|48|48|24|24|0|0|0|0|0|0|0|1|5|4|5|5|1|1|30|15|1"); >> %chain%
type d:\dvproc\_prcbdy3.txt >> %chain%
echo VirtualDub.SaveAVI("D:\\test.avi"); >> %chain%
echo VirtualDub.Close(); >>%chain%
echo. >>%chain%
echo // $endjob >>%chain%
echo //-------------------------------------------------- >>%chain%
echo. >> %chain%
shift
goto loop
:chain
:done
echo.
@echo on
@if exist %chain% %chain%
@echo off
pause
some other text is included from these files:
_prcbdy1.txt:
// $output "d:\test.avi"
// $state 0
// $start_time 0 0
// $end_time 0 0
// $script
_prcbdy2.txt:
VirtualDub.RemoveInputStreams();
VirtualDub.stream[0].SetSource(0x73647561,0);
VirtualDub.stream[0].DeleteComments(1);
VirtualDub.stream[0].AdjustChapters(1);
VirtualDub.stream[0].SetMode(0);
VirtualDub.stream[0].SetInterleave(1,500,1,0,0);
VirtualDub.stream[0].SetClipMode(1,1);
VirtualDub.stream[0].SetConversion(0,0,0,0,0);
VirtualDub.stream[0].SetVolume();
VirtualDub.stream[0].SetCompression();
VirtualDub.stream[0].EnableFilterGraph(0);
VirtualDub.stream[0].filters.Clear();
VirtualDub.video.DeleteComments(1);
VirtualDub.video.AdjustChapters(1);
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression(0x75796668,0,10000,0);
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("Deshaker v1.6");
_prcbdy3.txt:
VirtualDub.subset.Clear();
VirtualDub.subset.AddRange(0,57);
not exactly the cleanest solution, but it has served me well.
Beave
17th January 2006, 00:59
I have a 720p hdtv source that shakes exactly by one line/pixel up or down. You can easily see this at the bottom edge in the small black part there.
How can I set it up so it only corrects this minimal shaking. Should I maybe rather look into some other filter instead?
WarpEnterprises
17th January 2006, 09:40
how often does it shake? every frame?
Beave
17th January 2006, 12:59
no, every few frames and sometimes every frame. It's irregular or at least I couldn't find a pattern yet.
WarpEnterprises
3rd August 2006, 20:42
(1) new version 1.9
(2) still some problems when using with AviSynth - look here (http://forum.doom9.org/showthread.php?p=859016#post859016)
WarpEnterprises
6th August 2006, 14:03
@guth: the percentage of discarded blocks is a quite important number, yet it can't be seen anywhere. Maybe it could be displayed in the pass1-output along with the other values?
guth
6th August 2006, 16:57
This is a little complicated. :)
There are three types of blocks:
A. Ok blocks. Have white motion vectors.
B. Blocks discarded due to bad motion vectors. Have red vectors.
C. Blocks discarded due to bad match. Have no motion vectors.
Which percentage do you want to see? The deep analysis kick-in percentage is compared to the ratio B / (A + B) and the frame discard limit is compared to the ratio A / (A + B + C). I think it makes sense to do that but it's somewhat confusing I guess, especially since it's not documented. :)
WarpEnterprises
7th August 2006, 07:07
since it's not documented ... well, now it is :)
Maybe simply print both?
I used the "skip frame" setting to adjust the sensitivity for big objects moving in the scene. Is this the right setting to tune? (when NOT using deep analysis)
Just another question: if I use scale=quarter does this imply that the found motion is only accurate to +/- 4 pixels (which seems not true) or how else can this value be understood?
guth
8th August 2006, 18:29
Hmm... I'm not sure I want to print both. We'll see.
The "skip frame" setting is basically just there because if very few motion vectors were good, Deshaker probably got everything wrong so it's probably best to skip the frame completely. There are many ways to deal with big moving objects depending on how big they are, how fast they move and for how long they're in the picture. Skipping the frame completely should only be done as a last resort, or if you're lazy :)
Quarter scale indeed means that the matching occurs on images that are reduced to 1/4 of the original width and height, but the accuracy is usually better than 4 pixels anyway for two reasons:
1. I sort of use sub pixel accuracy when calculating the best shift for a block. (I do this by fitting a 2nd degree function through the best shift and its two integer neighbors, and their "match probability values", and take the shift where this function has its max.)
2. Any impreciseness in the block vectors will be evened out when I combine them all for the total motion of the frame.
That said, I don't really recommend using quarter scale anyway. Personally I always use full scale.
guth
12th August 2006, 13:39
New version of Deshaker available for anyone who cares. Get it here (http://www.guthspot.se/video/deshaker.htm).
smok3
29th January 2007, 16:41
trying to batch version 2.0 via vdub.exe, but some (most) of the settings for 2nd pass get lost somewhere, should those be in job scripts?
for example, this seems to be 2nd pass
VirtualDub.video.filters.Add("Deshaker v2.0");
VirtualDub.video.filters.instance[0].Config("9|1|30|4|1.09402|1|1|0|640|480|1|2|1|400|400|400|1500|4|1|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|0|0|0|1|0|0|10|1|15");
guth
29th January 2007, 18:15
I'm afraid I don't really understand what you mean. That scripts runs pass 1. Could you give me some more details? (You can email me if you want.)
smok3
30th January 2007, 09:00
i did a little batch (which is called from total commander):
@ECHO OFF
for /f "delims=+++++" %%i in (%1) DO vdub /i "t:\path\vdubdeshake1.script" "%%i" "%%~pi%%~ni_deshaked.avi" ¦ vdub /i "t:\path\vdubdeshake2.script" "%%i" "%%~pi%%~ni_deshaked.avi"
it depends on this 2 vdub scripts:
vdubdeshake1.script
VirtualDub.Open(VirtualDub.params[0]);
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.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("Deshaker v2.0");
VirtualDub.video.filters.instance[0].Config("9|1|30|4|1.09402|1|1|0|640|480|1|2|1|400|400|400|1500|4|1|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|0|0|0|1|0|0|10|1|15");
VirtualDub.audio.filters.Clear();
VirtualDub.project.ClearTextInfo();
VirtualDub.SaveAVI(VirtualDub.params[1]);
VirtualDub.audio.SetSource(1);
vdubdeshake2.script
VirtualDub.Open(VirtualDub.params[0]);
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.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression(0x64737664,0,10000,0);
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("Deshaker v2.0");
VirtualDub.video.filters.instance[0].Config("9|2|30|4|1.09402|1|1|0|640|480|1|2|1|400|400|400|1500|4|1|3|2|5|40|300|4|C:\\deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|0.7|15|15|5|1|1|1|15|15|0|0|0|0|1|1|0|10|1|15");
VirtualDub.video.filters.Add("sharpen");
VirtualDub.video.filters.instance[1].Config(5);
VirtualDub.audio.filters.Clear();
VirtualDub.project.ClearTextInfo();
VirtualDub.SaveAVI(VirtualDub.params[1]);
VirtualDub.audio.SetSource(1);
VirtualDub.Close();
but i dont get things like:
- use previous and future frames...
- edge compensation mode...
- ect...
(everything seems default)
EDIT: for some unknown reason things are working now...., weird.
------------
other than that, how would i generate a unique name for deshaker log? (like input_filename_deshaker.log) - using this method? EDIT2: solved
guth
30th January 2007, 20:28
Weird, but good :)
About unique log files, I don't know. I'm no script guru at all.
But I wouldn't really recommend running deshaker in batch mode at all. The results will rarely be perfect unless you do some supervision.
smok3
30th January 2007, 21:14
yes, the idea is to do some short segments using gui, then save those to this 2 scripts and run batch only after that. About unique log name, on 2nd thought it is almost not important since a lot seems to depend on 1st pass anyway, but i will do some renaming in original .bat like;
rename c:\deshaker.log to InputFilepath/InputFilename_deshaker.log
(at the end of the script)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.