DART-MX8M CSI: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
--> {{#lst:B2QT_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!-- | --> {{#lst:B2QT_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!-- | ||
--> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!-- | --> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!-- | ||
--> {{PageHeader|{{#var:HARDWARE_NAME}} Camera}} {{DocImage|category1=Yocto|category2=Debian}} [[Category:{{#var:HARDWARE_NAME}}]] __toc__ | --> {{PageHeader|{{#var:HARDWARE_NAME}} Camera}} {{DocImage|category1=Yocto|category2=Debian}} [[Category:{{#var:HARDWARE_NAME}}]] __toc__ | ||
= Testing MIPI-CSI2 cameras = | = Testing MIPI-CSI2 cameras = | ||
Line 48: | Line 31: | ||
/dev/video1 | /dev/video1 | ||
</pre> | </pre> | ||
In the example above, you can see there are 2 cameras accessible as /dev/video0 and /dev/video1 | |||
| {{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-PLUS | | | {{#ifeq: {{#var:HARDWARE_NAME}} | DART-MX8M-PLUS | | ||
<pre> | <pre> | ||
Line 63: | Line 46: | ||
/dev/video2 | /dev/video2 | ||
</pre> | </pre> | ||
In the example above, you can see there are 2 cameras accessible as /dev/video1 and /dev/video2 | |||
| {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX93 | | | {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX93 | | ||
<pre> | <pre> | ||
Line 73: | Line 56: | ||
/dev/video0 | /dev/video0 | ||
</pre> | </pre> | ||
In the example above, you can see there is 1 camera accessible as /dev/video0 | |||
| | | | ||
<pre> | <pre> | ||
Line 80: | Line 63: | ||
/dev/video0 | /dev/video0 | ||
</pre> | </pre> | ||
In the example above, you can see there is 1 camera accessible as /dev/video0 | |||
}}}}}} | }}}}}} | ||
== Testing Camera Preview on Display == | == Testing Camera Preview on Display == | ||
In the examples below, replace /dev/videoX with an actual camera device, following the [[#Camera_Probe | Camera Probe]] section. | |||
{{#varexists:USE_KMSSINK | | {{#varexists:USE_KMSSINK | | ||
{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8M-NANO | | {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8M-NANO | | ||
* HD 720p 1280x720@30fps: | * HD 720p 1280x720@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=1280,height=720 ! kmssink sync=false can-scale=false | ||
* Full HD 1080p 1920x1080@30fps: | * Full HD 1080p 1920x1080@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=1920,height=1080 ! kmssink sync=false can-scale=false | ||
| | | | ||
* NTSC 480p 720x480@30fps: | * NTSC 480p 720x480@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! imxvideoconvert_g2d ! video/x-raw,width=720,height=480 ! kmssink sync=false can-scale=false | ||
* HD 720p 1280x720@30fps: | * HD 720p 1280x720@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! imxvideoconvert_g2d ! video/x-raw,width=1280,height=720 ! kmssink sync=false can-scale=false | ||
* Full HD 1080p 1920x1080@30fps: | * Full HD 1080p 1920x1080@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! imxvideoconvert_g2d ! video/x-raw,width=1920,height=1080 ! kmssink sync=false can-scale=false | ||
}} | }} | ||
| | | | ||
* VGA 480p 640x480@30fps: | * VGA 480p 640x480@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=640,height=480 ! autovideosink sync=false | ||
* NTSC 480p 720x480@30fps: | * NTSC 480p 720x480@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=720,height=480 ! autovideosink sync=false | ||
* HD 720p 1280x720@30fps: | * HD 720p 1280x720@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=1280,height=720 ! autovideosink sync=false | ||
* Full HD 1080p 1920x1080@30fps: | * Full HD 1080p 1920x1080@30fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false | ||
{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8M-NANO ||{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX93 || | {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8M-NANO ||{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX93 || | ||
* QSXGA 1944p 2592x1944@15fps: | * QSXGA 1944p 2592x1944@15fps: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=2592,height=1944 ! autovideosink sync=false | ||
}}}}}} | }}}}}} | ||
Line 124: | Line 107: | ||
To capture JPEG snapshot run one of the pipelines below depending upon the required picture resolution. | To capture JPEG snapshot run one of the pipelines below depending upon the required picture resolution. | ||
In the examples below, replace /dev/videoX with an actual camera device, following the [[#Camera_Probe | Camera Probe]] section. | |||
* VGA 480p 640x480: | * VGA 480p 640x480: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=640,height=480 ! jpegenc ! filesink location=/tmp/test_640x480.jpg | ||
* NTSC 480p 720x480: | * NTSC 480p 720x480: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=720,height=480 ! jpegenc ! filesink location=/tmp/test_720x480.jpg | ||
* HD 720p 1280x720: | * HD 720p 1280x720: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1280,height=720 ! jpegenc ! filesink location=/tmp/test_1280x720.jpg | ||
* Full HD 1080p 1920x1080: | * Full HD 1080p 1920x1080: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1920,height=1080 ! jpegenc ! filesink location=/tmp/test_1920x1080.jpg | ||
{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8M-NANO ||{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX93 || | {{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX8M-NANO ||{{#ifeq: {{#var:HARDWARE_NAME}} | VAR-SOM-MX93 || | ||
* QSXGA 1944p 2592x1944: | * QSXGA 1944p 2592x1944: | ||
# gst-launch-1.0 v4l2src device=/dev/ | # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=2592,height=1944 ! jpegenc ! filesink location=/tmp/test_2592x1944.jpg | ||
}}}} | }}}} | ||
Revision as of 18:58, 21 January 2025
This page is using the default release RELEASE_SUMO_V1.0_DART-MX8M.
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
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
This should produce the following output
# v4l2-ctl --list-devices i.MX6S_CSI (platform:30a90000.csi1_bridge): /dev/video0 i.MX6S_CSI (platform:30b80000.csi2_bridge): /dev/video1
In the example above, you can see there are 2 cameras accessible as /dev/video0 and /dev/video1
Testing Camera Preview on Display
In the examples below, replace /dev/videoX with an actual camera device, following the Camera Probe section.
- VGA 480p 640x480@30fps:
# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=640,height=480 ! autovideosink sync=false
- NTSC 480p 720x480@30fps:
# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=720,height=480 ! autovideosink sync=false
- HD 720p 1280x720@30fps:
# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=1280,height=720 ! autovideosink sync=false
- Full HD 1080p 1920x1080@30fps:
# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false
- QSXGA 1944p 2592x1944@15fps:
# gst-launch-1.0 v4l2src device=/dev/videoX ! video/x-raw,width=2592,height=1944 ! autovideosink sync=false
Testing Camera JPEG Snapshot
To capture JPEG snapshot run one of the pipelines below depending upon the required picture resolution.
In the examples below, replace /dev/videoX with an actual camera device, following the Camera Probe section.
- VGA 480p 640x480:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=640,height=480 ! jpegenc ! filesink location=/tmp/test_640x480.jpg
- NTSC 480p 720x480:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=720,height=480 ! jpegenc ! filesink location=/tmp/test_720x480.jpg
- HD 720p 1280x720:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1280,height=720 ! jpegenc ! filesink location=/tmp/test_1280x720.jpg
- Full HD 1080p 1920x1080:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1920,height=1080 ! jpegenc ! filesink location=/tmp/test_1920x1080.jpg
- QSXGA 1944p 2592x1944:
# gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=2592,height=1944 ! jpegenc ! filesink location=/tmp/test_2592x1944.jpg
Using both cameras simultaneously
The following pipeline is an example of using both 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