Read and Write the same VideoFile

Hey for an art project I’m trying to manipulate a video file in realtime. So the changes that I do in vvvv must be directly saved on to the file again so it kind of creates an input → manipulation → output → input loop.
Any suggestions how to achieve that?

I just had a look around and turns out its already in a Help Patch:

Just look at “Batch process a video” in the OpenCV category of the help browser. It does exactly what you want:

Replace Sobel and Resize with whatever you want to do to the video.

Happy patching! :)

You might want to add a way to rewind the video once it is finished like so:

Sorry, slight update. It writes it to a new file, but either way, its the right track. You would basically write a new file, then once its finished you load that file and write it to a new one and so on. then you even have all iterations as files. Of course you could add to delete the older files (be careful with the delete node though, best to first move them to a different folder like “_old” and then delete that manually.

1 Like

oh amazing!!! That looks super promissing. Quick question it writes into a weard codec that I cant event open in vlc. Could you lead me how can change the outputted codec?

Hm, that’s weird. I just gave it a .mp4 and it saved it in the same format. I’ll take a look though. In general I had a little play with doing it in a loop and it gets a bit tricky, because we are dealing with stuff that is asynchronous, ie. we don’t know how long it takes. Saving the file takes any amount of frames, so we can only start reading it once it’s ready. But it will 100% be doable. It’s a fun little challenge and I like the idea of basically overdubbing effects on a video.

I saw this little video about repeatedly applying blur and sharpen to an image/video and you see reaction-diffusion happening, which is pretty neat and a nice looking effect. https://youtu.be/7oCtDGOSgG8

Not really what you are after but might be interesting nonetheless: VL.LoopTool

1 Like

Ok I will try it with an .mp4. I tried .mov maybe thats the problem.

Yeah I know. I actually want to manipulate my videofiles live in a performance. Thats why the files actually need to get manipulated. A real loop with the file included :D

@bjoern oh thanks Super interesting!