You can use the camera(s) built into your device, or an external camera connected via USB. If you do have multiple cameras on your device (eg a forward and backward-facing camera), you may need to specify its name. Use Camera.dumpDevices to print out available capture devices to the console.
Camera.start
Camera.start pipes camera data to an automatically-created <VIDEO> element.
When calling Camera.start(), it will use your default camera. Constraints can be used to request a particular camera or resolution.
For example by device id:
Lower resolution access is often preferred when doing image processing since more pixels means more time spent processing.
Reading frames
There are two simple approaches to read frames from the camera once it is streaming to a VIDEO element. See Video for more info.
By default it will read frames as quick as possible. Sometimes this might be too fast, where images are coming in more quickly than you can process them. Use the maxIntervalMs option to slow it down, eg reading a frame every 100ms:
Video.capture
Alternatively, Video.capture captures to a callback.