I need some good hint on the following. It is not really a Processing question, but I need it for a Processing project.
Say I have installed a Processing executable on two machines (say same OS). The script is such that a webcam source is captured and somehow shown modified.
Question is (first version): how do I connect the same webcam to the two machines at the same time? Do I need some kind of splitter?
Also (second version): what if the webcam is the webcam of one of the two machines? How do I pass the webcam source to the other machine too?
There is no way I know of to do this. Webcams, being USB, are controlled by one computer only.
The only way I know of is to write the image data from one webcam to a shared directory and let the 2nd machine access it. It works fine for still images but if you doing video, you have to complete the video stream first. The still images are close to “real time” access if the second machine reads the directory frequently.
I use webcams for astrophotography projects and this is what I’ve learned from experience. Cheers.
The client/server link that jafal provided appears to be the most direct way of solving the problem using Processing code. The code is 4 years old so would most likely be fine with 3.5.4 and need testing on 4.0b8 if your using it.
I tried CamNetClient+CamNetServer+JPEGEncode at https://github.com/torb-xyz/processing-experiments, and they work. I tried to join the two scripts into a single one, as to have both client and server on both machines I used to test, and it works too.
I need to play a little around, and to check how to use them to get a couple of effects I am thinking about. Anyway, so far so good.
I will update the board.
thanks to ask
cheers
mario
ps. I could test with several machines in a lab, within a LAN. In a single case, the client side on a Win10 could not write into the server side on a Win11 machine, I am not sure why.