View Full Version : Deshaker by Gunnar Thalin
Pages :
1
2
[
3]
4
5
6
7
8
9
10
11
scharfis_brain
6th March 2008, 13:49
The border compensation would have looked much nicer if the video wouldn't be deinterlaced before deshaking.
Use either pure interlaced without modification for deshaking,
or bob-deinterlace the video to 50fps before deinterlacing.
The sample you linked here was deinterlaced to 25fps thus discarding 50% of valid image/motion data!
Undead Sega
6th March 2008, 13:57
actually, i ddi deinterlace it to 50fps before deshaking it, cause i thought it would use more frames to help compensate for the black borders.
afterwards, i then encoded it to an MPEG 2 at 25fps, which is what i have provided.
scharfis_brain
6th March 2008, 14:36
if you deinterlace before deshaking you should try nnedi() for the interpolation.
You'll get rid of all the stairstepping.
could you upload a non-deinterlaced source, please?
Undead Sega
6th March 2008, 19:57
well, the oringal source was recorded from a miniDVD camcorder at the highest quality possible (even though it still looked crap and etc.) and still at 50i, how bizare:
http://www.wikiupload.com/download_page.php?id=35962
i tried to deinterlace it with MCBob at 50p but th odd frmes keeps on coming every other frame, thus giving it a very strange stutter.
hope that helps.
scharfis_brain
6th March 2008, 21:54
it is NOT the fault of mcbob()
your MPEG2 File is totally b0rked.
you encoded it in progressive mode and set bottom field first fieldorder. But the video is interlaced Top field first!
This is the reason for:
- the BAD quality
- colour problems
- the 'strange shutter'
So, provide an unprocessed sample, please.
(DV.AVI if possible)
Undead Sega
6th March 2008, 21:56
i see then, this is a first, maybe the settings has changed this time, but i will correct it from the previous user.
anyways, besides that, i posted the stablized video clip example, what was your thoughts on that? before and after wise.
BBugsBunny
6th March 2008, 22:01
Most wide angle lenses are usually either rectilinear or fisheye. I guess it's pretty obvious that fisheye lenses will give strange results when deshaking, but the fact is that even perfectly rectilinear lenses will look a bit weird (which that sequence above demonstrates).
Am I right that deshaking films shot with wide angles lenses would require to measure each specific camcorder lens to get info about the distortion it causes and with such an info it could be deshaked?
For foto shots with digital cameras there are some tools that have measured different lenses and cameras and can do some correction afterwards eg:
http://www.epaperpress.com/ptlens/
They have the lens profiles included in the software.
Another topic: recently Deshaker was tested in the german computer magazine ct. It was compared with other deshakers all of them not free exept deshaker. Guess who got best results? Deshaker! I do not have this ct at home I only was quickly flying over. One problem they stated that deshaker could not correctly handle some caps from HD cameras.
Undead Sega
7th March 2008, 17:38
you encoded it in progressive mode and set bottom field first fieldorder. But the video is interlaced Top field first!
i know this has been brang up beofre, but either case, can this error be amended?
guth
7th March 2008, 18:44
Am I right that deshaking films shot with wide angles lenses would require to measure each specific camcorder lens to get info about the distortion it causes and with such an info it could be deshaked?
No, I'm afraid not. The problem occurs because deshaker moves the content of the frames around. To correct it you would have to know how much deshaker will move it. That info is (sort of) in the logfile, but I don't think the software to fix this exists, except maybe for davidhorman's attempt earlier in this thread. To make it perfect, though, deshaker would have to be modified for pass 1 too.
But to correct perspective distortion, no measuring of the lens would have to be made. I think the FOV angle is all that deshaker would need, and I could probably make it determine the FOV itself.
But to correct additional barrel/pincushion distortion of the lens, you would have to measure it and fix it yourself in advance.
Another topic: recently Deshaker was tested in the german computer magazine ct. It was compared with other deshakers all of them not free exept deshaker. Guess who got best results? Deshaker! I do not have this ct at home I only was quickly flying over. One problem they stated that deshaker could not correctly handle some caps from HD cameras.
I didn't know this. Nice! :)
If anyone knows what caps they are talking about, I would very much like to know.
BBugsBunny
7th March 2008, 19:15
This is the link to the article:
http://www.heise.de/kiosk/archiv/ct/2008/05/164_Software_zum_nachtraeglichen_Stabilisieren_verwackelter_Videos
But it's not a free download :( , it costs 0,70€
Guth, if you ask the authors I'm sure they will tell you what caps they had problems with.
You can find the general contact e-mail adress here: http://www.heise.de/ct/kontakt/
guth
7th March 2008, 19:21
Thanks! I guess it's in German? My German could be better... :)
BBugsBunny
7th March 2008, 19:27
Yes the article is in german, but if you contact the authors in english it should be no problem.
Adub
7th March 2008, 20:13
Holy Crap! That filter is godly! I know there were a few "tearing" artifacts, but the overall effect was stunning!
Undead Sega
7th March 2008, 20:27
i take it u saw my video example?
@scharfis_brain, i have adjusted my settings and i still keep getting the same results.
this is wen i make an AVI, i set the encode to Interlace, including the video source to Interlace and yet i still get a Progressive video with interlacing artifacts.
what do i do to make a lossless Interlaced AVI from a .VRO (DVD-RAM file)?
Adub
8th March 2008, 04:45
i take it u saw my video example?
Indeed.
guth
8th March 2008, 08:34
For some reason I can't see your video clips, Undead Sega. IE says it can't find the file, and I usually see lots of broken links on that page.
Undead Sega
8th March 2008, 14:05
oh no! its gone! :(
man, that another uploading again, unless it is the site's fault.
the only person i know here who has downloaded are: scharfis_brain and Merlin7777.
Undead Sega
9th March 2008, 20:10
this is wen i make an AVI, i set the encode to Interlace, including the video source to Interlace and yet i still get a Progressive video with interlacing artifacts.
what do i do to make a lossless Interlaced AVI from a .VRO (DVD-RAM file)?
can anyone help me with this one before i continue?
scharfis_brain
11th March 2008, 16:37
@guth: can you add an option to the fist pass?
I need to ignore all vectors that appear static (or almost static) to deshaker.
Imagine a bird in the blue sky.
the bird covers approx. 10 to 15% of the image area. (high zoom)
but deshaker discards all motion vectors of the shaking bird, cause it thinks the 'static' sky is the reference.
So effectively nothing is getting stabilized.
Maybe you could add options to
a) ignore nearly flat areas
b) ignore vectors that move less than xx pixels.
guth
11th March 2008, 17:50
Yes, that can be a problem. It happens because of built-in temporal smoothing in the camcorder. It makes noise look similar between the frames and causes deshaker to match on the noise. The noise is most apparent in the highest scale, so try using a lower (less precise) scale. Also, try increasing either (or both) of the first "discard motion of blocks that..."-values. And if nothing else helps, use "ignore pixels outside" to only match on the bird.
You could also try adding some nontemporal smoother before deshaker (pass 1 only) that removes the tiny noise.
WarpEnterprises
11th March 2008, 17:55
Can't you use "ignore outside", thereby telling DS to only use the bird's image (I suppose the bird is approx. in the middle of the image)?
(edit: guth was faster...)
scharfis_brain
11th March 2008, 18:12
actually this was only an example.
I have a highly compressed web video, I want to deshake.
There is no noise appearant. Also I smmothed out possible blocking before applying deshaker.
Ignoring outside is no option either, cause it shakes too much.
guth
11th March 2008, 18:24
Highly compressed video has almost the same problem. The encoder tends to leave blocks unchanged from the previous frame a lot, to increase compression. So deshaker will match on the blocks because of that.
Try increasing the 2nd "discard motion..." settings. Its only purpose is to discard blocks that get a good match value for many different shifts, such as a blue sky. The similarities to previous frame can still be a problem though...
mustardman
12th March 2008, 05:35
@sharfis_brain : Your suggestion of ignoring vectors less than a certain size is very similar to my request (which guth implemented over a year ago, but only fairly recently included in the release code). This was to ignore all vectors that had more than a certain size...
My problem was the opposite (as you could guess). The camera was mounted on a tripod pointing out the side window of a car. The vibration of the camera was small, but got extremely annoying after less than 5 minutes of viewing. Deshaker did a marvellous (truly marvellous in fact) job of stabilising the image. Nearly all the video was of the landscape (horizon), so deshaker had good data to work with. Problem was, every so often a tree would race past, deshaker would lock onto it (because it filled a lot of the frame), and the frame would very badly jerk to follow the tree, before returning to nice stable video!
The "ignore vectors greater than" solved this problem completely! Many thanks to guth!!!
I know what you mean about deshaker finding "random" motion vectors in a non-moving, but constant colour, regions of the image. It has been a long time since I used deshaker, has there been any movement in regard to addressing this issue?
Cheers all,
MM
edit: PS. At the risk of making deshaker even more complicated, perhaps an option similar to ignoring dark pixels, ignoring blocks that are matched with a threshold less than a certain amount? Like I said, I havent used it for a while, this may already exist...
guth
12th March 2008, 18:52
... ignoring blocks that are matched with a threshold less than a certain amount?...
Do you mean something like "discard motion of blocks that have match value < X"?
It has been there since version 1.0.
BBugsBunny
12th March 2008, 21:59
I solved some of these "blue sky" deshaking issues by adding my gradation curves filter for the first pass (position in filterchain before deshaker) and drawing a filter curve that simply blacked out these undesired color values, so deshaker discards them as "black". This method will not help always but somtimes can give better results with difficult footage.
scharfis_brain
12th March 2008, 22:35
hmm, that's a nice idea.
but I would prefer an option to drop (near to) zero length vectors, though ;-)
mustardman
13th March 2008, 09:04
@guth : sorry, didn't even think! doh :(
AnnaFan777
30th April 2008, 16:36
deleted
AnnaFan777
1st May 2008, 00:25
deleted
scharfis_brain
1st May 2008, 02:56
it is always a very good option to RTMF(!).
: If you enter -1 as smoothness you will get "infinite smoothness", meaning the camera will appear to be stationary at the position of the first frame that was processed in pass 1. This feature usually doesn't work perfectly, though.
@clint999
I've deleted the spam link in your signature twice now, and have PM'ed you about it. If you put it back again, you'll be struck and then banned.
Undead Sega
5th June 2008, 10:41
Hi, im back, and i just wanted to know if this is good practice that i had in mind in theory.
that being is, because the filter analyzes frames to enable to help stablize the video footage, how would it be if the footage was motion interpolated to 2-4 times the frame rate, thus creating more frames for it to analyze and as well to help fill in the black borders?
i have done such thing i admit, but it doesnt seem that steady (maybe because i raised the framerate that i also have to increase the motion smoothess? that is something i have to get back onto), mainly i think because there are motion artifacts from the interpolating and the motion vectors when analzing the footage mistaken them for a motion that leands to a different direction. could this be correct?
any ideas?
Maybe I'm missing something, but I don't really see the point in doing what you're trying to do. Why would Deshaker be helped by adding interpolated frames?
Isn't deshaker multithread? whenever it's doing the first or second pass("Deshaking...") it only uses 50% of my CPU.. at least this is what task manager says about virtualdub.exe ...
any thoughts?
Deshaker isn't the only thing that's working when you run video through it. There's the encoder/decoder and VirtualDub too, that might not be multi-threaded. And Deshaker isn't 100% multi-threaded. Only the most time consuming parts (except "deep analysis") are multi-threaded. So if you're using very fast settings, you might not see a big difference.
In the Deshaker settings dialog, does it say it has detected more than one processor?
Try using some really slow settings (just for testing), such as "differential search range" = 20. It really should go well above 50% then.
It says 2 processors..
And I'm on its 2nd pass and it's taking like forever to finish..I'm not even saving a new avi file, I JUST clicked on '2pass' and hit OK and this "Deshaking..." window is almost burning-in my lcd display lol.
I'm using bicubic resampling, no edge compensation, no fillborders and only *vertical* panning smoothing.. The virtualdub.exe process never goes above 50% and there are only 3 threads in it.. and there aren't other processes using more than 0% cpu...
My source is a 720x480 .avi with huffyuv vhs capture.. 1h40m long and I'm on a Athlon x2 with XPSP3..
Options on the right-bottom are:
0 0
8000 0
1 1
5 1
Oh, you've got the "Deshaking..." window up. Right, that part is not multi-threaded. It usually doesn't take that long so I never bothered. But it can take a long time sometimes. Try increasing the max. correction limits to start with. Try putting 100 in all those boxes (and maybe lowering the smoothness values as well). It should be a lot quicker then (but the corrections won't be limited).
But.. I only want vertical correction.. I'm using it to stop some jumping my VCR produces.. the image is always going like 14 pixels up and then 14 pixel back down again in consecutive frames... the way I set it up, it's working peeeerfectly... if it would try to correct horizontal or zooming panning it would screw up the vid because it is kinda complex :(
I think I'll have to wait, right? lol it's taking like 3h to do the job
Are you trying to accomplish that by using really low values on three of the max. correction limits? If so, no wonder it's taking forever :)
The correct way to only stabilize vertically is to set the other three *smoothness* values to 0.
I changed it... and 1h has passed since then.. :P still waiting.. hehe what exactly is it doing in this 'deshaking...' stage?
0 0
8000 0
100 100
5 100
Undead Sega
6th June 2008, 03:49
Maybe I'm missing something, but I don't really see the point in doing what you're trying to do. Why would Deshaker be helped by adding interpolated frames?
the interpolated frames are there for a more deeper analyzes on how the camera moves AND the frames help fill the black borders to help give more image of the object than having less frames.
fbs, that sounds very strange. What are those numbers?
In the deshaking stage, it calculates how all of the frames should be transformed (but doesn't actually transform them).
If you set all max. correction limits to 100 and leave all smoothness values below 10000, it should be rather quick. How long is your clip?
If you want, you can send me your settings and logfile (maybe privately) and I'll look at it.
Undead Sega, I still don't understand. I would rather say that the interpolated frames probably would make it harder for Deshaker. And I really don't see how they would give more data to use in the borders. They don't cover any "real world data" that isn't already in the real frames.
Undead Sega
6th June 2008, 20:22
it becomes harder because it has more frames to scan.
EDIT: nevermind.
fbs, that sounds very strange. What are those numbers?
In the deshaking stage, it calculates how all of the frames should be transformed (but doesn't actually transform them).
If you set all max. correction limits to 100 and leave all smoothness values below 10000, it should be rather quick. How long is your clip?
If you want, you can send me your settings and logfile (maybe privately) and I'll look at it.
I'm using 0 for all smoothness except vertical which is 8000
I'm using 100 for all max corrections except vertical which is 5..
My vid was 1h40m long...
What I'm trying to do here is just correct some jumps my VCR produces in almost all frames.. look the logfile:
1663B 0.31 -15.40 0.006 0.99989
1664A -0.65 15.50 0.030 0.99973
15 pixels up then 15 down.. it's this way all over the tape..
With these settings I could correct it.. the problem is the speed :P I'll have to do this for like 20 tapes.. and only the 'Deshaking..' stage is taking 2-3 hours...
can you create an option for it to just work with vertical? both at 1st and 2nd pass? ;p I would gladly test it.. I can be a beta tester lol my msn is fbs [at] brasnet.org
It would probably be a lot faster if you split your clip into a few parts and processed them individually. The time needed for "deshaking..." unfortunately isn't linear with respect to the clip length. I'm still surprised it takes so long, though.
Again, if you want, you could send me the logfile and settings.
It would probably be a lot faster if you split your clip into a few parts and processed them individually. The time needed for "deshaking..." unfortunately isn't linear with respect to the clip length. I'm still surprised it takes so long, though.
Again, if you want, you could send me the logfile and settings.
I could send it to you.. can you add me on msn? fbs [at] brasnet.org
I'd really like an optimized/upgraded version of your filter
:thanks:
guth
15th June 2008, 17:34
Didn't you get my reply to your private message?
Please email me the files, to gunnart [at] guthspot.se.
scharfis_brain
15th June 2008, 20:46
@Gunnar:
could you add a progress bar to the 'Deshaking...' popup-window?
Or even more: a counter for the estimated remaing time?
It would be very nice to be able to judge how long the calculation process will take...
guth
16th June 2008, 19:04
Without going into details, I'm afraid it's not quite that simple. I don't really know how long it will take.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.