IMX CSI: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 1: Line 1:
{{PageHeader|VAR-SOM-MX7 - Camera}} {{DocImage|category1=VAR-SOM-MX7|category2=Yocto}} __toc__
= 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.
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/


Please refer to https://gstreamer.freedesktop.org/
== Camera Probe ==


Run below command to see if you have got the camera detected
Run below command to see if you have got the camera detected
Line 16: Line 20:


</pre>
</pre>
As you can see above i.MX6S_CSI (platform:30710000.csi): is camera and pxp (pxp_v4l2_out): pixel procesing engine for overlay on display
As you can see above i.MX6S_CSI (platform:30710000.csi): is camera and pxp (pxp_v4l2_out): pixel procesing engine for overlay on display


== How to check whether I have the right camera stack / gstreamer plugin installed on my filesystem ?==
Checking whether you have got the imx platform plugins installed on your filesystem:
Checking whether you have got the imx platform plugins installed on your filesystem:
Run below command to check whether you have the IMX platform specific gstreamer plugin installed or not.
Run below command to check whether you have the IMX platform specific gstreamer plugin installed or not.
Line 35: Line 38:
where sensor process incoming light and converts it to YUV 4:2:2 format data. MIPI data is captured by the MIPI CSI input of the devkit. Bayer processing not supported.
where sensor process incoming light and converts it to YUV 4:2:2 format data. MIPI data is captured by the MIPI CSI input of the devkit. Bayer processing not supported.


Below pipelines are tested on latest yocto releases (rocko, morty, pyro)
== Testing Camera Loopback / Camera Preview on Display ==
 
Below pipelines are tested on latest yocto releases (rocko, morty, pyro) releases for IMX7.


Camera Preview on Display :
* For 640x480@30fps:
* For 640x480@30fps:
  root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=0 ! imxpxpvideosink
  root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=0 ! imxpxpvideosink
Line 53: Line 57:
  root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=4 ! imxpxpvideosink
  root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=4 ! imxpxpvideosink


== 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.


To Capture JPEG snapshot:
*For 640x480:
*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
  root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=0 num-buffers=1 ! jpegenc ! filesink location=/tmp/test.jpg
Line 74: Line 79:
Transfer /tmp/test.jpg to your PC and see whether you got correct snapshot or not.  
Transfer /tmp/test.jpg to your PC and see whether you got correct snapshot or not.  


Some of the camera examples you may want to refer to :http://variwiki.com/index.php?title=VAR-SOM-MX6_GSTREAM, however please note, IMX7 has different multimedia capabilities.
You can find more examples in the [[VAR-SOM-MX6 GSTREAM FSLC#Camera Loopback|GStreamer section]].


'''Please note: IMX7 has different multimedia capabilities than IMX6. All the references mentioned above for [[VAR-SOM-MX6 GSTREAM FSLC#Camera Loopback|GStreamer section]] should only be considered as examples. The pipelines may not work on IMX7 software stack.


For detailed camera training refer to : http://cache.freescale.com/files/training/doc/ftf/2014/FTF-CON-F0119.pdf
For detailed camera training for IMX family refer to : http://cache.freescale.com/files/training/doc/ftf/2014/FTF-CON-F0119.pdf

Revision as of 05:23, 7 March 2018

VAR-SOM-MX7 - Camera

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@imx:~# v4l2-ctl --list-devices

This should output below

root@imx:~# 
i.MX6S_CSI (platform:30710000.csi):
        /dev/video1

pxp (pxp_v4l2_out):
        /dev/video0

As you can see above i.MX6S_CSI (platform:30710000.csi): is camera and pxp (pxp_v4l2_out): pixel procesing engine for overlay on display

How to check whether I have the right camera stack / gstreamer plugin installed on my filesystem ?

Checking whether you have got the imx platform plugins installed on your filesystem: Run below command to check whether you have the IMX platform specific gstreamer plugin installed or not.

root@imx:~# 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
  • imxv4l2videosrc: is the IMX family CSI camera v4l2 community plugin. Currently devkits only supports OV5640 as YUV input.

where sensor process incoming light and converts it to YUV 4:2:2 format data. MIPI data is captured by the MIPI CSI input of the devkit. Bayer processing not supported.

Testing Camera Loopback / Camera Preview on Display

Below pipelines are tested on latest yocto releases (rocko, morty, pyro) releases for IMX7.

  • For 640x480@30fps:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=0 ! imxpxpvideosink
  • NTSC 720x480@30fps:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=1 ! imxpxpvideosink
  • 720P 1280x720@30fps :
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=2 ! imxpxpvideosink
  • For 1080P@30fps:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=3 ! imxpxpvideosink
  • For QSXGA 2592x1944@15fps:
root@imx:~# gst-launch-1.0 imxv4l2videosrc device=/dev/video1  imx-capture-mode=4 ! imxpxpvideosink

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. Transfer /tmp/test.jpg to your PC and see whether you got correct snapshot or not.

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