Purpose

The VideoCapture module provides a bridge to the video input capabilities of the operating system. Depending on the back-end used for interfacing with the operating system, different video input devices are supported. Currently, there are back-ends for the following operating systems:

  • macOS: The QuickTime AVFoundation back-end interfaces with all video hardware that conforms to the Universal Video Class (UVC) standard (like most of the current web-cams with USB or FireWire)
  • Windows, Linux: The OpenCV back-end interfaces with all video devices supported by OpenCV on that operating system
../../../Modules/ML/MLVideoCapture/mhelp/Images/VideoCapture.png

Usage

Connect an ML image input connector to the output connector of the module to access the images.

Details

The driver back-ends are derived from the VCVideoCaptureInterface class and are dynamically detected and loaded. Custom drivers can be developed and will be made available by the VideoCapture module if registered to the run-time type system.

On macOS, the QuickTime AVFoundation driver uses multithreading to offload video grabbing and post-processing to an own thread. 24Bit RGB, 8Bit grayscale as well as 16Bit grayscale images are supported as long as the video hardware is able to acquire those images.

The OpenCV back-end available to Windows and Linux supports only 24Bit RGB images, currently. Since OpenCV provides only basic camera control, the detection and selection of video input devices is limited. The module will always expose two camera input devices.

Output Fields

output0

name: output0, type: Image

The module provides one image output connector to access the video stream in form of an ML image.

outDriverAccess

name: outDriverAccess, type: MLBase

The module exposes direct access to the video driver back-end via this base field.

Parameter Fields

Field Index

Always capture video input: Bool inputSourcesList: String
Auto Exposure: Bool Start Capture: Trigger
deviceControlCapabilities: String Stop Capture: Trigger
Driver: String Update: Trigger
driversList: String Video Format: String
Exposure: Double Video Frame Size: String
Gain: Double videoFormatsList: String
Input Source: String videoFrameSizesList: String

Visible Fields

Update

name: updateDriversList, type: Trigger

Updates the list of known drivers. Use this button if you add another device driver at run-time

Driver

name: driver, type: String, default: OpenCV driver

Currently selected device driver

Input Source

name: inputSource, type: String

Currently selected video input source

Video Format

name: videoFormat, type: String

Currently selected video input format

Video Frame Size

name: videoFrameSize, type: String, default: Default Resolution

Currently selected video frame size

Always capture video input

name: autoCapture, type: Bool, default: FALSE

Always capture video input (starts automatically)

Start Capture

name: startCapture, type: Trigger

Manually start video capture

Stop Capture

name: stopCapture, type: Trigger

Manually stop video capture

Auto Exposure

name: autoExposure, type: Bool, default: TRUE

Exposure

name: exposure, type: Double, default: 0

Gain

name: gain, type: Double, default: 0

Hidden Fields

driversList

name: driversList, type: String, persistent: no

Comma separated list of known device drivers

inputSourcesList

name: inputSourcesList, type: String, persistent: no

Comma separated list of possible video input sources

videoFormatsList

name: videoFormatsList, type: String, persistent: no

Comma separated list of possible video formats for the selected video input device

videoFrameSizesList

name: videoFrameSizesList, type: String, persistent: no

Comma separated list of video frame sizes for the selected video input device

deviceControlCapabilities

name: deviceControlCapabilities, type: String, persistent: no