Log in

View Full Version : GenMotion and DePan plugins for global motion compensation


Pages : [1] 2 3 4 5 6 7

Fizick
13th December 2003, 04:29
GenMotion - General Motion Compensation
C-Plugin for Avisynth 2.5
http://bag.hotmail.ru

This plugin makes general motion compensation (generates a motion),
using ready-made general motion estimation data.
As a such data, the filter uses a log file of Deshaker VirtualDub plugin (by Gunnar Thalin).
This plugin may be used for:
- simple partial motion stabilization (not as good as Deshaker);
- motion compensation for strong temporal denoising and clip (film) restoration.

P.S. Now I know: correct English word is GLOBAL, not GENERAL. :rolleyes:

P.P.S. The GenMotion plugin is now obsolete and not supported.

Now I release once more similar plugin! :devil:
It has got name DePan - tools for estimation and compensation of global motion (pan).
The DePan plugin replaces my slow experimental GenMotion C-plugin.
DePan is native Avisynth 2.5 plugin.
The DePan works without Deshaker, in one pass, has many options.
See posts at page 3 and below.
The download URL (see depan link)

http://bag.hotmail.ru

morsa
13th December 2003, 04:34
Fizick read this post


http://forum.doom9.org/showthread.php?s=&threadid=66682


I guess you are getting to something good!!

Mango Madness
16th December 2003, 16:56
though I haven't tried it out yet, the process seems a little cumbersome. Would it be possible to write a tool to automate some of the process?

Fizick
17th December 2003, 21:37
May be, it is possible to load Deshaker in avisynth.
But I dont know how.

Mango Madness
18th December 2003, 11:57
it's in the included avisynth documentation concerning how to import vdub filters.

Fizick
28th December 2003, 02:20
New version 0.5, 28 December 2003 - corrected formula for delta<0 (thanks to Gunnar Thalin), some bugs fixed

Kintaro
1st January 2004, 19:57
I never heard of deshaker before, and was pretty amazed when trying it for the first time. Unfortunaly the vdub filter works MUCH better compared to GenMotion, and so I tried importing it. Whenever Im importing it vdub crashes instantly, and Im not good enough to know whats wrong


function VD_DeShaker(clip "clip", int "xy", int "mode", int "block_size", int "differential_search_range",
\ float "source_pixel_ar", int float "source_pixel_ar_preset", float "destination_pixel_ar",
\ int "destination_pixel_ar_preset", int "dest_width", int "dest_heigth", int "scale", int "use_pixels",
\ int "color_mode", int "motionsmooth_horp", int "motionsmooth_verp", int "motionsmooth_rota",
\ int "motionsmooth_zoom", int "move_wrong_direction", int "video_output", int "edge_compensation",
\ int "resampling", int "skip_if_blocks_ok", int "initial_search_range", int "discard_match_value",
\ int "discard_2nd_best_match",
\ string "logfile", bool "append_log", bool "ignore_image_area_out", int "ignore_out_l", int "ignore_out_r",
\ int "ignore_out_t", int "ignore_out_b", bool "ignore_image_area_in", int "ignore_in_l", int "ignore_in_r",
\ int "ignore_in_t", int "ignore_in_b", int "video_type_a", int "video_type_b", float "extra_zoom",
\ int "maxcorrect_horp", int "maxcorrect_verp", int "maxcorrect_rota", int "maxcorrect_zoom",
\ bool "use_previous_to_fill", bool "use_future_to_fill", int "previous_frames", int "future_frames",
\ bool "let_area_follow_motion"){
LoadVirtualDubPlugin(VirtualDub_plugin_directory+"\Deshaker.vdf","_VD_DeShaker",1)
return clip._VD_DeShaker(default(xy,4), default(mode,1), default(block_size,30),
\ default(differential_search_range,4), default(source_pixel_ar,1), default(source_pixel_ar_preset,0),
\ default(destination_pixel_ar,1), default(destination_pixel_ar_preset,0), default(dest_width,640),
\ default(dest_heigth,480), default(scale,1), default(use_pixels,2), default(color_mode,1),
\ default(motionsmooth_horp,400), default(motionsmooth_verp,400), default(motionsmooth_rota,400),
\ default(motionsmooth_zoom,1500), default(move_wrong_direction,4), default(video_output,1),
\ default(edge_compensation,0), default(resampling,2), default(skip_if_blocks_ok,5),
\ default(initial_search_range,40), default(discard_match_value,300), default(discard_2nd_best_match,4),
\ default(logfile,"C:\deshaker.log"), default(append_log,false) ?1:0, default(ignore_image_area_out,false) ?1:0,
\ default(ignore_out_l,0), default(ignore_out_r,0), default(ignore_out_t,0), default(ignore_out_b,0),
\ default(ignore_image_area_in,false) ?1:0, default(ignore_in_l,0), default(ignore_in_r,0), default(ignore_in_t,0),
\ default(ignore_in_b,0), default(video_type_a,0), default(video_type_b,0), default(extra_zoom,1),
\ default(maxcorrect_horp,15), default(maxcorrect_verp,15), default(maxcorrect_rota,5),
\ default(maxcorrect_zoom,15), default(use_previous_to_fill,false) ?1:0, default(use_future_to_fill,false) ?1:0,
\ default(previous_frames,30), default(future_frames,30), default(let_area_follow_motion,false) ?1:0)
}


