I can't try it out right now but the video library may be what you're looking for.
Try out the sample code from the Processing Reference:
Capture: datatype for storing and manipulating video frames from an attached capture device such as a camera. Use Capture.list() to show the names of any attached devices. Using the version of the constructor without name will attempt to use the last device used by a QuickTime program. – Processing Reference
If you encounter any issue, check the related Wiki page.