Streaming sketch output to different machine?

Hello there,

I have an upcoming project which requires running the code and viewing the outputs on different machines, is there a way to stream the processing sketch over a network? It’d be great to get the data either as complete frames, or if there’s a high performance video streaming method anyone can recommend I’d appreciate that also. Are there any clear tutorials for how I might do this?

Thanks!

1 Like

This may give you some ideas?

Thanks for the reply! You’re completely correct that this would definitely get me thinking about how to use two different machines related to a processing sketch.

With regards to using a server can you think of any way to do the sketch rendering on the server? I really like to have code executed on one machine and the visual results being sent to another; said differently I want the processing sketch frames created on the server and sent for display to the client.

The reason I’m after all of this is I have access to a server that is quite a bit more powerful than my own machine but it’s headless and I would like to see the results. Thanks again for the info!

Here is a node implementation of canvas:

and node p5js:

I haven’t tried these libraries and perhaps I might now, but if you find this working for your project, I’d love to hear what you think of them.

Hello,

Not tested… topic caught my interest and got me thinking about this.

:)

More excellent leads, thank you @ErraticGenerator ! I’ll peak at those later today.

yes @glv that’s totally in the spirit of what I’m looking for.

1 Like

Bumping this thread to share an updated version of the UDP video streaming example code.

This should now work with Processing 4, and the latest versions of the UDP and video libraries.

Edit: the changes have been merged into the original repo :sparkles: Thanks Dan!

2 Likes

Hello @sableraph,

I took this out for test run and it works!

Thanks for all the work you are doing!

My feedback below…

The reference for exit() states:

Rather than terminating immediately, exit() will cause the sketch to exit after draw() has completed (or after setup() completes if called during the setup() function).

I tried the code with no cameras and it failed to exit() and generated a NullPointerException at cam.start(); and never exited.

Adding a return() after the exit() corrected this since it went directly to the end of setup()(skipping over cam.start();) to exit():

exit();
return;

References:

I learn something new every day!

:)

1 Like

Good catch! Feel free to open a PR on Dan’s repo :smiley:

1 Like

Done!

:)