please help me out :)

Kintaro
2nd January 2004, 10:56
after sleeping ovet it I just found this evil little thing
\ float "source_pixel_ar", int float "source_pixel_ar_preset",
now its not causing crashes anymore, but Im getting invalid arguments error. any ideas?


edit:
somehow seems to me like this filter is incompatible, even when Im just using the parameter from vdub it says invalid arguments :/

function VD_DeShaker(clip clip){
LoadVirtualDubPlugin(VirtualDub_plugin_directory+"\Deshaker.vdf","_VD_DeShaker")
return clip._VD_DeShaker(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)
}

hit me if Im doing something wrong :D

Fizick
5th April 2004, 05:54
New version Genmotion 0.6, 05 April 2004 - add bicubic interpolation (set as default), add grey parameter, remove deflick, correct first and last frame calculation, some reorganization, some speed optimization, use Avisynth C version 0.15, released with source under GNU GPL 2

SoonUDie
5th April 2004, 13:54
Fizick, is it possible to turn this into a one-pass plugin? It seems that the deshaker code is closed-source, so you'd have to figure out your own method of getting the motion vectors... but once you do, 1-pass would be relatively easy to do: calculate motion vectors for each cut, then apply the compensation, then move on to the next cut...

Also, I have an idea I've been toying around with for a while - a temporally-based resizer. Perharps you would be interested in coding it? You start out by motion-compensating a scene with sub-pixel accuracy, and output at 200 percent original size. Then, you give unique pixels (the ones obtained through motion compensation) priority over interpolated pixels, because they contain real detail. You can do this because "unique" pixels will not directly overlap from frame to frame; in the best-case scenario of a 1/2 pixel accuracy version, you would be overlaying an image like this:
1 i 2
i i i
3 i 4

Onto an image like this:
i 5 i
6 i 7
i 8 i

to get the final image
1 5 2
6 i 7
3 8 4

Where the numbered pixels are all non-interpolated.

It's not exactly that simple, but I'm sure you get the jist of it.

SoonUDie
6th April 2004, 08:33
The 0.6 zip file appears to be corrupted (after re-downloading 3 times...).

Fizick
6th April 2004, 19:06
to SoonUdie:
1. temporally-based resizer is some interesting (but not for me right now)
2. Now I try to made one-pass plugin. (I have alfa version).
3. My download quite fine. Anybody else ?
(I can send it by e-mail, if you want. My e-mail is on my WWW).

SoonUDie
6th April 2004, 22:56
It turned out that the file I kept downloading was an html file renamed as a zip file. I think it is a problem with the file host.

You may want to change the link to this:
http://www7.newmail.ru/messages/file.dhtml?file=bag.hotmail.ru/genmotion/genmotion06.zip

kassandro
7th April 2004, 08:24
Fizick,
as I can see from the source code of your plugin. The motion information retrieved from the deshaker log file is only 16 bytes per frame (or more precisely per field). Of course, to "deshake" a clip only global motion information is of interest. On the other xvid has a much more sophisticated motion compensation algorithm which is local and not global in nature. If you could transfer this part of xvid to your plugin it could perhaps be improved significantly and may be even faster.

