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. |
|
|
Thread Tools | Search this Thread | Display Modes |
27th November 2006, 07:22 | #202 | Link |
Registered User
Join Date: Jan 2002
Posts: 1,264
|
Hey guys I need some help. I really cannot understand why it's so difficult to fix this problem. I have a movie clip that moves up and down by a few pixels every few frames (Something like every 15 frames but not always). I just need to stablize the up down motion. I thought it would be simple but it appears not.
The depan command I tried was Code:
i = ConvertToYV12() mdata = DePanEstimate(i) DePanStabilize(i, data=mdata, dxmax=0) In another thread someone suggested I use a cropped clip for motion estimation and apply that to the second clip or somesuch. Damned if I know what he means. The clip has a logo on it that I could use as a guide to help with the motion detection. Since that logo is the same all the way through the clip and it too moves up and down every few frames I thought it would be a matter of applying a filter that detects that area when it moves up and down. I don't know very much about all these Avisynth commands apart from the basics. The Depan manual seems rather cryptic to someone who does not do much Avisynth work. Can someone lead me to a solution? Thanks. EDIT: OK I tried something from some earlier postings. It seems to work a lot better. No wild motion with big frames appearing this time. Is this OK? Code:
i=ConvertToYV12() r=1 mdata=DePanEstimate(i,trust=4,range=r) DePanInterleave(i,data=mdata,prev=r,next=r,mirror=15) SelectEvery(r+r+1,r) i=last mdata=DePanEstimate(i,trust=4,range=r) DePanStabilize(i,data=mdata,cutoff=1,prev=1,next=1,mirror=15,dxmax=0,dymax=0) Nope. I think I nailed it. It needs a few frames to figure out the motion then it stabilizes it rock solid. I removed what looks like a repeat line from that code too. EDIT: Well it does not seem to stop the very slight up and down motion every few frames at all. Very frustrating. Last edited by oddball; 27th November 2006 at 08:02. |
27th November 2006, 08:45 | #203 | Link | |
Registered User
Join Date: Jan 2002
Posts: 1,264
|
Quote:
Same problem. Fizik how do I compensate for a vertical dy = 0.01 to 0.04 pixels frame motion? Here is a screenshot of DePanStabilize output. http://img213.imageshack.us/img213/4462/motionpm8.png Last edited by oddball; 27th November 2006 at 08:50. |
|
27th November 2006, 19:32 | #204 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
Please do not cross-post.
Are your source is progressive? If yes, here is the steps: 1. find appropriate crop values to remove almost all besides logo. Not crop logo at any frame. And use cropped width and height as power of 2 (i.e. 16, 32, 64, 128, 256) mpeg2source(...) c=crop(100,200,300,400) return c 2. Try analyse the motion mpeg2source(...) c=crop(100,200,300,400) m=depanestimate(c, dx=0) depan(last,data=m, info=true) (logo is very small to use directly depanestimate(c, info=true)) (You can also produce log file to analyze and process it somehow) dy = 0.01 to 0.04 pixels is very very little values Probably you will get around 3.0 to 10.0 Chack scenechange too. 4. Next step is stabilization. mpeg2source(...) c=crop(100,200,300,400) m=depanestimate(c, dx=0) depanstabilize(last,data=m, info=true,cutoff=2) Try tune some parameters, for example cutoff But I am not sure that DepanStabilize can give usable result for your case. (NO WARRANTY )
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
27th November 2006, 23:20 | #209 | Link |
Registered User
Join Date: Jan 2002
Posts: 1,264
|
It shifts between 0.01 to 0.04 up and down. Using the logo was no good. Depan was not sensing any movement on it. If I use the previous posters line 712 which is pretty much where my bottom border is then it detects the small motion up and down. It detects it but DepanStabilizer cannot move the frame by such small increments up and down to correct the vertical motion.
|
28th November 2006, 00:58 | #210 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
I am sure you still do get right settings for Depanestimate.
What is real shift? 0.04 pixels is invisible. Post your real script like it: mpeg2source(...) c=crop(100,200,300,400) m=depanestimate(c, dxmax=0,info=true) And why you do not use v1.9.1 ?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
28th November 2006, 03:10 | #211 | Link |
Registered User
Join Date: Jan 2002
Posts: 1,264
|
I initially tried
DirectShowSource(video.m2v) c=crop(1058,570,76,80) m=depanestimate(c, dxmax=0) depanstabilize(last,data=m, info=true,cutoff=2) But it does not detect any movement whatsoever where the logo is (It is correctly set as i can see the logo only when I add 'return c'). So I tried. c=crop(0,712,0,0) m=depanestimate(c, dxmax=0) depanstabilize(last,data=m, info=true,cutoff=2) Like a previous person used and it detects the movement and displays it in Depan's output but it does not stop the movement up and down. I am using 1.9.1 now. No difference though. |
28th November 2006, 06:34 | #213 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
Logo is not moving or depanestimate do not detect its movement?
upload short compressed clip.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
28th November 2006, 19:08 | #214 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
if movement between frames is always really so little, and it slow accumulates to large values, then some new specific algorithm must be implemented (for example, motion estimation across large interval). But I have no plan to do it right now.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
28th November 2006, 19:26 | #215 | Link |
Registered User
Join Date: Nov 2004
Location: Spain
Posts: 410
|
Hi,
A mad idea. If you suffle the frames, do depaning and reorder it ¿could result?. As example: a=clip.selectevery(10,0,5,1,6,2,7,3,8,4,9) v=a.depanestimate() d=a.depanstabilize(v) d.selectevery(10,0,2,4,6,8,1,3,5,7) |
20th November 2007, 22:44 | #216 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,653
|
I get some weird greenish tint when I try to use depanstabilize at default values.
It is best noticable with greyscale videos. Is this issue known?
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
5th December 2007, 04:33 | #217 | Link |
Registered User
Join Date: Dec 2003
Posts: 155
|
I have trouble writing a log file. What's the correct syntax for it?
I'm trying to stabilize some of the very old disney shorts, which are badly transferred resulting in a very jumpy clip. Base frames seems to be detected quite well, but i'm not so happy with the correction itself. I've been tweaking some of the parameters with different results. My main concern is that when i specify dxmax/dymax in both DePanEstimate and DePanStabilize, there are still cases where it corrects with insane values. I dislike that it focuses so much on the center, because it appearently often detects a moving character as a reference instead of the actual scene. I don't really understand the way this works. I would expect it to take the base frame and use that frame as a reference for correcting other frames, but as I understand, it only corrects based on the range, that is the surrounding frames (is this correct?). Can someone enlighten me? Also I don't understand the meaning of parameters cutoff, damping and trust. |
8th December 2007, 15:16 | #219 | Link |
Registered User
Join Date: Dec 2006
Posts: 280
|
Can't help you there, but I share your pain - I messed with the whole stabilization thingy for a couple days, and gave up on it - no matter the settings, sometimes it messed up big-big, detected stuff incorrectly, and so on... The only solution I got to was use really small values, and then record frames where it mis-detects, and then, theoretically, not apply it to those places... Which is all too much work then I'd care to do, so I dropped it...
Edit: In case you wonder what I mean by small values, here's what I used: i = ConvertToYV12() mdata = DepanEstimate(i,dxmax=2,dymax=2,range=3,stab=1.0) DePanStabilize(i, data=mdata) |
8th December 2007, 22:24 | #220 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,706
|
If you don't mind using Deshaker instead, it does a VERY good job of motion stabilization, if that is the only thing you need to do. I wrote a very detailed guide several years ago which you can find here:
http://www.sundancemediagroup.com/ar...aker_guide.htm It was then ripped off and posted at dozens of other places around the Internet, so you can easily find it elsewhere (in case you have problems linking to the above site). Just Google my name and "Deshaker." |
Thread Tools | Search this Thread |
Display Modes | |
|
|