DART-MX8M CSI
Testing MIPI-CSI2 cameras
Before running any of the pipelines below make sure you have camera(s) connected.
The i.MX family of processors uses gstreamer as a multimedia framework. Please refer to https://gstreamer.freedesktop.org/.
Camera Probe
Run the following command to see if you have the camera(s) detected:
# v4l2-ctl --list-devices
This should produce an output similar to this:
ev (): /dev/v4l-subdev0 mxc-isi-cap (platform:32e00000.isi:cap_devic): /dev/video1 mxc-isi-m2m (platform:32e00000.isi:m2m_devic): /dev/video0 mxc-isi-cap (platform:32e02000.isi:cap_devic): /dev/video2
In the example above, you can see there are 2 cameras accessible as /dev/video1 and /dev/video2
Testing Camera Preview on Display
In the examples below, replace /dev/videoX with an actual camera device, following the Camera Probe section.
- NTSC 480p 720x480@30fps:
# gst-launch-1.0 v4l2src device=/dev/videoX ! imxvideoconvert_g2d ! video/x-raw,width=720,height=480 ! kmssink sync=false can-scale=false
- HD 720p 1280x720@30fps:
# gst-launch-1.0 v4l2src device=/dev/videoX ! imxvideoconvert_g2d ! video/x-raw,width=1280,height=720 ! kmssink sync=false can-scale=false
- Full HD 1080p 1920x1080@30fps:
# gst-launch-1.0 v4l2src device=/dev/videoX ! imxvideoconvert_g2d ! video/x-raw,width=1920,height=1080 ! kmssink sync=false can-scale=false
Testing Camera JPEG Snapshot
To capture JPEG snapshot run one of the pipelines below depending upon the required picture resolution.
In the examples below, replace /dev/videoX with an actual camera device, following the Camera Probe section.
- VGA 480p 640x480:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=640,height=480 ! jpegenc ! filesink location=/tmp/test_640x480.jpg
- NTSC 480p 720x480:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=720,height=480 ! jpegenc ! filesink location=/tmp/test_720x480.jpg
- HD 720p 1280x720:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1280,height=720 ! jpegenc ! filesink location=/tmp/test_1280x720.jpg
- Full HD 1080p 1920x1080:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1920,height=1080 ! jpegenc ! filesink location=/tmp/test_1920x1080.jpg
- QSXGA 1944p 2592x1944:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=2592,height=1944 ! jpegenc ! filesink location=/tmp/test_2592x1944.jpg
Using both cameras simultaneously
The following pipeline is an example of using both cameras simultaneously.
In this example a short video stream from each camera is saved as an H.264-encoded AVI file.
# gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=100 ! video/x-raw,width=1920,height=1080 ! vpuenc_h264 ! avimux ! filesink location=./test0.avi \ v4l2src device=/dev/video2 num-buffers=100 ! video/x-raw,width=1920,height=1080 ! vpuenc_h264 ! avimux ! filesink location=./test1.avi