View Full Version : Blending two frames
kakomu
6th December 2008, 04:07
I want to take a video clip and insert a blend between the previous and next frames. So, something like this:
ABCD would become AxByCzD
Where x is a blend between A and B and y is a blend between B and C, and so on.
I imagine that a combination of interlacing, deinterlace blending and interleaving could work, but I hope that someone might have a better idea or a dedicated filter to do something like that.
DoubleWeave() plus interleave?
Sagekilla
6th December 2008, 04:10
You mean you want to double the frame rate of a clip? Because that's what you're doing. MVTools already has a function (MVFlowFPS) that does this.
MVTools 1.x:
src = last
bvec = src.MVAnalyse(delta=1, isb=true, blksize=8, overlap=4, pel=2, idx=1)
fvec = src.MVAnalyse(delta=1, isb=false, blksize=8, overlap=4, pel=2, idx=1)
src.MVFlowFPS(bvec,fvec,num=yourFrameRate*2, idx=1)
kakomu
6th December 2008, 05:41
You mean you want to double the frame rate of a clip? Because that's what you're doing. MVTools already has a function (MVFlowFPS) that does this.
That's exactly what I want to do
MVTools 1.x:
src = last
bvec = src.MVAnalyse(delta=1, isb=true, blksize=8, overlap=4, pel=2, idx=1)
fvec = src.MVAnalyse(delta=1, isb=false, blksize=8, overlap=4, pel=2, idx=1)
src.MVFlowFPS(bvec,fvec,num=yourFrameRate*2, idx=1)
I've used this script before and it produced some undesirable artifacts. Mostly blocking on fast moving areas. I was hoping for a "dumb" blend.
kemuri-_9
6th December 2008, 06:16
src
ChangeFPS(last.framerate()*2) # double FPS
overlay(last.trim(1,0),mode="Blend",opacity=0.5) # dump blend
trim(0,last.framecount()-2) #trim off last frame (since it'll be a plain dupe)
should be dumb enough for what you're looking for
kakomu
6th December 2008, 07:01
src
ChangeFPS(last.framerate()*2) # double FPS
overlay(last.trim(1,0),mode="Blend",opacity=0.5) # dump blend
trim(0,last.framecount()-2) #trim off last frame (since it'll be a plain dupe)
should be dumb enough for what you're looking for
Thanks. I adjusted the opacity to .3 in order to make the preceding frame more apparent and have less flashing.
scharfis_brain
6th December 2008, 20:54
easiest way introducing a plugin motion.dll:
blendfps(framerate*2, aperture=1)
or without an external plugin:
interleave(last,merge(last,last.deleteframe(0)))
PeaceAnt
6th December 2008, 22:10
the easiest way is to use only one command:
convertfps (2*framerate)
pozdrawiam
scharfis_brain
6th December 2008, 22:26
are you sure that convertfps will really do what you want for this case?
I remember it will complain about too high destination framerates, or that it won't do blending for higher framerates.
PeaceAnt
6th December 2008, 22:53
i'm not sure but i use it very often and i didn't notice any problems with that.
pozdrawiam
vampiredom
6th December 2008, 23:22
BlendFPS() is only supports decimal framerates. So, if you want to preserve framerates such as 30000/1001, you'll need an AssumeFPS() afterwards. I've also noticed that it doesn't always play nicely with SetMTMode(), so look out for that if you are running MT.
Scharfi's interleave() method is probably the most efficient way to accomplish this.
Gavino
6th December 2008, 23:41
are you sure that convertfps will really do what you want for this case?
I remember it will complain about too high destination framerates, or that it won't do blending for higher framerates.
It's the other way round, it complains if you try to slow the rate down too much.
In blend mode, the new rate must not be less than 2/3 of the original rate.
scharfis_brain
7th December 2008, 00:19
I just tried it:
changefps(last.franerate()*2)
just duplicates frames. it does not blend them.
thetoof
7th December 2008, 00:30
convertfps blends, changefps duplicates
scharfis_brain
7th December 2008, 01:39
ah, sorry.
yes you are right, I did a copy'n'paste mistake and didn't look carefully enough before posting.
it seems that convertfps() will do the trick.
kemuri-_9
7th December 2008, 06:14
convertfps will generate something very similar (if not exactly the same...) to what i had provided earlier,
but since kakomu adjusted the opacity to .3,
it's no longer reproducible by simply doing convertfps()
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.