How to get bitmap/video data from JS into OF

Hi,

I’m generating an animation in a JS/HTML/ThreeJS environment. I need to get this animation into OF to distribute over a network. What are a couple of ways I could get real-time video data from the browser into OF?

Thanks

not sure what you’re doing and why, but on OSX you can maybe use syphon.

Looks like you can use toDataURL() to convert your canvas (seems to work both with the canvas and webgl renderers) to get data as a jpeg, and then you can stream that to an OF application over websockets with WebSocket in the browser and ofxLibwebsockets in OF

Awesome! How can I convert the data back into an image once it’s received?

Check my reply to your other thread, I put to an ofxLibwebsockets example that should get you rolling: Recieving a streaming video in OF via websockets