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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th June 2006, 00:37   #201  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
there will be A/V async.
remove assumfps and it will be okay.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 27th November 2006, 07:22   #202  |  Link
oddball
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)
But the frame moves up and down by mad amounts every few frames.

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)
Awwww crap. Just realised it did nothing to stop the up and down motion. Back to square one.

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.
oddball is offline   Reply With Quote
Old 27th November 2006, 08:45   #203  |  Link
oddball
Registered User
 
Join Date: Jan 2002
Posts: 1,264
Quote:
Originally Posted by Beave View Post
I'm getting closer to solving my problem. I used this script to first analyze only the bottom border:

mpeg2source("test_720p.d2v")
Trim(0,400)
i = ConvertToYV12()
j = ConvertToYV12().crop(0,712,-0,-0)
mdata = DePanEstimate(j,info=false)
DePanStabilize(i, data=mdata, dymax=1, dxmax=0, info=true)

Now I can see the data being diplayed on the video. the "dy" is either between -0.15 and +0.10 or between +0.25 and +0.55 when the video jumps. Now I now the values, but how do I translate that into my DePanStabilize function? So I have the sweet spot at around 0.18 and I want the picture to shift one pixel up when going over that threshold. How do I do that?

Thanks for the help in advance!

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.
oddball is offline   Reply With Quote
Old 27th November 2006, 19:32   #204  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
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.
Fizick is offline   Reply With Quote
Old 27th November 2006, 21:46   #205  |  Link
oddball
Registered User
 
Join Date: Jan 2002
Posts: 1,264
When I open up the Avisynth in Vdub I get an error.


Script error:depanestimate does not have a named argument "dx"

I am using 1.9.0. dx=0 does not work.

Last edited by oddball; 27th November 2006 at 21:51.
oddball is offline   Reply With Quote
Old 27th November 2006, 22:02   #206  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
NO WARRANTY

may be dxmax ? (I did not try it)
Fizick is offline   Reply With Quote
Old 27th November 2006, 22:50   #207  |  Link
oddball
Registered User
 
Join Date: Jan 2002
Posts: 1,264
Quote:
Originally Posted by Fizick View Post
NO WARRANTY

may be dxmax ? (I did not try it)
Hey it's your plugin lol

Oh well looks like the warranty is void. Depan simply cannot deal with small vertical movements. Thanks anyhow.

Last edited by oddball; 27th November 2006 at 22:57.
oddball is offline   Reply With Quote
Old 27th November 2006, 23:06   #208  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
I did not try that script right now...
(ones upon a time i tested similar)

what dy shift have you got?

Last edited by Fizick; 27th November 2006 at 23:08.
Fizick is offline   Reply With Quote
Old 27th November 2006, 23:20   #209  |  Link
oddball
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.
oddball is offline   Reply With Quote
Old 28th November 2006, 00:58   #210  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
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.
Fizick is offline   Reply With Quote
Old 28th November 2006, 03:10   #211  |  Link
oddball
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.
oddball is offline   Reply With Quote
Old 28th November 2006, 03:20   #212  |  Link
oddball
Registered User
 
Join Date: Jan 2002
Posts: 1,264
Would it be helpful if I uploaded a clip from the movie for you to look at?
oddball is offline   Reply With Quote
Old 28th November 2006, 06:34   #213  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
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.
Fizick is offline   Reply With Quote
Old 28th November 2006, 19:08   #214  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
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.
Fizick is offline   Reply With Quote
Old 28th November 2006, 19:26   #215  |  Link
AVIL
Registered User
 
Join Date: Nov 2004
Location: Spain
Posts: 408
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)
AVIL is offline   Reply With Quote
Old 20th November 2007, 22:44   #216  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
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.
scharfis_brain is offline   Reply With Quote
Old 5th December 2007, 04:33   #217  |  Link
odyssey
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.
odyssey is offline   Reply With Quote
Old 8th December 2007, 14:31   #218  |  Link
odyssey
Registered User
 
Join Date: Dec 2003
Posts: 155
Bump. Could someone please clear up my confusion in the last post?
odyssey is offline   Reply With Quote
Old 8th December 2007, 15:16   #219  |  Link
DarkT
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)
DarkT is offline   Reply With Quote
Old 8th December 2007, 22:24   #220  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
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."
johnmeyer is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.