Stream frames from Python OpenCV to Resolume?

FFGL, OSC, GLSL. If you like abbreviations, this is the forum for you
Post Reply
8bitoak
Met Resolume in a bar the other day
Posts: 3
Joined: Fri Aug 03, 2018 09:19

Stream frames from Python OpenCV to Resolume?

Post 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

User avatar
drazkers
Wants to marry Resolume, and Resolume said "yes!"
Posts: 961
Joined: Wed May 18, 2011 10:54
Location: Brady V up in Canada

Re: Stream frames from Python OpenCV to Resolume?

Post by drazkers »

There is a spout library for python. Would that fit the bill?

8bitoak
Met Resolume in a bar the other day
Posts: 3
Joined: Fri Aug 03, 2018 09:19

Re: Stream frames from Python OpenCV to Resolume?

Post 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

User avatar
drazkers
Wants to marry Resolume, and Resolume said "yes!"
Posts: 961
Joined: Wed May 18, 2011 10:54
Location: Brady V up in Canada

Re: Stream frames from Python OpenCV to Resolume?

Post 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.

8bitoak
Met Resolume in a bar the other day
Posts: 3
Joined: Fri Aug 03, 2018 09:19

Re: Stream frames from Python OpenCV to Resolume?

Post 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.

TheUnderDog
Met Resolume in a bar the other day
Posts: 2
Joined: Mon Oct 07, 2019 02:43

Re: Stream frames from Python OpenCV to Resolume?

Post 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

User avatar
subpixel
Hasn't felt like this about software in a long time
Posts: 143
Joined: Thu Jun 05, 2014 09:32
Location: Melbourne, AU

Re: Stream frames from Python OpenCV to Resolume?

Post 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.

MauriceWW
Met Resolume in a bar the other day
Posts: 1
Joined: Wed Feb 12, 2020 21:32

Re: Stream frames from Python OpenCV to Resolume?

Post 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.

realsammyt
Met Resolume in a bar the other day
Posts: 3
Joined: Fri Nov 27, 2015 06:19

Re: Stream frames from Python OpenCV to Resolume?

Post by realsammyt »

Are you on a laptop or pc with internal gfx + gfx cardÉ

Post Reply