SoonUDie
7th April 2004, 09:07
An intersting idea Kassandro, but what would you do on a more local level? Once the camera's been corrected for, what's left?

Perharps, after determining the global motion, the relative motion of macroblocks could be zeroed if under a certain value, potentially increasing compressibility.

... but in any case, I consider full-screen deshaking more important, as you can take care of most other temporal issues with a simple temporalSoften().

kassandro
7th April 2004, 11:26
Originally posted by SoonUDie
... but in any case, I consider full-screen deshaking more important, as you can take care of most other temporal issues with a simple temporalSoften().
You certainly did have this thought in mind, when you layed out your temporal resizer. For it you really want to exploit any motion information, to keep normal interpolation at a minimum.

Fizick
7th April 2004, 21:13
Kassanro,
I know about the one attempt to use the local motion algorithm from XVID.
Manao make a draft of such plugin.
http://atlas2.tgv.net/~media-video/forum2/viewtopic.php?t=3778&sid=03066b1d2f0d7f57e8f40bb956da64e2

(French forum)

I try it. The motion vector quality is not very good.

For my old 8 mm kino film, the most important is camera pan.
Of cource, it is not universal.

But good result may be by combining global motion plugin and local motion plugin (DUST).

Manao
7th April 2004, 22:55
I'm working on it : the motion estimation is now slightly better than Xvid's one, because I use more predictors than they do. It's much slower though.

I'm currently trying to make the code cleaner, and I don't know yet when I'll be able to release something usable.

SoonUDie
8th April 2004, 09:35
One suggestion for improvement: Can you add parameters for max variatians? I've found that Deshaker can be very bad at detecting rotation in motion scenes, so I'd rather just leave it out. I wrote a program to zero the information in the log files, and it worked out well - almost no visual change in low-motion scenes as compared to using rotation, and no problems with artificially introduced rotation. However, it would be much simpler if you could just turn off rotation in the filter.

Fizick
8th April 2004, 20:30
O.K., GenMotion version 0.7 is released :

Add parameters dxmax, dymax, rotmax, zoommax.

dxmax - maximum value of x shift in motion data, (default = 100),
dymax - maximum value of y shift in motion data, (default = 50),
rotmax - maximum value of rotation (degree) in motion data, (default = 5),
zoommax - maximum value of zoom in motion data, (default = 1.2),
(if any above max parameter is positive, the motion data value will be limited to it,
if negative, the motion data value will be reseted to null )

P.S. tested very little - try.

morsa
9th April 2004, 11:16
Well, somebody tell me I'm terribly wrong, please.
I guess, seeing that a good motion estimation is on its way, that in a relative near future we will have the possibility of making a good frame synthesizer.Is it OK?

SoonUDie
9th April 2004, 12:22
Originally posted by morsa
Well, somebody tell me I'm terribly wrong, please.
I guess, seeing that a good motion estimation is on its way, that in a relative near future we will have the possibility of making a good frame synthesizer.Is it OK?
If what you mean is that we'll be able to accurately interpolate any framerate, then yes... and no. I believe some very good solutions already exist... however, they're many hundreds of dollars. The key is to relatively accurately find motion vectors for every pixel in the image.

However, while we could interpolate something like a 24FPS movie to 60FPS, how much do we really gain? We're not really re-creating the motion here... it's like taking an antiderivative - you have a +c floating around, and we don't know what that is.

For example, take the motion of a really fast moving ball. If we capture it at 30fps, it'll be a blur. At 60fps, it will be more like a ball, but still blurry. At 120fps, it'll look even more like a ball. Now let's say we interpolate that 30fps video up to 120fps. It won't look like a ball - you'll still have the blury 30fps picture - but it'll move 4x smoother: it'll traverse only 1/4 the pixels per frame as it did before.

I'd still like to see it happen, though, and preferably in real time - we live in a world where 60p is finally becoming the standard, and I'm starting to get tired of 24fps...

morsa
9th April 2004, 12:47
Nice answer :)
One idea I have would be to use it to recover lost frames, may be 2 or three in a row, or to convert from 24 fps to 30, 25 to 30, or better, 50 fields to 60...Who knows, there are so many options.....

