Capture cam fail / Video library issue

live camera capture works maybe 1 out of every 20 times i click to run the sketch (see simple example code below). otherwise, the feed freezes on a gray screen with spinning wheel and the following error message in the console:

Could not find any devices
Processing video library using GStreamer 1.16.2
IllegalStateException: Could not find any devices
IllegalStateException: Could not find any devices
IllegalStateException: Could not find any devices
IllegalStateException: Could not find any devices

processing 3.5.4 x64
windows 10 x64
camera works fine in other apps (e.g. Camera, Zoom), drivers are updated

import processing.video.*;

Capture cam;

void setup() {
  size(640, 480);
  cam = new Capture(this, 640, 480);
  cam.start();
}

void draw() {
  if (cam.available()) {
    cam.read();
  }
  image(cam, 0, 0);
}

The same problem happens to me.

When I try to run some Capture examples these messages appear in the console:
Processing video library using GStreamer 1.16.2
There are no cameras available for capture.
WARNING: no real random source present!

Windows 10
Processing 3.5.4

Try Processing can't find the camera - Video Libraries don't work - #13 by neilcsmith

Hi neilcsmith:

That magic works for me!

cam = new Capture(this, “pipeline:autovideosrc”);

Thanks a lot.