Changes

Jump to navigation Jump to search
Line 58: Line 58:     
<code>chmod +x *</code>
 
<code>chmod +x *</code>
 +
 +
* For Raspberry Pi 5
 +
 +
<code>sudo ./install_driver_rpi5.sh [camera module]</code>
 +
 +
It will install both CAM1 and CAM0 overlays in /boot/config.txt.
 +
 +
* For other Raspberry Pi
    
<code>sudo ./install_driver.sh [camera module]</code>
 
<code>sudo ./install_driver.sh [camera module]</code>
Line 123: Line 131:  
==== List the available video modes ====
 
==== List the available video modes ====
 
<code>v4l2-ctl --list-formats-ext</code>
 
<code>v4l2-ctl --list-formats-ext</code>
 +
===Raspberry Pi 5 Setting===
 +
On Raspberry Pi 5,the drivers now use the media controller API, and we must setup the media graph correctly first. This includes setting up the media pad formats correctly and correctly linking them together.
 +
 +
We provide a series of scripts to implement this functionality, saved in the rpi5_scripts directory.
 +
 +
*./find_entity.sh
 +
 +
<code>$ ./find_entity.sh</code>
 +
 +
<code>Found veyecam2m @ i2c-6 entity on /dev/media0</code>
 +
 +
<code>Plese get frame from /dev/video0 and use /dev/v4l-subdev2 for camera setting.</code>
 +
 +
After a reboot of Raspberry Pi 5, the media node and video node of the camera may change. Therefore, it is recommended to execute <code>./find_entity.sh</code> before performing subsequent operations to identify the device nodes.
   −
=== Preview using VLC ===
+
The above prompt shows that the system has detected two cameras and their corresponding device nodes.
 +
 
 +
<code>i2c-4</code> corresponds to the CAM1 port on the board, and <code>i2c-6</code> corresponds to the CAM0 port on the board.
 +
 
 +
*media_setting_rpi5.sh
 +
 
 +
<code>./media_setting_rpi5.sh</code>
 +
 
 +
<code>Usage: ./media_setting_rpi5.sh veyecam2m/csimx307/cssc132/mvcam -fmt [UYVY/RAW8/RAW10/RAW12] -w [width] -h [height]</code>
 +
 
 +
<code>This shell script is designed to detect the connection of a camera on Raspberry Pi 5.</code>
 +
 
 +
<code>    It utilizes media-ctl and v4l2-ctl commands to configure the linking relationships and data formats of the media pad.</code>
 +
 
 +
<code>    Once completed, you can directly use /dev/video0 or /dev/video8 to obtain image data</code>
 +
 
 +
Before proceeding with further operations, it is '''necessary''' to execute this script to complete the configuration of parameters.
 +
 
 +
For instance:
 +
 
 +
<code>./media_setting_rpi5.sh veyecam2m</code>
 +
===Preview===
 +
On a raspberry pi 5, VLC for preview is now having problems and not working.
 +
==== Preview using VLC ====
 
1. Open VLC with command line <code>vlc</code> , or click the icon to launch.
 
1. Open VLC with command line <code>vlc</code> , or click the icon to launch.
   Line 140: Line 185:  
[[File:Play camera using VLC on RPI.png|alt=Play camera using VLC on RPI|center|thumb|1000x1000px|Play camera using VLC on RPI]]
 
[[File:Play camera using VLC on RPI.png|alt=Play camera using VLC on RPI|center|thumb|1000x1000px|Play camera using VLC on RPI]]
 
<br />
 
<br />
 +
======Preview using qv4l2======
 +
Install qv4l2,
    +
<code>sudo apt install qv4l2</code>
 +
 +
1. Open VLC with command line <code>vlc</code> to launch.
 +
 +
2. Hit the <code>▶</code>(Play) button to call the open media window.
 
=== Gstreamer usage samples ===
 
=== Gstreamer usage samples ===
 
<code>export DISPLAY=:0</code>
 
<code>export DISPLAY=:0</code>
Line 162: Line 214:  
==== Preview (VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ====
 
==== Preview (VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ====
 
<code>gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2convert capture-io-mode=dmabuf output-io-mode=dmabuf ! autovideosink sync=false -v</code>
 
<code>gst-launch-1.0 v4l2src io-mode=dmabuf device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! v4l2convert capture-io-mode=dmabuf output-io-mode=dmabuf ! autovideosink sync=false -v</code>
 +
 +
Or:
 +
 +
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080,framerate=(fraction)30/1" ! videoconvert ! autovideosink  sync=false -v</code>
    
==== Preview and Scale with timestamp on (VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ====
 
==== Preview and Scale with timestamp on (VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ====
Line 295: Line 351:     
=== Document History ===
 
=== Document History ===
 +
 +
* 2024-01-01
 +
 +
Add support for Raspberrypi 5.
    
* 20230607
 
* 20230607

Navigation menu