passing a pixel array via OSC

hi everyone

i was think about making a osc Broadcaster for video
an vot to the point where i dont know anything about nothing so here is my question:

how can i pass the values of a ofTexture

unsigned char pixels[200*100];
for (int i = 0; i < 200*100; i++){
**pixels[i] ** = (int)(255 * ofRandomuf());
}
myTexture.loadData(pixels, 200, 100, GL_RGB);

through an OSC tunnel :slight_smile:

you probably don’t want to do this, since the OSC protocol isn’t designed for it… you’d probably need to compress the data somehow before trying to send it, to get an even vaguely acceptable framerate.

having said that, you could perhaps extend ofxOsc to include the blob datatype, and then send each frame as a ‘blob’ (a blob in OSC is just an array of chars). i think (i might be wrong about this) that a UDP packet should be kept fairly small, in any case - you probably don’t want to try and send a 500k UDP packet (which would be the size of an image…)

perhaps, looking into VLC might be a good idea? VLC was originally designed as a client to play streaming video served over a LAN (hence the name ‘Video Lan Client’).

hey, yes, unless your frames are really small you are going to have problems sending all that data with osc.

also with vlc you can stream a videofile or even another stream or video from a device, but you can’t “inject” data to send as a stream. they have an api to read the data from a stream but not to write to it, at least last time i took a look it was like this. gstreamer though can do both and it should be able to do streaming of frames generated from oF with it.

Does anyone know an easier way to do this yet?

I want to send about 1 frame per second to a client so it can “preview” the texture in real time.

I’m in the middle of implementing osc blobs, but is there an easier way to send 1 camera frame between a client and a server? It’s all on a local network so bandwidth isn’t an issue.

TCP sockets are a bit overkill for my app, plus it would require setting up a concurrent TCP session with the OSC session. =(

Suggestions?