mf
9th April 2004, 13:16
Most interesting is to synthesize frames that are in an odd position between frames, e.g. convert 30fps to 24fps, without blending.

Fizick
9th April 2004, 17:21
1. MF answer is nice, but not quite correct. ;)
If we capture fast moving ball at 30fps, it'll NOT must be a blur.
Camera's (camcorder) frame shooting time (exposition) is dependent on record mode ("normal", "sport", "golf"). This time of course is not large than 1/fps (1/60 sec), but may be quite small for bright scenes (up to 1/2000 sec). The fast moving ball may be quite sharp, and framerate interpolation (with motion compensation) will be sharp too.

2. GenMotion may be used, for example, to change framerate with factor=1.5, from 16.6 fps (old 8 mm film) to 25 fps.

Script:

Avisource("kino.avi")
loadplugin("avisynth_c.dll")
converttoYV12()
loadCplugin("genmotion.dll")
i=ConvertToYV12()
f1_3=GenMotion(i,filename="c:\deshaker.log",delta=1./3)
b1_3=GenMotion(i,filename="c:\deshaker.log",delta=-1./3)
interleave(f1_3,i,b1_3)
selectevery(6,0,1,2)
Crop(48,32,720-48-32,576-32-32).AddBorders(48,32,32,32)
converttoYUY2()

SoonUDie
9th April 2004, 19:26
Originally posted by Fizick
If we capture fast moving ball at 30fps, it'll NOT must be a blur.
Yea, I was just using that as an example. Besides, any object of any speed will have varying motion blur depending on how close it is to the camera. For the sake of the example, please assume that it is fast enough / close enough that it is simply a blurred streak.

Even then, I believe what I said still holds - you're not actually recreating temporal detail; you're simply morphing objects into a spot that is inbetween the real frames.. If you wanted to more accurately recreate the detail, you'd need to perform some serious "un-motion-blurring" in addition to frame interpolation.

morsa
9th April 2004, 22:52
SoonUdie.
You are completely right, but I was just talking about a normal situation.Everybody knows a filter doesn't performs 100% OK with every situation, if this were the case what would you and I be doing here? :D
Anyway all of the really pro, really expensive software packages have the same limitations.That's why they ask the user to use high shutters.

