February 7, 2013 at 8:33 am #18056
I’m working on making some syphon openCV widgets for VDMX in OF but I hit an early roadblock on getting access to the texture coming in from syphon. It’s protected, so I’ll either need to make another function on ofxSyphon that returns a copy of the texture or do something much less efficient.
Another silly way is: I could use the bind/unbind calls to bind the texture to an FBO and then use that as my texture, but that just sounds like a terrible idea when I have the texture sitting right there.
There are a bunch of ways I could do it, but I feel like I might be missing something simple and it’s a difficult thing to search for.February 7, 2013 at 2:43 pm #18099
edit: nevermind (i think)…found got some answers on the OF forum once i found the right thread. Not possible at the moment due to potential threading issues (at least it wasn’t a year ago)…ultimately i was looking to use it with opencv: http://forum.openframeworks.cc/index.php/topic,7791.0.htmlFebruary 7, 2013 at 4:24 pm #18100
There’s no reason you can’t expose the texture as a texture if that’s of any help and you want to modify ofxSyphon to allow it (ofxSyphon would love the attention). Just be aware that the texture is dependent on the lifetime of the Objective C SyphonImage object, so don’t release it while it might still be in use by OF.
As OpenCV needs pixel-buffers from it you will have to copy it via an FBO to get those – for the reasons discussed in that thread. Holler if we can give you any pointers – sounds like you’re on your way though.February 11, 2013 at 11:10 am #18288
I got the FBO setup working ( https://vimeo.com/59377121 )
and it seems to run pretty well despite being such an unintended use.
The one tricky bit I’m running into is how to sync my frame updates with open cv. Usually the Open CV updates in OF are only updated when there is a new frame from the videograbber, but with ofxSyphon I don’t seem have access to this kind of information.
Is there an easy way to get the frame update information from Syphon into ofxSyphon so I can try and limit frame drops? What parts should I take a look at?February 11, 2013 at 1:14 pm #18289
Yo and cool –
SyphonClient has a hasNewFrame method which you could extend ofxSyphon to expose, then only do work when that returns YES.
This will be of some but limited use if the server is running in VDMX, as VDMX has little to no notion of throttling things down when it can.February 12, 2013 at 8:35 am #18320
Further re VDMX, Ray has just reminded me that you can limit the render rate (soz if you already know this)
– VDMX5 > Preferences… > Rendering
– Scroll down to reveal the hidden Advanced Rendering Prefs button and hit it
– Uncheck Display Drives Canvas Rendering
– Alongside its dimensions, your Canvas/Main Output will now have a FPS setting – set that to whatever seems reasonable – probably the rate of your original video source
It’s not going to give you true sync, but coupled with only rendering in OF on new frames it should improve things quite a bit
You must be logged in to reply to this topic.