Access Webcam with FaceOSC + Processing Simultaneously

Hi all ~

I’m using FaceOSC to get facial recognition data into Processing and doing some stuff with that data. I would also like to access the Capture image of my webcam in the same Processing sketch. Unfortunately it seems in Processing you can’t access the webcam image while FaceOSC is using it. Right now, when I try to run:

import processing.video.*
Capture cam;

void draw {
    cam.read();
}

I get this error:

** (java.exe:10908): WARNING **: gstvideo: failed to get caps of pad rgb:sink processing faceosc

Which basically means that I can’t access my Webcam because FaceOSC is already accessing it. This problem would be solved with Syphon + FaceOSC, but I am running Windows so I can’t use Syphon.

I only need to access the Webcam once every thirty frames (once a second) so perhaps I could - for one frame only - swap the priority of the webcam from FaceOSC over to Processing and then swap it back to FaceOSC next frame. Any ideas on if that’s possible? Or if there’s a way to just run a webcam to two programs simultaneously, that would be ideal.

Thanks in advance!

1 Like

I would recommend to use opencv-processing (add the library)
There is an example for face recognition (picture) but it is easy to expand it using the camera.

1 Like