Interaction Design WikiComputer Vision

Video Library 2.0

The video library which is downloadable through the Processing Contribution Manager adds the ability to use videos and camera inputs in your Processing sketches. The wiki page about Video Processing shows how to use the library and some of its possibilities.

Use the Contribution Manager

The most simple way to install the library is through the Processing contribution Manager. Before trying out the extended steps that follow, first try it out if this one works for you already.

How to update?

  1. Download the latest pre-release of version 2 from the github releases (current: r8-2.0)

  2. Unzip the file and move the folder to your Processing library folder (overwrite existing video folder in necessary)

  3. 🎉🙌🏻 (at least on Unix & Windows)

From now on, make sure that you always provider a camera to the Capture constructor in your sketch:

video = new Capture(this, "pipeline:autovideosrc");

MacOS Mojave / Catalina / BigSur Issues

Quarantine

Native libraries that are not notarised by Apple will be blocked by GateKeeper, Apples internal anti-virus software. To allow the native libraries of gstreamer, they have to be removed from the quarantine. To do this, open the console (terminal) Application and run following command by copy and paste it into the terminal and hit enter:

cd ~/Documents/Processing/libraries/video; xattr -r -d com.apple.quarantine *

Access

MacOS Mojave / Catalina have introduced new features regarding security and access control. This means that it is not possible anymore for any application, to just start the webcam or listen to your microphone or read what you are typing. As on your smartphone, it is now possible to control access for any application. The applications will ask you if they are allowed to use the camera:

For most modern apps, this works without any problems. But Processing is missing (currently) the correct PList entries, so MacOS will never ask you if Processing is allowed to do that. The sketch will just close and there will be an error message in the console.

The workaround for this problem is to start Processing from another application, which already contains this PList entry. For example the default MacOS terminal (console) is able to run Processing and allow it to access the camera.

Start Processing from the terminal application by copying following command into the terminal and hit enter:

/Applications/Processing.app/Contents/MacOS/Processing

Then open an example that uses the camera from the Video examples (GettingStartedCapture).

Now run the example and allow Processing to use the camera. From now on, Processing is added to the list of apps that are allowed to use the camera and you can run Processing as you are used to.

TL;DR

  1. Install Video Library Beta Version

  2. Disable quarantine for native library files

  3. Allow Processing to access Webcam