Capture video from USB camera using V4L2
Capture live video from a USB video camera, using the V4L2 (Video for Linux Two API) driver framework. The output is in row major format. During simulation, the model outputs a moving colorbar image.
The Ubuntu Linux image used on the target hardware supports video capture from USB cameras listed as Universal Video Class (UVC). In addition to being a UVC class camera, the camera itself must support data acquisition in YUYV mode.
The following cameras have been tested:
Logitech QuickCam Pro 9000
Logitech QuickCam Pro 3000
Logitech Webcam C600
Logitech HD Webcam C310
To capture video from the Raspberry Pi Camera Board, search Help for “Add Support for Raspberry Pi Camera Board”.
Enter the path and name of the video device. This parameter
value defaults to '/dev/video0'
.
The Linux kernel creates a video device file when you connect a supported USB video camera to the board. By default, the Linux kernel supports all USB video class (UVC) devices.
To see the list of video device files, open a command line
session with the board and enter: ls -al
/dev/video*
.
Specify the width in pixels and height in lines of the image to capture.
This parameter value defaults to [640,
480]
.
Select the video format of the video device,
RGB
or YCbCr
4:2:2
.
RGB
represents the red, green, and blue
components of a pixel using an 8-bit value. RGB color space
is device-dependent.
YCbCr 4:2:2
uses three channels to
represent color image data for each pixel:
Y
is the luma component
(essentially a grayscale signal).
Cb
is the blue-difference
chroma component.
Cr
is the red-difference
chroma component.
The Cb and Cr components are sampled at half the sample rate of Y. See https://en.wikipedia.org/wiki/Chroma_subsampling.
This parameter value defaults to YCbCr
4:2:2
.
Select the sample time of the video device. This parameter
value defaults to 1/10
Smaller values require the processor to complete the same number of instructions in less time, which can cause task overrun.