View Full Version : Slow Motion - interpolating frames?
adboehm
11th May 2004, 03:22
I'm trying to slow down some footage (of a car wheel turning) to around 300% of it's original duration. Most programs simply duplicate frames, but I want frames to be interpolated inbetween the real frames for it to be smooth (this is going to be the background of a DVD motion menu).
Is AVIsynth able to interpolate frames? Or is there a plugin for Virtualdub? After Effects has duplicating as default, and although it's help file mentions that it has "Enhancing time-altered motion by blending frames", it does not say how to enable this...
I submitted this topic at http://www.videohelp.com/forum/viewtopic.php?p=904711 a few days ago, but no answers yet :(
I think you mean to slow down to 30% of your original footage?
You can use the "ConvertFPS" function.
Try ChangeFPS and ConvertFPS and see the difference for yourself.(I assumed that the framerate is 25 fps)
violao
11th May 2004, 08:40
Originally posted by adboehm
Enhancing time-altered motion by blending frames...
There are a lot of ways to blend frames in Avisynth but you wouldn't like the results. Blending does not interpolate in a way you might expect - it doesn't move objects. So the results are more or less the same as with frame duplication. For blending you may try Trbarry's FrameDbl plugin, or a combination of internal Avisynth functions Overlay and TemporalSmoften and interleave the results with original clip.
For smooth motion you may need motion vector-aware frame duplicator, such as MotionPerfect (commercial SW), but it's results are far from ideal sometimes. You may also try new manao's motion.dll - check this thread (http://forum.doom9.org/showthread.php?s=&threadid=75523)
adboehm
11th May 2004, 09:00
Thanks you two, I'm looking into it :D
Manao
11th May 2004, 09:29
Download this one (http://www.geocities.com/manao47/Filters/mvtools-v0.9.zip) if you want to create intermediary frames.
Three issues for the moment with the filter as it is implemented yet :
- doubling the framerate is simple, tripling it is quite more tricky, and chossing an arbitrary framerate is not yet possible.
- the interpolated frame is blocky.
- You have to use Interleave to merge the source with the interpolated clip.
So, for doubling the framerate, I would recommend the following :inter = source.MVInterpolate(nb = 5,bl = 0.4, el = 0.6, wf = "hat")
return Interleave(inter,source)For tripling it, try the following : inter1 = source.MVInterpolate(nb = 5, bl = 0.6, el = 0.73, wf = "hat")
inter2 = source.MVInterpolate(nb = 5, bl = 0.27, el = 0.4, wf = "hat")
return Interleave(inter1,inter2,source)But as you'll see, if the motion seems good to the eyes, the blocks are quite boring. I would not recommend it yet.
adboehm
11th May 2004, 10:38
Thankyou!!! Although the visual qualtiy is not that good (it looks great when I've blurred it [virtualdub box blur] as a DVD menu motion background), here is my AVIsynth script to make the video 8x slower :D
DirectshowSource("scenebackground.avi")
bob # 25i to 50 frames/s
ConvertToYV12
FrameDbl(255,3) #100 fps / 2x frames
FrameDbl(255,3) #200 fps / 4x frames
FrameDbl(255,3) #400 fps / 8x frames
ConvertToYUY2
AssumeFPS(50) # 8x slower
SeparateFields.SelectEvery(4, 0, 3) # undo bob
Weave # interlace
scharfis_brain
11th May 2004, 10:44
for achieving better visual quality i recommend using at least dgbob(), or better kernelbob() instead of stupid bob().
btw. framedbl() is almost useless to my eyes.
interleave(last,overlay(last,last.trim(1,0),opacity=0.5))
does nearly the sane like framedbl()
violao
11th May 2004, 11:03
Originally posted by adboehm
it looks great when I've blurred it...
That's right, but now you have also blurred static parts and the effect is an "out-of-focus" clip. You better try motionblur or mvblur from manao's latest plugin. It attempts to blur only the moving parts of image. I would expect much better quality from it.
adboehm
12th May 2004, 01:08
The reason why I've blurred it is so that the foreground elements (24 different moving clips) of the motion menu are not detracted by this background. The out of focus nature of this background allows the contrast between foreground/background to be fine. I would however not recommend the 3xFrameDbl method, as it does result in stray motion pixels. It's a simple solution, and for me, it did the job. For the future though, it may not be enough...
atm mvtools-v0.9.zip is unavailable (too much bandwidth).. Must try later.
Manao
12th May 2004, 11:19
It's now available here :
http://jourdan.madism.org/~manao/
Quote: "Thankyou!!! Although the visual qualtiy is not that good (it looks great when I've blurred it [virtualdub box blur]"
Still out here experimenting, this time with "Mask Tools", DiViDee's "MPEG2DEC" bundel, and now "MVector" - Thank You, very much! I'm still plodding along with low tech methods, but having a lot of fun and getting some OK results as well..
Problem: Every time I turn around I am confronted with the fact that there is nothing like VirtualDub's fantastic BoxBlur internal filter!
Am aware of "Blur" in Avisynth as well as some convolution blurs, but there is nothing anywhere as useful in Avisynth as Box Blur.
Have been searching the Net off and on for months/years?, there might be a blur filter by Fish, but every link I find to his Page is dead. Can anyone confirm whether he has a blur filter. I also found one by PCVideo (both at Donald Graft's fantastic filter page) but it needs a separate dll in the VirtualDub directory and can't be opened with "LoadVirtualDubPlugin". Can't find any AviUtl filter plugins either that might work. Soooo...
I have a request, I know you are all busy with 1000 other important things, but wouldn't a Box Blur for AviSynth be a real asset and a splendid addition??? Would it be hard to take the code for the VirtualDub Box Blur turn it into "BoxBlur.vdf" and write a little script function so that we, hum, ha, I could load it in AviSynth???
OK, there is a workaround, I can open half my script and frame serve from VirtualDub back to AviSynth, but wouldn't a Box Blur in AviSynth be great!
Edit: The other work around is ReduceBy2.ReduceBy2.Blur(1).BiCubicResize(back to full res)
Manao
13th May 2004, 15:14
t_2 : why do you need so badly a boxblur filter ? What has it that make it so useful for you ? Because, with blur, you can almost do everything you want ( to increase the radius just chain several blur() together : blur(1).blur(1).blur(1) will give you a radius three blur )
Mug Funky
13th May 2004, 15:43
manao's yv12convolution can be used as a blur filter.
i've got a script for it. search for "gauss", and pick the most recent thread (masktools has been updated, but there's 2 versions of my script for it - one that works and one that doesn't :))
it has 2 modes - a fast one where the picture is bilinear resized down and bicubicresize(width,height,1,0) back up. and a more accurate one that feeds a sine curve to yv12convolution, giving a smooth blur that looks very similar to the fast blur :)
@Manao: I've tried "Blur" but never could get it to work nearly as well as VDub's BoxBlur. Also, when fine tuning maps it's really nice to have an interface in VirtualDub where one can set the filter in "realtime" and change the script accordingly.
@Mug Funky: Thanks, I hadn't heard of those methods, will have a look at them.
I will submit one of my crude MotionBlur scripts shortly. Still getting the bugs out of it.
Thank you all!
Manao
13th May 2004, 17:42
By the way, t_2, the "good way" of making a motion blur isn't by spatially blurring areas that are moving, but by temporaly blurring them.
My blurring filter doesn't suffer anymore from blocking, but I've yet to make the latest build available ( tomorrow I guess )
Mug Funky
13th May 2004, 18:13
no more blocking? WEEEEE!
i found it useful enough even with the blocking. you rock manao.
but i wont be able to test it for 3 weeks :(
(perhaps it'll be 3 weeks nicer by then, though that's hard to imagine as it's already super :))
scharfis_brain
13th May 2004, 22:24
but i wont be able to test it for 3 weeks :(
me too :(
I am only able to read & write here, but not to test since today :(
But your MoComp is great Manao!
quote: "By the way, t_2, the "good way" of making a motion blur isn't by spatially blurring areas that are moving, but by temporaly blurring them." -Manao
Yeah, I figured that out the hard way, my first function from a year ago blurred the motion areas, but my latest function only uses alpha to accomplish the temporal blurring in the motion areas, I need boxblur to improve blurring my alpha masks. As soon as I can get some links going of a few frame grabs I'll post them along with my script. I hope nobody laughs too hard.
By the way am looking forward to the latest build, 0.9.1 was a real improvement over the first version. I've only tested using the defaults.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.