Camera¶
Testing our MIPI cameras¶
Camera probe¶
Make sure the camera is connected, and boot the board. Then, run the following command to verify the camera was detected successfully:
This should produce the following output:
In the output seen above, "i.MX6S_CSI" is the camera, and "pxp" is the i.MX Pixel Processing Pipeline.
i.MX platform-specific GStreamer plugins¶
Run the following command to verify you have the i.MX7 platform-specific GStreamer plugins installed on your system:
gst-inspect-1.0 | grep "imx"
imxpxp: imxpxpvideotransform: Freescale PxP video transform
imxpxp: imxpxpvideosink: Freescale PxP video sink
imxv4l2videosrc: imxv4l2videosrc: V4L2 CSI Video Source
imxaudio: imxmp3audioenc: Freescale i.MX MP3 encoder
imxaudio: imxuniaudiodec: Freescale i.MX uniaudio decoder
Gstreamer example 1: Testing Camera Loopback / Camera preview on the display¶
The below pipelines are suitable for the fslc-based Yocto releases for the VAR-SOM-MX7 (Yocto Morty and newer).
- For 640x480@30fps:
- For 720x480@30fps:
- For 1280x720@30fps :
- For 1920x1080@30fps:
- For 2592x1944@15fps:
Gstreamer example 2: Taking a JPEG snapshot from the camera¶
To capture and encode a JPEG snapshot from the camera, run one of the below pipelines depending on the wanted resolution:
- For 640x480:
gst-launch-1.0 imxv4l2videosrc device=/dev/video1 num-buffers=1 imx-capture-mode=0 ! 'video/x-raw,format=UYVY' ! jpegenc ! filesink location=/tmp/test.jpg
- For 720x480:
gst-launch-1.0 imxv4l2videosrc device=/dev/video1 num-buffers=1 imx-capture-mode=1 ! 'video/x-raw,format=UYVY' ! jpegenc ! filesink location=/tmp/test.jpg
- For 1280x720:
gst-launch-1.0 imxv4l2videosrc device=/dev/video1 num-buffers=1 imx-capture-mode=2 ! 'video/x-raw,format=UYVY' ! jpegenc ! filesink location=/tmp/test.jpg
- For 1920x1080:
gst-launch-1.0 imxv4l2videosrc device=/dev/video1 num-buffers=1 imx-capture-mode=3 ! 'video/x-raw,format=UYVY' ! jpegenc ! filesink location=/tmp/test.jpg
- For 2592x1944:
gst-launch-1.0 imxv4l2videosrc device=/dev/video1 num-buffers=1 imx-capture-mode=4 ! 'video/x-raw,format=UYVY' ! jpegenc ! filesink location=/tmp/test.jpg