morsa
19th April 2004, 11:26
I was wondering if I could use this approach to go from a 30p video clip to 60i to end with a 24p version of it.
I don't know how to set delta to get a double framerate from genmotion, so I could interleave the frames and obtain a 60i video.
Then I would use Scharfish's script to go from 60i to 24p.I'm sure this should work (although it won't be fast or easy) but I've got problems getting the correct params.My clip is from a JVC HD10U camcorder 1280x720.

scharfis_brain
19th April 2004, 11:53
@morsa. I've never used genmotion.
but why not going to 120fps and then doing a 1 out of 5 selection.
this would IMO be better than 60fps an then alternate blending (2x / 3x / 2x /3x ....)

morsa
19th April 2004, 12:15
Great idea!!
So now the question would be: How can I go from 30p to 120p with genmotion?

scharfis_brain
19th April 2004, 13:07
okay, after 10 minutes of testing, I've got running a framerate-doubler:

# script to create doubled frameratewith genmotion

loadplugin("C:\x\avisynth_c.dll")
loadCplugin("c:\x\genmotion.dll")
avisource("30p.avi")
i=converttoyv12()


f=GenMotion(i,filename="c:\deshaker.log",delta=0.5).trim(1,0)
b=GenMotion(i,filename="c:\deshaker.log",delta=-0.5)

# mix fwd. and bckwd. compensation
g=overlay(f,b,opacity=0.5)

# make a 50:50 blend of the input
g1=overlay(i,i.trim(1,0),opacity=0.5)

# mix the blended input into the compensated video to achieve some kind of stability
g2=overlay(g,g1,opacity=0.3)

#double the framerate
interleave(i,g2)

#if the output of the interpolated frames is to bluury, try to reduce the 2nd opacity=0.3 value, or use
#interleave(i,g)

I'll post a quadrupler, when I am coming back from work (about 12hrs.)

and I think, we can nail static items in the video, so they aren't compemnsated, thus resultingin jittery station logos etc.
this would require introducing motionmasking with some tricks.

scharfis_brain
20th April 2004, 01:35
okay, the quadrupler has to wait.

For now, I've made a motioncompensator giving you a mostly clean output, avoiding swimming static parts of the video (TV-Station logos)
and avoiding false blending in differential motioned areas.
in both cases those affected areas are replaced with a blended clip of the neighboring frames.

this means:
a pan will be super-smooth.
a ball flying through the video while the panning occurs will have some kind of stutter, because it is NOT motioncompensated.

setmemorymax(256)
# script to create doubled framerate with genmotion
# while avoiding swimming static parts and false motion generated by genmotion

loadplugin("C:\x\masktools.dll")
loadplugin("C:\x\avisynth_c.dll")
loadCplugin("c:\x\genmotion.dll")

avisource("30p.avi")
i=converttoyv12()

th=7 #threshold for static detection
th1=7 #threshold of false-motion detection

#lower those thresholds for lesser repairing


#generate statice mask
i1=motionmask(i,thy1=th1,thy2=th1,thsd=255)


# make motion global compensation of the video
f=GenMotion(i,filename="c:\deshaker.log",delta=0.5).trim(1,0)
b=GenMotion(i,filename="c:\deshaker.log",delta=-0.5)

# motion compensate the static-parts-mask
f1=GenMotion(i1,filename="c:\deshaker.log",delta=0.5).trim(1,0)
b1=GenMotion(i1,filename="c:\deshaker.log",delta=-0.5)


# mix fwd. and bckwd. compensation
g=overlay(f,b,opacity=0.5)

# mix the motioncompensated masks
g1=logic(f1,b1,mode="And")

#generate a falsemotionmask
g2=interleave(f,b).motionmask(thy1=th,thy2=th,thsd=255).selectodd().binarize().duplicateframe(0)

#merge static and false mask
g3=logic(g1,g2,mode="and") .blur(1).blur(1).binarize(threshold=1,upper=false)

# genrate blended clip out of the input to repair swimming static parts and false generated motion
h=overlay(i,i.trim(1,0),opacity=0.5)

# repair genmotion's output
j=overlay(h,g,mask=g3)


# for vis.
ih=interleave(i,h)
ig=interleave(i,g)
ij=interleave(i,j)
a=stackhorizontal(ih,ig)
b=stackhorizontal(ij,interleave(g1,g1))
stackvertical(a,b)

#stackhorizontal(g2,g1,g3)

#output the final clip
ij


my next ideas (after the quadrupler) will be:

NTSC <-> PAL conversion using this approach.
It will give super smooth pans without this annoying blending-motion on borders. while differnetial motion is converted via the standard blending method.
this will need a framerate 5 times as high as the input framerate for a NSTC -> PAL conversion.
and a framerate 6 times as high as the input framerate for a PAL -> NTSC conversion.

morsa
20th April 2004, 07:14
But I just wanted a converter from 30p to 24p :(
(just kidding)But in fact I just wanted that so the 120 fps approach should be fine for me, I guess......:rolleyes:

scharfis_brain
20th April 2004, 09:33
Yes. You have to wait a little bit.
I have to restructurize my script, to do quad framerate.

this needs 3 times more motioncompensation!

morsa
20th April 2004, 10:03
Thank you, really:thanks:

scharfis_brain
20th April 2004, 11:43
function mocomp(clip i, float amount, string file, int "th", int "th1",bool "vis")
{
th=default(th,7)
th1=default(th1,7)
vis=default(vis,false)

#generate static-area mask
im=motionmask(i,thy1=th1,thy2=th1,thsd=255)

# make motion global compensation of the video
i2f=GenMotion(i,filename=file,delta=amount).trim(1,0)
i2b=GenMotion(i,filename=file,delta=amount-1)

# motion compensate the static-parts-mask
i2fm=GenMotion(im,filename=file,delta=amount).trim(1,0)
i2bm=GenMotion(im,filename=file,delta=amount-1)


# mix fwd. and bckwd. compensation
g2=overlay(i2f,i2b,opacity=amount)
g2= vis ? g2.coloryuv(gain_u=48) : g2

# mix the motioncompensated masks
g2m=logic(i2fm,i2bm,mode="And")

#generate a falsemotionmask
g2mm=interleave(i2f,i2b).motionmask(thy1=th,thy2=th,thsd=255).selectodd().binarize().duplicateframe(0)

#merge static and false mask
g2mmm=logic(g2m,g2mm,mode="and").blur(1).blur(1).binarize(threshold=1,upper=false)

# genrate blended clip out of the input to repair swimming static parts and false generated motion
g2bl=overlay(i,i.trim(1,0),opacity=amount)
g2bl= vis ? g2bl.coloryuv(gain_v=48) : g2bl

# repair genmotion's output
g2rep=overlay(g2bl,g2,mask=g2mmm)
g2rep= vis ? g2rep.subtitle(string(amount)) : g2rep

return g2rep
}

this is the new motencompensation function

amount: float value between 0 and 1.
0 returns curr. frame
1 returns next frame
0.5 returns inbetween frame
0.25 the frame between 0 and 0.5
(and so on)

file: string to the location the deshaker.log (or whatever it is called)

th: int for false motion (differential motion) detection

th1: int for static area detection

vis: enable visualization
blue - motion compensated
red - blended (repaired areas)

usage:

general:
loadplugin("C:\x\masktools.dll")
loadplugin("C:\x\avisynth_c.dll")
loadCplugin("c:\x\genmotion.dll")

avisource("30p.avi")
i=converttoyv12()

possibilities:

framerate doubler:
i1=i
i2=i.mocomp(0.50,"c:\deshaker.log")
interleave(i1,i2)


framerate quadrupler:
i1=i
i2=i.mocomp(0.25,"c:\deshaker.log")
i3=i.mocomp(0.50,"c:\deshaker.log")
i4=i.mocomp(0.75,"c:\deshaker.log")

interleave(i1,i2,i3,i4)

30p to 24p conversion:
i1=i
i2=i.mocomp(0.25,"c:\deshaker.log")
i3=i.mocomp(0.50,"c:\deshaker.log")
i4=i.mocomp(0.75,"c:\deshaker.log")

interleave(i1,i2,i3,i4)

selectevery(5,1)

hope that helps.

morsa
21st April 2004, 09:05
Amazing results!!
I can't believe what I'm seeing came from 30p.Almost perfect to my eye:)
Although it has a little ghosting sometimes in sensitive areas as people heads with white hats more or less near the camera...

scharfis_brain
21st April 2004, 10:21
ghosting (or blending, to avoid stutter) is only present in areas with differntial motion.

but it is better live with little blending in those areas instead of haven frames full blended.

even a NTSC<->PAL conversion using this thingie is looking very smooth to me, no more annoying backward/forward motion on borders due to blending :)

