MX8 CSI: Difference between revisions
No edit summary |
(Add Debian support) |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<!-- Set release according to "release" parameter in URL and use RELEASE_SUMO_V1. | <!-- Set release according to "release" parameter in URL and use RELEASE_SUMO_V1.1_VAR-SOM-MX8 as default | ||
--> {{# | --> {{INIT_RELEASE_PARAM|RELEASE_SUMO_V1.1_VAR-SOM-MX8}} <!-- | ||
--> {{#lst: | --> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!-- | ||
--> {{PageHeader|{{#var:HARDWARE_NAME}} Camera}} {{DocImage|category1=Yocto|category2={{#var:HARDWARE_NAME}} | --> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!-- | ||
--> {{PageHeader|{{#var:HARDWARE_NAME}} Camera}} {{DocImage|category1=Yocto|category2=Debian}} [[Category:{{#var:HARDWARE_NAME}}]] __toc__ | |||
{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X | = Testing MIPI-CSI2 and parallel CSI cameras = | = Testing MIPI-CSI2 cameras =}} | {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X | = Testing MIPI-CSI2 and parallel CSI cameras = | = Testing MIPI-CSI2 cameras =}} | ||
Make sure you have the camera(s) connected to the board before booting it and running any of the pipelines below .<br> | |||
Please refer to https://gstreamer.freedesktop.org/ | The i.MX family of SOCs uses gstreamer as a multimedia framework. Please refer to https://gstreamer.freedesktop.org/ | ||
{{#varexists:DEBIAN_NAME| | |||
== Install Utils == | |||
Run the following command to install v4l-utils: | |||
# apt-get clean; apt-get update; apt-get install -y v4l-utils | |||
}} | |||
== Camera Probe == | == Camera Probe == | ||
Run the following command to | Run the following command to list the detected camera devices: | ||
# v4l2-ctl --list-devices | # v4l2-ctl --list-devices | ||
{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X | | {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X | | ||
This should produce the following output | This should produce the following output: | ||
<pre> | <pre> | ||
# v4l2-ctl --list-devices | # v4l2-ctl --list-devices | ||
Line 34: | Line 41: | ||
/dev/video4 | /dev/video4 | ||
</pre> | </pre> | ||
There are | There are two cameras accessible as /dev/video0 and /dev/video1.<br> | ||
The first one is a MIPI-CSI2 camera attached to the VAR-EXT-CB8 expansion board, and the second one is a parallel CSI camera attached to the VCAM-5640P expansion board. | |||
| | | | ||
On VAR-SOM-MX8 it should produce the following output | On VAR-SOM-MX8 it should produce the following output: | ||
<pre> | <pre> | ||
# v4l2-ctl --list-devices | # v4l2-ctl --list-devices | ||
Line 53: | Line 61: | ||
/dev/video3 | /dev/video3 | ||
</pre> | </pre> | ||
There is | There is one camera accessible as /dev/video0, attached to the VAR-EXT-CB8 expansion board. | ||
<br>On SPEAR-MX8 this should produce the following output: | <br> | ||
On SPEAR-MX8 this should produce the following output: | |||
<pre> | <pre> | ||
# v4l2-ctl --list-devices | # v4l2-ctl --list-devices | ||
Line 75: | Line 84: | ||
/dev/video4 | /dev/video4 | ||
</pre> | </pre> | ||
There | There are two cameras accessible as /dev/video0 and /dev/video1, both attached to the VAR-EXT-CB8 expansion board. | ||
}} | }} | ||
Line 82: | Line 91: | ||
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): | ||
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! autovideosink sync=false | # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! autovideosink sync=false | ||
* NTSC 720x480: | * NTSC (720x480): | ||
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480 ! autovideosink sync=false | # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480 ! autovideosink sync=false | ||
* | * 720p (1280x720): | ||
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! autovideosink sync=false | # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! autovideosink sync=false | ||
* | * 1080p (1920x1080): | ||
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false | # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false | ||
* QSXGA 2592x1944: | * QSXGA (2592x1944): | ||
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=2592,height=1944 ! autovideosink sync=false | # gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=2592,height=1944 ! autovideosink sync=false | ||
{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X | | {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8X | | ||
{{note|Note: | {{note|Note: The parallel camera maximal frame rate at the 1920x1080 and 2592x1944 resolutions is 7.5fps|info}} | ||
}} | }} | ||
== Testing Camera JPEG Snapshot == | == Testing Camera JPEG Snapshot == | ||
To capture JPEG snapshot run one of the pipelines below depending upon the required picture resolution. | To capture a JPEG snapshot run one of the pipelines below, depending upon the required picture resolution.<br> | ||
In the examples below /dev/video1 can be used instead of /dev/video0 on boards with 2 cameras. | |||
<br>In the examples below /dev/video1 can be used instead of /dev/video0 on boards with 2 cameras. | |||
* | {{#ifeq: {{#var:YOCTO_NAME}}|Sumo| | ||
* 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 | # 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: | * 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 | # 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 | # 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 | # 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: | * 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 | # gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=2592,height=1944 ! jpegenc ! filesink location=/tmp/test.jpg | ||
| | |||
* 480p (640x480): | |||
# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=640,height=480 ! v4l2jpegenc ! 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 ! v4l2jpegenc ! 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 ! v4l2jpegenc ! 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 ! v4l2jpegenc ! 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 ! v4l2jpegenc ! filesink location=/tmp/test.jpg | |||
}} | |||
== Using 2 cameras simultaneously == | == Using 2 cameras simultaneously == | ||
Line 127: | Line 151: | ||
The following pipeline is an example of using 2 cameras simultaneously.<br> | The following pipeline is an example of using 2 cameras simultaneously.<br> | ||
In this example a short video stream from each camera is saved as an MJPEG-encoded AVI file. | In this example a short video stream from each camera is saved as an MJPEG-encoded AVI file. | ||
{{#ifeq: {{#var:YOCTO_NAME}}|Sumo| | |||
<pre> | |||
# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=100 ! video/x-raw,width=1920,height=1080 ! jpegenc ! avimux ! filesink location=./test0.avi \ | # 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 | v4l2src device=/dev/video1 num-buffers=100 ! video/x-raw,width=1920,height=1080 ! jpegenc ! avimux ! filesink location=./test1.avi | ||
</pre> | |||
| | |||
<pre> | |||
# gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=100 ! video/x-raw,width=1920,height=1080 ! v4l2jpegenc ! avimux ! filesink location=./test0.avi \ | |||
v4l2src device=/dev/video1 num-buffers=100 ! video/x-raw,width=1920,height=1080 ! v4l2jpegenc ! avimux ! filesink location=./test1.avi | |||
</pre> | |||
}} |
Latest revision as of 15:12, 6 June 2023
This page is using the default release RELEASE_SUMO_V1.1_VAR-SOM-MX8.
To view this page for a specific Variscite SoM and software release, please follow these steps:
- Visit variwiki.com
- Select your SoM
- Select the software release
Testing MIPI-CSI2 cameras
Make sure you have the camera(s) connected to the board before booting it and running any of the pipelines below .
The i.MX family of SOCs uses gstreamer as a multimedia framework. Please refer to https://gstreamer.freedesktop.org/
Camera Probe
Run the following command to list the detected camera devices:
# 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 one camera accessible as /dev/video0, attached to the 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 are two cameras accessible as /dev/video0 and /dev/video1, both attached to the 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 sync=false
- NTSC (720x480):
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=720,height=480 ! autovideosink sync=false
- 720p (1280x720):
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=720 ! autovideosink sync=false
- 1080p (1920x1080):
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false
- QSXGA (2592x1944):
# gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=2592,height=1944 ! autovideosink sync=false
Testing Camera JPEG Snapshot
To capture a 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