Hi res video playback questions. performance tips/tricks for realtime jumps

Hi all,
I’d like to be able to control a video, and change very fast to different points in time. The reads will be almost exclusively of consecutive frames, but not necessarily ordered in an ascending way (go from second 0 to second 10,stop. go from second 10 to second 7, stop. go from second 7 to second 20, stop, etc).

I did some research and prototyping in processing, but playback of high resolution videos with jumps is impossible, the speed is awful. Totally unusable, and for what they tell me at the forums, there’s nothing I can do to solve that.

What’s the recommended way of doing that (speed is essential) in vvvv? Do you think I can achieve a good performance? What should be the issues and techniques, etc, i should take into account?

I don’t know yet about the resolution of the video but I’m aiming at 640x480 or higher in order to get a “decent” image when projected on a wall.

Thanks!

first question is the look of your content, is it graphical stuff or real world pictures with lots of colors? another question is the total lenght of the video, how many frames? the premium method is to load every frame as a picture into the RAM, then you can do everything you want with any speed.

but if your video is too long, you have to use the right codec and you have to make sure that you have keyframes on the positions (join the encoded video parts together for example) you want to jump at. reverse playing will not be possible. but a workaround is to join a reverse verion of your video at the end and play this if neccesary…

so whats your content, how long is it?

Thanks tom for your reply.

My content is a video of real world footage, so yes, lots of colors. Length, i’m not sure yet, but something between 1000 and 4000 frames (i’m still researching regarding that). I guess that loading to the ram would be quite expensive, i don’t know what you think, but it definitely sounds tempting. I would be willing to sacrify a bit on the amount of frames if that would ensure a smooth playback. In fact, my source footage is a collection of pictures, not a video, so that could be an option. How do I go about doing that on vvvv?

As for the codec (if i go for the video way instead of loading every frame as a different picture), for what i’ve read here i should use midivid or indeo with every frame as keyframe, right? I don’t know where it’ll jump (there are no “fixed” places to jump to set the keyframes), as that will depend on user input, so it could be anywhere.

What worries me is what you say regarding that there’s no backward playback. That’s a real problem for what I want to do. Unless I loaded every frame as you suggested as a picture in ram, and then I coul just display whatever frame I want, right?

If your playing 1 layer, and have a decent hardrive, 720x576 picvideo will jump from frame to frame near instantly, just bang the do seek pin, its advisable to set the playback pin to 0 when you do seek which is easy enough, it just stops vvvv trying to pay and jump in the same frame.
If you need to jump and pause on the frame, its even easier!

Exactly, i need to jump from the current frame x to x+y or x-y and stop there.

This will be my first patch ever, could you elaborate a bit more regarding the playback pin and such?

I’m reading the documentation right now, and I’m trying to get my head around the object model of vvvv. It seems the way to do this is with the FileStream node connected to a VideoOut, right?

Heres a starter for ten…

The playback pin just makes the avi file play, as you dont need it, you dont need to worry about it yet!
But to explain, if the playback pin is set to 1 and you do seek at the same time, performance is a little worse, so if you need instant switching, you would need to set it to 0 in the frame you doseek in (which isnt that hard, just something to bear in mind!)

JumpAround.v4p (4.3 kB)

I dont wont to confuse you, but Ill give you a second way if you dont get your performance needs.

There is a VJ prog, free, from Weimar :P and specialized for that scratching video stuff. They wrote a special videocodec - divides the video in small files - to increase the disk-grabbing time. It can play fore- and backward and you could control it with Vvvv via OSC or TCP/IP.

Here is the Url MxWendler

Length, i’m not sure yet, but something between 1000 and 4000 frames (i’m still researching regarding that).

my source footage is a collection of pictures, not a video, so that could be an option.

so you like to display something like 4000 pictures in random order? how often should the picture change? only on user input?

mxwandler is an option if you need to have it as video. if you have stills and they fit into your RAM thats the way to go.
you can calculate how many memory you’ll need for your pictures like this:

1:
pic width * pic height * bits per pixel * nr. of pics = total nr. of bits

2:
divide by 8 to get byte
divide by 1024 to get kb
divide by 1024 to get mb
(divide by 1024 to get gb)

Thanks thanks thanks. Incredible community!!!
I’ll do some patching and come back to you after that, ok?

Time to sweat now…

hi nickdatz,

heres a module-patch for a animated-gif-like-texture-node. I used it to have a little Jpeg-loop. First it loops a little to buffer all pics. If you start it, it loops and if you stop it, it shows allways “pic0”.

May be you can take that as a first step for your needs.
Thread about Texture performance

TextureBuffer (Frank).v4p (26.1 kB)

OK!
catweasels’ patch seems to be doing just fine. I adjusted a few things (like playback speed set to 0, so that after I jump to a position the video stays still), and some minor details (like connecting via OSC to PD), so far so good with 640x480 videos, I’m happy!!!

Now, i’d like the video to leave some “ghost images” or “echoes” when it jumps from a position to another one. I’m quite used at doing similar stuff using alpha trail (i think that’s the name) in resolume, I guess I could do that in vvvv using freeframe effects, right?

frank thanks for the patch, i’ll check it later, but it seems i’m ok for now, and I’m quite in a hurry to make this project. Thanks anyway for your help!

like playback speed set to 0, so that after I jump to a position the video stays still

just set play to 0 ;) you can jump with DoSeek no matter if you play the file or not…

Now, i’d like the video to leave some “ghost images” or “echoes” when it jumps from a position to another one.

with Queue or Buffer its possible to sample a texture and display it on another quad for your echo effect. or you are using feedback or motion blur like in this patch.

I’ll try that when i get home. One question, can I use a freeframe plugin inserted to process video before going out, like i would do on resolume (or for that matter, any vj app)? How do I do that? I was reading the “how to” for freeframe, but there are no examples it seems?

Sorry if my question is silly. :(

PS: Another thing, i couldn’t find any downloadable help…

freeframe is easy: drag’n’drop the plugin (.dll) into your patch and patch it into the video signal chain where you want to have it… the parameters of the plugin will appear as input pins.

I’m starting to really enjoy using vvvv :)
So, i added a freeframe trail effect just as you mentioned. Just dropped it in the stage, and it showed its parameters, etc. What I’m not quite getting (i’m obviously missing a crucial part of the way vvvv processes video) is that no matter where in the video chain I inserted it (before the renderer), it always processes the current frame, so that even when it’s not moving (still picture) the video appears “processed” (like blurred). Making an analogy again to vj apps, this very same trail effect only affects video when it’s moving, the “echo” or “ghost” trail fades away so that when I “pause” the image it looks sharp.

So, being unable to get the desired effect, I tested Frank’s texture buffer example, it works quite nice! but I’m still not exactly getting what I’m after. I added an ADSR to the opacity of the feedback loop so that when the frame changes the blurring effect appears, but after a while it goes away. For some reason this blurring effect leaves a “trail” that moves from right to left in the video with my program material, I’m trying to get why, but haven’t got a clue…i see no reason why the feedback should move in one particular direction. I tested with several different videos, and it always does the same…???

Thanks guys, i’m amazed at the helpfulness of the people in this forum.

PD: Once again, sorry for my newbie posts…

freeframe effects should have an enabled pin, could that help? if not, try to set some parameters of the effect so that it has no effect…

i am not sure why frank uses the Buffer node in the patch, you can simplify it like in the attachement, i think. the only difference is that its not loading one picture per frame, but all in the same time, that will freeze vvvv until every picture is loaded. but in this version you are not limited to the graphics card ram but to cpu ram.

TextureBuffer (Frank) 2.v4p (11.2 kB)