The i.MX6 CPU video graphics subsystem contains one or two image processing units (IPU) which provide connectivity for cameras.
The i.MX6 Solo/DualLite CPU has one IPU that supports up to two video inputs:
The i.MX6 Dual/Quad has two IPUs that support up to three video inputs:
The ConnectCore 6 SBC has two parallel CSI connectors and one MIPI-CSI-2 connector.
Using the camera
Identify the camera
The default ConnectCore 6 SBC device tree defines two Video4Linux capture devices. Each one is assigned to a camera interface:
The MIPI camera is assigned video device node /dev/video0.
The parallel camera is assigned video device node /dev/video1.
|The following examples assume you are using the MIPI camera (/dev/video0).|
Preview a camera image using gstreamer
Capture the camera image and preview it using gstreamer:
gst-launch-1.0 imxv4l2src device=/dev/video0 ! imxv4l2sink
Take a picture with the camera using gstreamer
Capture a still image with the camera and save it using gstreamer:
gst-launch-1.0 imxv4l2src device=/dev/video0 num-buffers=1 ! jpegenc ! filesink location=sample.jpg
Record a video with the camera using gstreamer
Capture a moving image with the camera and save it using gstreamer:
gst-launch-1.0 imxv4l2src device=/dev/video0 num-buffers=300 ! 'video/x-raw,format=(string)NV12,width=640,height=480,framerate=(fraction)30/1' ! queue ! vpuenc_h264 ! avimux ! filesink location=output.avi