Page 1 of 1

Stream frames from Python OpenCV to Resolume?

Posted: Fri Aug 03, 2018 09:28
by 8bitoak
Dear experts,

I will be happy to get your help,
I want to stream a video from Python code that is doing some OpenCV stuff (Tracking object movement) but I need the video to get into the Resolume as a source.
Is there anyone tried this before?
Maybe there's an other way such some video router to install on my Windows 10 so it, somehow, patch the video coming from my software to the resolume inputs?

Thanks in advance!
cheers

Re: Stream frames from Python OpenCV to Resolume?

Posted: Fri Aug 03, 2018 09:33
by drazkers
There is a spout library for python. Would that fit the bill?

Re: Stream frames from Python OpenCV to Resolume?

Posted: Sat Aug 04, 2018 00:31
by 8bitoak
Really??? Thats awesome!
Does this spout requires the 'NDI newTek' module?
Because my processor does not work with the NDI...(old instruction set..no ssse3)

Do you know some example of using the spout lib for python?

Thanks a lot

Re: Stream frames from Python OpenCV to Resolume?

Posted: Sat Aug 04, 2018 07:22
by drazkers
8bitoak wrote:
Sat Aug 04, 2018 00:31
Really??? Thats awesome!
Does this spout requires the 'NDI newTek' module?
Because my processor does not work with the NDI...(old instruction set..no ssse3)

Do you know some example of using the spout lib for python?

Thanks a lot
Spout is based on your GPU, there is no compression its just a framework to share textures between programs that have been rendered on the GPU. It significantly more efficient because you're taking a rendered texture and sharing it, not compressing it after rendering. Which ndi does because its created for network transmission.

You'll have to check to see if your gpu supports the DirectX/Opengl interop, but it was supported back in 2010 for nvidia.

There are examples on the github page.

Re: Stream frames from Python OpenCV to Resolume?

Posted: Sun Aug 05, 2018 12:02
by 8bitoak
drazkers wrote:
Sat Aug 04, 2018 07:22
Spout is based on your GPU, there is no compression its just a framework to share textures between programs that have been rendered on the GPU. It significantly more efficient because you're taking a rendered texture and sharing it, not compressing it after rendering. Which ndi does because its created for network transmission.

You'll have to check to see if your gpu supports the DirectX/Opengl interop, but it was supported back in 2010 for nvidia.

There are examples on the github page.
Thank you! Finally I managed to stream the video to Resolume.
Great solution.

Re: Stream frames from Python OpenCV to Resolume?

Posted: Mon Oct 07, 2019 02:46
by TheUnderDog
Hey I am trying to do something similar but opposite. I need to be able to choose between videos within a collection within resolume within a python code.

Can you please share your solution in hopes that I can re-engineer it to fit my problem?

Any help is much appreciated,
DB

Re: Stream frames from Python OpenCV to Resolume?

Posted: Thu Oct 10, 2019 01:34
by subpixel
Spout used to come with SpoutSender and SpoutReceiver plugins.

Resolume has since integrated Spout support, however to send you need to create a "Screen" in Advanced Output with the device set to Spout. This is not entirely as convenient as the SpoutSender FFGL plugin, but should work for you. You can create a Slice in your Advanced Output screen with the source being set to a particular Layer within your Composition, and (perhaps on the layer above that) use a Spout Source to bring the results back into the Composition.

Re: Stream frames from Python OpenCV to Resolume?

Posted: Wed Feb 12, 2020 21:35
by MauriceWW
Can you maybe send me your code for streaming the opencv frames to resolume via Spout? I managed to run the spout for python version, but if I try to capture the signal from my webcam with opencv and then send it, I just get a black screen. I tried to change the resolution and also use the right webcam ID. With cv.imshow(x, frame) I can see the livestream, but in the Spout Sender Window it is just black. Maybe someone can help me.

Re: Stream frames from Python OpenCV to Resolume?

Posted: Tue Apr 21, 2020 07:52
by realsammyt
Are you on a laptop or pc with internal gfx + gfx cardÉ