theorethical:

NTSC to PAL

i1=i
i2=i.mocomp(0.2,"c:\deshaker.log")
i3=i.mocomp(0.4,"c:\deshaker.log")
i4=i.mocomp(0.6,"c:\deshaker.log")
i5=i.mocomp(0.8,"c:\deshaker.log")
interleave(i1,i2,i3,i4,i5)
changefps(50) #NO convertfps here! it will destroy the image

PAL to NTSC

i1=i
i2=i.mocomp(0.167,"c:\deshaker.log")
i3=i.mocomp(0.333,"c:\deshaker.log")
i4=i.mocomp(0.500,"c:\deshaker.log")
i5=i.mocomp(0.667,"c:\deshaker.log")
i6=i.mocomp(0.833,"c:\deshaker.log")

interleave(i1,i2,i3,i4,i5,i6)
changefps(59.94) #NO convertfps here! it will destroy the image

in practice, we first need to deinterlace the Video (maybe using motioncompensation using genmotion) and later reinterlace it.

I'll try to make a complete conversion fuction out of it.

scharfis_brain
21st April 2004, 11:00
@ fizick:
feature request:

could you add something like a forceprogressive-flag?

I want to fullframerate deinterlace a given video. and then do the motioncompensation.

with the current version of genmotion I only get the fields compensaten, not the whole frame.

this means, the number in the log file should be treated like progressive:

laced -> progressive
0B -> 0
1A -> 1
1B -> 2
2A -> 3
2B -> 4
3A -> 5
3B -> 6

would that be possible?

