DART-MX8M CSI
Testing our MIPI cameras
Before you start any of below pipeline make sure you have camera connected. IMX family of processor uses gstreamer as multimedia framework. Please refer to https://gstreamer.freedesktop.org/
Camera Probe
Run below command to see if you have got the camera detected
root@imx8m-var-dart:~# v4l2-ctl --list-devices
This should output below
root@imx8m-var-dart:~# v4l2-ctl --list-devices i.MX6S_CSI (platform:30a90000.csi1_bridge): /dev/video0 i.MX6S_CSI (platform:30b80000.csi2_bridge): /dev/video1
As you can see above there are 2 cameras accessible as /dev/video0 and /dev/video1
Testing Camera Loopback / Camera Preview on Display
In the examples below /dev/videoX is either /dev/video0 or /dev/video1
- For 640x480@30fps:
root@imx8m-var-dart:~# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=640,height=480 ! kmssink
- NTSC 720x480@30fps:
root@imx8m-var-dart:~# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=720,height=480 ! kmssink
- 720P 1280x720@30fps :
root@imx8m-var-dart:~# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=1280,height=720 ! kmssink
- For 1080P@30fps:
root@imx8m-var-dart:~# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=1920,height=1080 ! kmssink
- For QSXGA 2592x1944@15fps:
root@imx8m-var-dart:~# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=2592,height=1944 ! kmssink
Testing Camera JPEG Snapshot / Taking Single Picture
To Capture JPEG snapshot run any of below pipeline depending upon the resolution you want to take picture.
- For 640x480:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1 imx-capture-mode=0 num-buffers=1 ! jpegenc ! filesink location=/tmp/test.jpg
- NTSC 720x480:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1 imx-capture-mode=1 num-buffers=1 ! jpegenc ! filesink location=/tmp/test.jpg
- 720P 1280x720:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1 imx-capture-mode=2 num-buffers=1 ! jpegenc ! filesink location=/tmp/test.jpg
- For 1080P:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1 imx-capture-mode=3 num-buffers=1 ! jpegenc ! filesink location=/tmp/test.jpg
- For QSXGA 2592x1944:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1 imx-capture-mode=4 num-buffers=1 ! jpegenc ! filesink location=/tmp/test.jpg
Please note : jpegenc is opensource software based jpeg encoder. This gets executed on CPU not using JPEG hardware acceleration.
To see your recently taken picture, transfer /tmp/test.jpg to your PC via scp or winscp and see whether you got correct snapshot or not.
References
You can find more examples in the GStreamer section.
Please note: IMX7 has different multimedia capabilities than IMX6. All the references mentioned above for GStreamer section should only be considered as examples. The pipelines may not work on IMX7 software stack.
For detailed camera training for IMX family refer to : http://cache.freescale.com/files/training/doc/ftf/2014/FTF-CON-F0119.pdf