Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
27th September 2009, 19:02 | #182 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Hi Gunnar,
Something I noticed a long time ago is that Deshaker takes longer and longer to do the actual "Deshaking..." part with higher values of motion smoothness. For example (10000 frames): Motion smoothness=100, <1s Motion smoothness=1000, 11s Motion smoothness=10000, >200s I assume these values decide how many frames' worth of parameters either side are averaged to decide how to move that frame, and that it might be a Gaussian distribution to give a smooth effect. Have you considered optimizing this step? For instance, you can approximate a Gaussian "blur" of parameters like this with multiple simple box blurs, which will only take longer as the number of frames increases, not (or not much) with the width of the "blur". I know most people won't find this a problem but if you do want to use a high value of motion smoothness, it can take a while. David |
27th September 2009, 21:27 | #183 | Link |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
To generate the smooth paths I solve some large equation systems numerically, and they converge slower with higher smoothness values. I haven't gotten many complaints about it, but maybe I can do it some other way. We'll see...
|
29th September 2009, 00:32 | #185 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
I ran a default first pass (with a 1% search range), then I altered all four of the motion smoothness parameters (horizontal, vertical, rotation, zoom) to 100, 1000, or 10000 in turn.
If you remember, a long time ago I was playing around with writing a perspective-correcting deshaker, which used deshaker.log as it's input. For each frame, all I did was average the values for a number of frames on either side, then subtract that from the original value for that frame to get the parameter for adjusting the image. It seemed to come out pretty similar to Deshaker (although I should say it was a bit of a guess, I didn't know if it would work), but I didn't take it very far. The beauty of it is that a) if the average of a parameter for frame x is calculated from by the total from p[x-w] to p[x+w], divided by 2w+1, the next average (for x+1) can be calculated by taking that total (pre-division), and subtracting p[x-w] and adding p[x+w+1]. Only the calculation for the first frame is dependent on the size of w - all other frames only need one subtraction and one addition. And b) if you perform this averaging 3 or more times, you have a good approximation to a Gaussian distribution, which makes for a nice smooth curve. As I said, I don't doubt that no-one else has been bothered by this, because who really needs to smooth over 10000 frames (except me )? David |
29th September 2009, 17:26 | #186 | Link |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
Did the video come out looking ok with the 10000 smoothness? Cause using adaptive zoom with that high smoothness, usually doesn't look good at all. If you turn off the adaptive zoom it should be faster.
I just ran a test with 10000 frames and 10000 smoothness, and it took 10 seconds to deshake. But I don't doubt it can take very long with certain clips/settings. As for your smoothing idea, I do remember it, and I'm still not sure I like it. I don't think I want a Gaussian distribution. My algorithm tries to minimize the squared corrections (ie tries extra hard to minimize the biggest corrections) in order to minimize the ugly borders. Your algorithm doesn't even bother looking at how big the corrections become. Maybe the difference in practice is small, but still... |
29th September 2009, 18:27 | #187 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
I didn't actually watch the video, I was just watching how look it took to deshake
Deshaker is obviously more sophisticated than I assumed - not that I thought it was unsophisticated! - my averaging looked enough like Deshaker's output on my test video that I assumed it was similar. That project wasn't about the smoothing anyway, but about the correction of wide-angle frames, which benefit from being rotated in three dimensions rather than panned in two. David |
30th September 2009, 21:42 | #188 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
It's not so easy to use the adaptive zoom correctly.
I can't think of many situations where you have to "deshake" the real zoom, so although "edge compensation adaptive zoom" is the default, maybe "adaptive zoom only" will be the more likely choice. Then the motion smoothness for zoom must indeed be quite high (~5000) because it should resemble a slow real zoom. But the motion smoothness for panning and rotation can be much lower (~500), only those do the real deshaking. The lowest "nice" values can be found by leaving the zoom value 0 and using "edge compensation none", then increasing the pan/rot values until the shake is gone. Then use the high zoom value and "adaptive zoom only". That way only ONE of the four values is high, which makes it much faster and leaves more "space" for soft zooming. Maybe the caption is a little bit misleading, too: It looks like the difference between "Adaptive zoom (some borders)" and "Adaptive zoom only" is only how much borders are in the result which in fact is NOT the difference (as the manual correctly tells). |
1st October 2009, 18:26 | #189 | Link |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
David...
I was just trying (hard) to come up with a reason for using my algorithm instead of yours Warp... "Adaptive zoom only (some borders)" is too long, it doesn't fit. And anyway, I never meant for Deshaker to be user friendly I'll think about it, though... As for "nice" settings, what's nice for one person might not be nice for another. I, for example, almost always use "edge compensation: none", but do use zoom smoothing (unless there's no zooming in the clip). Almost the exact opposite of you |
2nd October 2009, 13:23 | #190 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
guth, I have one more question:
is your internal timescale/unit for motion smoothness the same for pan and zoom? I mean, if there is a clip which shakes in X-direction with the same frequency as another clip which "shakes" in the zoom-value would I have to apply the same motion smoothness values to get similar results? |
2nd October 2009, 17:33 | #191 | Link |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
Panning and zooming don't share the same unit, so you can't really compare them. It's like asking if a minute is longer than a meter.
Another answer is that the numbers I use internally during smoothing to represent panning is 'number of pixels', and for zoom 'the natural logarithm of the zoom factor'. Based on this, I'd say that a zoom unit would "seem" quite a lot bigger than a pixel unit, but how much depends on the size (in pixels) of a frame. That is, if they were comparable at all I haven't really thought much about this. It's an interesting question... sort of... |
2nd October 2009, 19:45 | #193 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
@guth: interesting! But I was concerned of the time dimension - if I understand correctly higher smoothness values make the resulting video shake less AND shake slower (make the resulting amplitude smaller AND the frequency lower). That way pan and zoom would be more comparable, at least the frequency. But maybe I'm simplifying things the wrong way...
|
2nd October 2009, 21:04 | #194 | Link |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
I'm not sure I understand what you're asking. Yes, higher smoothness values makes the video shake less and slower.
But you can't really separate the frequency from the amount during the smoothing. And since it's hard to compare the amount, it's hard to compare the overall effect (including frequency). My algorithm doesn't really correspond to a lowpass filter thingy with a certain cutoff frequency, or at least I don't think so. |
21st January 2010, 21:35 | #195 | Link |
Registered User
Join Date: Dec 2003
Posts: 253
|
just tried the deshaker on some old digitized film i have and it worked great! i'd like to try running it as a batch. i know it's not the recommended procedure but i think i could narrow down my tasks that way since the default setting worked so well on my first jitter test.
being new to this, i'm very much unclear on how to set up a batch test using the jobs function. could someone post a step-by-step on how to use jobs to execute deshaker on several files? i'd very much appreciate it. the thing that has me most confused is how i'd run the first pass since this seems very much a manual operation the way i tested it. thanks, BabaG |
22nd January 2010, 01:03 | #196 | Link | |
Registered User
Join Date: Jul 2009
Posts: 4
|
Quote:
Second, and sadly, I have never heard of any practical way of queueing up Deshaker jobs in batch. I've made my own scripts which would, in fact, generate the VirtualDubMod job file directly. Writing them was a trial and error job. They surely won't work for any video - just for those I take with my cam, a Canon PowerShot 720 IS. I also needed to make a variety of similar scripts just to handle slightly different movie formats. Mine will probably not work for you unmodified, unless you have the same camera. Moreover, it makes some assumptions on file naming which may add to the hassle and solve nothing for you after all. Third, and contrary to what I did (I just needed a quick fix for 270 files), applying Deshaker in batch might not be a good idea. Several of my movies did not deshake well, even after I carefully adjusted "my own default parameters". If you have the time, I suggest you read up the whole thread to grab a few ideas on how to find the best parameters for each of your movies, manually. If you have even more time and expertise, or a nice programmer friend with plenty of time (not the case usually), make your own scripts. Currently I think the problem of batch deshaking is just one of several deficiencies in Deshaker (e.g. an easy, intuitive way of telling it to disconsider a specific object or other part of the image). Nonetheless, Deshaker is the best and we'd love an open-source version, which could then prompt a solution more quickly. |
|
22nd January 2010, 18:02 | #197 | Link | |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
Quote:
|
|
1st March 2010, 06:18 | #199 | Link |
Registered User
Join Date: Jan 2006
Posts: 9
|
hey all. first of all guth i'd like to say how great of a plug in this is for shaky video. it really works wonders for me. i own a flip hd mino which is really bad for moving around while recording, especially when walking. unfortunately i don't know the exact rolling shutter %. the default 89% seems to work pretty well, but i emailed flip and asked so hopefully they'll reply with an answer. if they do, i'll be sure to post it here for everyone.
i have a few questions for you guth... i'm not very educated on video like a lot of the people here, but i also don't consider myself a complete newbie. for motion smoothness, what would be general ideal settings for someone that wants to stabilize, but at the same time not lose sharpness. i don't know if it's me, but it seems the higher i set smoothness the blurrier my video becomes. or perhaps it's another setting that's causing blurriness? it's not too bad, but i'm a quality nut and it's bugging me. is the cost of stabilizing video slight loss of quality? actually that's my only question now that i think about it. thanks! i guess i should also mention i use no edge compensation and uncheck "ignore pixels darker that 15% brightness". everything else is left at default besides a full scale and using 'all pixels' under first pass. my source video is 1280 x 720 29.97 progressive. |
1st March 2010, 18:52 | #200 | Link | |
Registered User
Join Date: Apr 2003
Location: Uppsala, Sweden
Posts: 157
|
Quote:
But I suspect that what you're seeing is motion blur in the frames. Deshaker can only remove unwanted motion between frames, not within frames. So if you have a slow shutter speed (slower than around 1/300 sec) there's a high risk you'll get motion blur. When you have motion both within and between frames, motion blur often looks nice, but when you remove the motion between frames, it looks bad. And in a way it might look slightly worse with higher smoothness settings. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|