slow motion

Hi

I need to slow down a video to 2.8% of it’s original speed. This will be more a less a frame per second, which is almost a slideshow. Then i want the transitions between the frames to be totally smooth, like with a linear interpolation (or linear crossfade) in such a way that the original frames only appear once (no repetition). I have played a bit with OF but nothing serious, so my question is how much difficult would this be, and how much time i would be looking into to get this going. Is it something easy to do or do I need to go deep into OF to do this ? Also any pointers on how to go about doing this ?

thanks
Miguel Negrão

what do you mean by, “in such a way that the original frames only appear once”? the only way to do a linear interpolation between video frames is by doing some very heavy maths: essentially, you have to identify and track motion in the frames leading up to this point using optical flow algorithms, which will basically give you information about which blocks of pixels are moving in which direction; you then apply that in slow motion. this is roughly how mpeg4 (h.264) compression works.

you might have some luck finding an open source h.264 implementation (eg x264, or perhaps mplayer, ffmpeg, or VLC) and using bits of that source. this will probably be quite hard… if you really want to dive in to this stuff, google ‘optical flow slow motion video site:citeseer.ist.psu.edu’ and start reading…

also, would you consider loading in an image sequence instead of a movie? it can be quite easy to cross fade between images if you load them into an array… - zach

I’ve done the “cross fade between frames” method and it works really well for certain kinds of footage, obviously if you have very large changes from image to image it looks odd.

For instance slowing down a short clip of me shaking my head from side to side really quickly looked ok, while slowing down a clip of me waving my hand from side to side less so as the the hand moved quite a lot from frame to frame.

It looks wierd in a good way though so it’s definitely worth a try :slight_smile:

If all you want to do is a crossfade, the easiest way would probably be using two textures on top of one another and setting their alpha values:

set current frame’s alpha to 1
set next frame’s alpha to framesSinceLastFrameChange/framesBetweenChanges

This will fade the next image in smoothly. Then just advance to the next two frames once you’re done with that fade.

It’s a one minute abstract video feedback clip that i want to stretch to 30 minutes or more. I think linear crossfade is enough, i don’t neet movement tracking, since frames are very much different, sometimes going from full white to full black. I have the frames also as bmp images in a folder if that is easier.
I have tried using final cut pro and compressor, and can’t get it right because it always stops a second or so in each of the original frames, which gives it a slideshow look, and doesn’t look smoth. funny enough while previewing, final cut does not do this, it’s smooth.
So i guess i should follow dirListExample to load the images and then to do the cross fade with two textures right ? I’ll try that.

thanks
Miguel

[quote author=“Tim S”]If all you want to do is a crossfade, the easiest way would probably be using two textures on top of one another and setting their alpha values:

set current frame’s alpha to 1
set next frame’s alpha to framesSinceLastFrameChange/framesBetweenChanges

This will fade the next image in smoothly. Then just advance to the next two frames once you’re done with that fade.[/quote]