View Full Version : Replace all frames with MoComp
um3k
4th September 2008, 20:07
I've got a crazy idea. I was wondering, how would one go about making a script that replaces every frame of a video with a motion compensated interpolation of its neighbors. It's silly, I know, but I'd still like to give it a try. Thanks in advance!
g-force
4th September 2008, 22:36
backward_vectors = source.MVAnalyse(isb = true, truemotion=true, pel=2, delta=2, idx=1)
forward_vectors = source.MVAnalyse(isb = false, truemotion=true, pel=2, delta=2, idx=1)
source.MVFlowInter(backward_vectors, forward_vectors, time=50, ml=70, idx=1)
-G
Ranguvar
5th September 2008, 00:00
That's actually not a bad idea, to test how well new versions of MVTools work, and with which videos :)
um3k
5th September 2008, 16:51
Thanks, g-force. One thing I found is that in order to get the input and output clips to line up, you need to delay the output by one frame. I wonder why this would be? Other than that little oddity, it works fine.
Didée
5th September 2008, 17:30
Haven't tried it yet, but are you sure that g-force's script gives the correct result? For one, it doesn't use the frames current-1 / current+1, but instead it uses current-2 / current+2. More-far-away frames -> worse result. Then, is the result theoretically correct at all? MVTools' docs say that the vectors are used to create a frame at the temporal position [time/100]% between the current frame and the next frame. If the docs are correct, then with time=50, you would (should) not re-create a frame at an already existing temporal position, but rather at an 50% intermediate position.
But, perhaps that's the reason that g-force used delta=2, and this way things just work as expected ...
What I can say for sure is that I have done this already in MCBob, time ago. There, I split up the stream in two streams (even / odd), and created *two* MVFlow'ed streams, which subsequently get interleave'd again ... I'm very confident that MCBob's method give the correct result, and probably there was a reason to use this more complicated way ... ?
um3k
5th September 2008, 17:45
Honestly I have almost no idea what is going on in the script. Chances are you're right, Didée. Many of the frames in the output matched well, but some didn't. I'll mess around with the script some more and see what I get.
Didée
6th September 2008, 18:12
Suddenly it became clear, hiking in nature helps.
MVFlow/Inter create a frame between the current and the "next" frame with "next" according to "delta". Also, MVFlowInter internally has to offset the vector stream for "forward" vectors by "delta" frames.
Conclusion#1: g-force's script is fully correct. You just have to "DuplicateFrame(0)" or "SelectEvery(1,-1)" the result.
Conclusion#2: In the affected section, MCBob is unnecessary complicated, and thus spends too much ressources overall.
um3k
6th September 2008, 18:17
Oh, wow. So does this mean MCBob can be made a little faster? Good news! Thanks, again.
g-force
9th September 2008, 17:11
"g-force's" (my) script is just copied from the MVtools documentation. Didn't mean to pass it off as my own, but I've played around with this before, so I knew where to go (or who to copy from) ;)
Terka
10th September 2008, 09:08
is this affecting tempgauss also?
Didée
10th September 2008, 12:01
No. TempGaussMC uses discrete compensation, not MVFlow-like guesswork.
@ g-force: Oh, indeed! :o :D ... Usually I'm looking into the description of functions & parameters, not into the examples.:)
Undead Sega
11th September 2008, 04:28
Replace all frames with MoComp
sorry, u can call me stupid but i dont understand the logic behind this :(
Adub
11th September 2008, 09:01
It was just a "crazy idea". It doesn't have to be logical.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.