Log in

View Full Version : Motion blur by decreasing FPS?


DrScotsman
15th October 2005, 17:07
First, my script:

ver = Imagesource("full.png").ConvertToRGB32.MSmooth(strength=7)

bg2 = Animate(0,15, "Crop", ver,0,ver.height-480,720,480, ver,0,7,720,480).Trim(0,15)
bg3 = Animate(0,2, "Crop", ver,0,7,720,480, ver,0,0,720,480).Deleteframe(0)

return bg2+bg3

If it's not obvious, this basically scrolls up an image I have, slows down, then stops.

The problem is, the video isn't very smooth. It's 30fps, and..well, see for yourself, here's the output:

http://www.nuticulus.net/drscotsman/trash/images/full.png - 670kB. Original PNG. Just here for the sake of it.
http://www.nuticulus.net/drscotsman/trash/scroll.avi - 260kB. It's XviD compressed, but the artifacts don't really affect the situation. No audio.

The original (aka, what I constructed the PNG from) appears to be 48p source converted to 60i, which I'd imagine would look pretty smooth on an NTSC TV.

To the point. Since it's using animate, theoretically I can have up to a framerate of infinity fps, which I assume increases the chance of a proper motion blur. So is there a plugin or script that'll create motion blur by greatly decreasing the framerate, WITHOUT ghosting? No motion compensation or anything fancy; I practically can get that by altering the animate script. My target framerate is either 24 or 30fps, but clearly the latter is preferable.

Thanks in advance.

foxyshadis
15th October 2005, 23:25
Well, motion blur is just a special kind of ghosting. I'd start with doubling the framerate and blending every other frame into one, with a 5/95% opacity ratio. From there increase the framerate, find the number of frames to blend in that leave the right size trails, and tweak the opacity for the best darkness.

I thought I remembered a motion blur plugin, but maybe it was just motion blur removal.

I think the real problem is that your slowdown happens too fast, it almost wants to bounce back up. You would need to slow it progressively; good camera stands come to a stop very fluidly. You'd need 5 or 6 animates (if not more) since they're too linear. Actually, you could probably nest an animate.

Something like:
bg = Animate(0,18, "Animate", 0,18, "Crop", ver,0,ver.height-480,720,480, ver,0,0,720,480, 0,18, "Crop", ver,0,0,720,480, ver,0,0,720,480).Trim(0,18)
Though you might need an even slower stretch at the end, since it should be more logarithmic than quadratic.

(Also that msmooth kills perf, if this is going to be any longer or done often you should smooth, save, and use that one.)

DrScotsman
16th October 2005, 00:39
Well what I did to the original source was recover all progressive frames I could, and then examine them. As it's a 48p to 60i conversion, I could get 12fps of progressive frames. I didn't exactly measure pixels, but it seemed that for frames 0-7 it was scrolling up at a constant speed, and frame 8 was when it reached the top. Instead of doing the smart thing and trying to make it look good, I tried to make it look the same as it did ;P

So what I guess I should do next is bob-deinterlace the interlaced frames to get a (crappy looking) 48p source and then examine that to get values for Animate, as opposed to using 12p. If it still lacks smoothness then I'll just concentrate on motion blurring.

http://www.nuticulus.net/drscotsman/trash/orig.avi <-- 6.1MB. Lossless original (YV12 HuffYUV, so it might only play in ffmpeg-based apps).

Just to compare, in my opinion the scrolling at the beginning (with constant speed) on my animated doesn't look (as) smooth, so while I see your point about a more progressive slow-down, I still think some sort of motion blur would help here. Admittadly I haven't watched the original on an NTSC/60Hz TV, but seeing how 50fps (PAL) is smooth, I'd assume 48 would be (albeit slightly jerky when converted to 60 =P).

Thanks for the advice.

EDIT: Ironically, after examining the original video (as in, converting it to a crappy looking 48p), not only does it seem to slow down very suddenly but it actually looks like it speeds up before it slows down. (I played it at 48fps as well as examining the frames closely and seeing how many pixels they had moved from the previous frame). I'm torn from between trying to actually make it look good and trying to make it look like the original =P