DART-MX8M CSI: Difference between revisions

From Variscite Wiki
No edit summary
No edit summary
Line 87: Line 87:
{{#var:VIDEO_DEV_STR}}
{{#var:VIDEO_DEV_STR}}


* 480P 640x480@30fps:
* 480p 640x480@30fps:
  # gst-launch-1.0 v4l2src device=/dev/{{#var:VIDEO_DEV}} ! video/x-raw,width=640,height=480 ! autovideosink sync=false
  # gst-launch-1.0 v4l2src device=/dev/{{#var:VIDEO_DEV}} ! video/x-raw,width=640,height=480 ! autovideosink sync=false


Line 93: Line 93:
  # gst-launch-1.0 v4l2src device=/dev/{{#var:VIDEO_DEV}} ! video/x-raw,width=720,height=480 ! autovideosink sync=false
  # gst-launch-1.0 v4l2src device=/dev/{{#var:VIDEO_DEV}} ! video/x-raw,width=720,height=480 ! autovideosink sync=false


* 720P 1280x720@30fps:
* 720p 1280x720@30fps:
  # gst-launch-1.0 v4l2src device=/dev/{{#var:VIDEO_DEV}} ! video/x-raw,width=1280,height=720 ! autovideosink sync=false
  # gst-launch-1.0 v4l2src device=/dev/{{#var:VIDEO_DEV}} ! video/x-raw,width=1280,height=720 ! autovideosink sync=false


* 1080P: 1920x1080@30fps:
* 1080p: 1920x1080@30fps:
  # gst-launch-1.0 v4l2src device=/dev/{{#var:VIDEO_DEV}} ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false
  # gst-launch-1.0 v4l2src device=/dev/{{#var:VIDEO_DEV}} ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false


Line 109: Line 109:
<br>In the examples below /dev/videoX is either /dev/video0 or /dev/video1
<br>In the examples below /dev/videoX is either /dev/video0 or /dev/video1


* 480P 640x480:
* 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.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=640,height=480  ! jpegenc ! filesink location=/tmp/test.jpg


Line 115: Line 115:
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=720,height=480  ! jpegenc ! filesink location=/tmp/test.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=720,height=480  ! jpegenc ! filesink location=/tmp/test.jpg


* 720P 1280x720:
* 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.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1280,height=720  ! jpegenc ! filesink location=/tmp/test.jpg


* 1080P 1920x1080:
* 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.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1920,height=1080 ! jpegenc ! filesink location=/tmp/test.jpg


Line 126: Line 126:
<br>In the examples below /dev/videoX is either /dev/video1 or /dev/video2
<br>In the examples below /dev/videoX is either /dev/video1 or /dev/video2


* 480P 640x480:
* 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.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=640,height=480  ! jpegenc ! filesink location=/tmp/test.jpg


Line 132: Line 132:
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=720,height=480  ! jpegenc ! filesink location=/tmp/test.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=720,height=480  ! jpegenc ! filesink location=/tmp/test.jpg


* 720P 1280x720:
* 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.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1280,height=720  ! jpegenc ! filesink location=/tmp/test.jpg


* 1080P 1920x1080:
* 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.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=1920,height=1080 ! jpegenc ! filesink location=/tmp/test.jpg


Line 141: Line 141:
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=2592,height=1944 ! jpegenc ! filesink location=/tmp/test.jpg
  # gst-launch-1.0 v4l2src device=/dev/videoX num-buffers=1 ! video/x-raw,width=2592,height=1944 ! jpegenc ! filesink location=/tmp/test.jpg
|
|
* 480P 640x480:
* 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


Line 147: Line 147:
  # 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:
* 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:
* 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



Revision as of 18:37, 20 December 2021

DART-MX8M 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

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

As you can see above there are 2 cameras accessible as /dev/video0 and /dev/video1

Testing Camera Preview on Display

In the examples below /dev/videoX is either /dev/video0 or /dev/video1

  • 480p 640x480@30fps:
# gst-launch-1.0 v4l2src device=/dev/videox ! video/x-raw,width=640,height=480 ! autovideosink sync=false
  • NTSC 720x480@30fps:
# gst-launch-1.0 v4l2src device=/dev/videox ! video/x-raw,width=720,height=480 ! autovideosink sync=false
  • 720p 1280x720@30fps:
# gst-launch-1.0 v4l2src device=/dev/videox ! video/x-raw,width=1280,height=720 ! autovideosink sync=false
  • 1080p: 1920x1080@30fps:
# gst-launch-1.0 v4l2src device=/dev/videox ! video/x-raw,width=1920,height=1080 ! autovideosink sync=false
  • QSXGA 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 /dev/videoX is either /dev/video0 or /dev/video1

  • 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.jpg
  • NTSC 720x480:
# gst-launch-1.0 v4l2src device=/dev/videoX 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/videoX 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/videoX 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/videoX num-buffers=1 ! video/x-raw,width=2592,height=1944 ! jpegenc ! filesink location=/tmp/test.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