MX8 CSI: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 3: Line 3:
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_SUMO_V1.0_VAR-SOM-MX8}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_SUMO_V1.0_VAR-SOM-MX8}}}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} Camera}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME}}}} __toc__
--> {{PageHeader|{{#var:HARDWARE_NAME}} Camera}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME}}}} __toc__
= Testing MIPI-CSI2 cameras =
{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X | = Testing MIPI-CSI2 and parallel CSI cameras = | = Testing MIPI-CSI2 cameras =}}


Before running any of the pipelines below make sure you have camera(s) connected. i.MX family of processors uses gstreamer as multimedia framework.
Before running any of the pipelines below make sure you have camera(s) connected. i.MX family of processors uses gstreamer as multimedia framework.
Line 82: Line 82:
In the examples below /dev/video1 can be used instead of /dev/video0 on boards with 2 cameras.  
In the examples below /dev/video1 can be used instead of /dev/video0 on boards with 2 cameras.  


* 480P 640x480@30fps:
* 480P 640x480:
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! autovideosink
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! autovideosink


* NTSC 720x480@30fps:
* NTSC 720x480:
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480 ! autovideosink
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480 ! autovideosink


* 720P 1280x720@30fps:
* 720P 1280x720:
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! autovideosink
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! autovideosink


* 1080P: 1920x1080@30fps:
* 1080P: 1920x1080:
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080 ! autovideosink
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080 ! autovideosink


* QSXGA 2592x1944@15fps:
* QSXGA 2592x1944:
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=2592,height=1944 ! autovideosink
  # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=2592,height=1944 ! autovideosink



Revision as of 11:36, 11 November 2019

Camera

Testing MIPI-CSI2 cameras

Before running any of the pipelines below make sure you have camera(s) connected. i.MX family of processors uses gstreamer as 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

On VAR-SOM-MX8 it should produce the following output

# v4l2-ctl --list-devices
vpu B0 (platform:):
        /dev/video12
        /dev/video13

mxc-isi (platform:58100000.isi.0):
        /dev/video0
        /dev/video1

mxc-jpeg decoder (platform:58400000.jpegdec):
        /dev/video2

mxc-jpeg decoder (platform:58450000.jpegenc):
        /dev/video3

There is 1 camera accessible as /dev/video0, attached to VAR-EXT-CB8 expansion board.


On SPEAR-MX8 this should produce the following output:

# v4l2-ctl --list-devices
vpu B0 (platform:):
        /dev/video12
        /dev/video13

mxc-isi (platform:58100000.isi.0):
        /dev/video0
        /dev/video2

mxc-isi (platform:58140000.isi.4):
        /dev/video1

mxc-jpeg decoder (platform:58400000.jpegdec):
        /dev/video3

mxc-jpeg decoder (platform:58450000.jpegenc):
        /dev/video4

There is 2 cameras accessible as /dev/video0 and /dev/video1, both attached to VAR-EXT-CB8 expansion board.

Testing Camera Preview on Display

In the examples below /dev/video1 can be used instead of /dev/video0 on boards with 2 cameras.

  • 480P 640x480:
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! autovideosink
  • NTSC 720x480:
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480 ! autovideosink
  • 720P 1280x720:
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! autovideosink
  • 1080P: 1920x1080:
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080 ! autovideosink
  • QSXGA 2592x1944:
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=2592,height=1944 ! autovideosink


Testing Camera JPEG Snapshot

To capture JPEG snapshot run one of the pipelines below depending upon the required picture resolution.


In the examples below /dev/video1 can be used instead of /dev/video0 on boards with 2 cameras.

  • 480P 640x480:
# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=640,height=480   ! jpegenc ! filesink location=/tmp/test.jpg
  • NTSC 720x480:
# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=720,height=480   ! jpegenc ! filesink location=/tmp/test.jpg
  • 720P 1280x720:
# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=1280,height=720  ! jpegenc ! filesink location=/tmp/test.jpg
  • 1080P 1920x1080:
# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=1920,height=1080 ! jpegenc ! filesink location=/tmp/test.jpg
  • QSXGA 2592x1944:
# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=2592,height=1944 ! jpegenc ! filesink location=/tmp/test.jpg


Using 2 cameras simultaneously

The following pipeline is an example of using 2 cameras simultaneously.
In this example a short video stream from each camera is saved as an MJPEG-encoded AVI file.

# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=100 ! video/x-raw,width=1920,height=1080 ! jpegenc ! avimux ! filesink location=./test0.avi \
                 v4l2src device=/dev/video1 num-buffers=100 ! video/x-raw,width=1920,height=1080 ! jpegenc ! avimux ! filesink location=./test1.avi