only this modification would it make possible to work without intermediate files when trying to do a standards conversion using genmotion.

Fizick
21st April 2004, 21:30
1. I very soon want release a new plugin for global motion compensation,
written from scratch, which will work without Deshaker.
This work take my time.
In have alpha version.

2. About force-progressive, i am not understand you:
Do you want compensate odd field to next odd,
and even to next even?

scharfis_brain
22nd April 2004, 05:20
1) kewl! does this work in 1-pass ?

2) okay, I'll try to explain it:

- lets assume I have a made bobbed (50fps or 59.94 fps) Video out of my interlaced content.
- this bobbed video gets analysed by deshaker.
- deshaker is creating a (progressive) logfile.

- then I can do my motioncompensation in avisynth with a bobbed video to my wishes using genmotion.

but I want to pass by the first three step. I want to feed deshaker with the interlaced video (thus creating an interlaced logfile), and then want to use genmotion on the bobbed (double framerate, progressive) version of the video.

Fizick
23rd April 2004, 04:41
1. Yes (but i do not know what is "kewl" ;) )

2. I answer later.

scharfis_brain
23rd April 2004, 10:32
kewl = cool

same pronunciation, hehe

Didée
23rd April 2004, 11:07
Originally posted by scharfis_brain
kewl = cool

same pronunciation, hehe
Not quite the same.

cool = [ku:l]
kewl = [kju:l]

;)

scharfis_brain
23rd April 2004, 11:11
Okay, next time:

k(-j)ewl

scharfis_brain
23rd April 2004, 15:22
fizick, if your new version of genmotion supports onepass gmc'ing,would this be some kind of master/slave structure?


some pseudoicode:

one=avisource("one.avi")
two=avisource("two.avi")
x=one.genmotion(analyse=true) #where x is a variable containing movement information
output=two.genmotion(analyse=false,motiondata=x)


this means, I want to use the motioninformation of video one to move video two.

this is easily possible with the current 2-pass method, but would that be possible with your next version?

SoonUDie
23rd April 2004, 19:39
Originally posted by scharfis_brain
this is easily possible with the current 2-pass method, but would that be possible with your next version? I hope it is. It shouldn't be hard, fox example, to have the motion information from the first clip stored in a logfile like deShaker (except the file is generated at run-time).

Fizick
23rd April 2004, 23:54
Yes, master and slave (or slaves).

SoonUDie
24th April 2004, 00:27
Originally posted by Fizick
Yes, master and slave (or slaves). Tsk tsk! That's not politically correct anymore in Los Angeles, where I am. The correct terms are primary and secondary.

(this is a joke!)

Fizick
24th April 2004, 23:36
O.K., I release new plugin. It has got name DePan -
tools for estimation and compensation of global motion (pan).
The DePan plugin must replace my experimental GenMotion C-plugin
(which uses motion data from VirtualDub Deshaker plugin log file).
The DePan works in one pass, but consist of server part (function)
and one or more clients parts (functions or its instances).
The server function estimates frames motion data and gives it to client functions on inquiry.

(to SoonUDie: I not quite understand you joke, but decided to use other, safe terminology :D )

Current version of DePan uses a special service clip as the motion data container.

DePan plugin functions:
DePanEstimate (server) - estimates frames global motion data and write it to special service clip
DePan (client) - make full or partial global motion compensation
DePanInterleave (client) - generates long motion compensated interleaved clip
DePanStabilize (client) - makes some motion stabilization

GenMotion() function is new DePan() function.
Note. The "offset" parameter of DePan() is extended version of "delta" parameter of GenMotion().

Features and limitations of current version of DePan plugin
1. Works only in YV12 color format.
2. Uses only pan motion (no zoom, rotation), but it gives advance in speed and stability.
3. The source clip must be same length as motion data clip.
4. Directly works only with progressive clips.
For interlaced sources, you must use Avisynth function SeparateFields,
with followed optional AssumeTFF, and following Weave (after motion compensation and denoising)
Plugin estimates and calculates motion from one field to neighbour (by time) field (from same or neighbour frame).
5. Not very fast, not assembler optimized.

You may download it from my site (link is on first page of thread).
It has beta (may be alpha) status.
Please, test all its bugs (i know some) and report to here.