Line 57: |
Line 57: |
| | | |
| <code>chmod +x *</code> | | <code>chmod +x *</code> |
| + | |
| + | * 对于树莓派5 |
| + | |
| + | <code>sudo ./install_driver_rpi5.sh [camera module]</code> |
| + | |
| + | 会在/boot/config.txt中安装CAM1和CAM0两个dtvoerlay。 |
| + | |
| + | * 其他树莓派 |
| | | |
| <code>sudo ./install_driver.sh [camera module]</code> | | <code>sudo ./install_driver.sh [camera module]</code> |
| + | |
| + | 然后重启树莓派。 |
| | | |
| camera module:可以是csimx307,cssc132,veyecam2m等。 | | camera module:可以是csimx307,cssc132,veyecam2m等。 |
Line 107: |
Line 117: |
| ==== 列出支持的模式 ==== | | ==== 列出支持的模式 ==== |
| <code>v4l2-ctl --list-formats-ext</code> | | <code>v4l2-ctl --list-formats-ext</code> |
− | ===使用VLC预览图像=== | + | ===树莓派5的配置=== |
| + | 在树莓派5上,驱动程序现在使用media control API,我们必须先正确设置media graph。这包括正确设置media pad的格式并正确链接它们。 |
| + | |
| + | 我们提供了一系列脚本实现这个功能,保存在rpi5_scripts目录。 |
| + | |
| + | *./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> |
| + | |
| + | 树莓派5重启之后,相机的media node,video node可能发生变化,因此,建议执行后续操作前执行<code>./find_entity.sh</code>以明确设备节点。 |
| + | |
| + | 上述提示信息中,可以看到系统插入了两个相机,以及每个相机的对应的设备节点。 |
| + | |
| + | <code>i2c-4</code>对应板子上的CAM1插口,<code>i2c-6</code>对应板子上的CAM0插口。 |
| + | |
| + | *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> |
| + | |
| + | 在进行后续操作前,必须执行此脚本以完成参数的配置。 |
| + | |
| + | 举例: |
| + | |
| + | <code>./media_setting_rpi5.sh veyecam2m</code> |
| + | |
| + | === 实时预览 === |
| + | 在树莓派5上,vlc进行播放现在有问题,不能使用。 |
| + | |
| + | ====使用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 120: |
Line 170: |
| 6. Type in the <code>width</code> and <code>height</code>, for example, 1920 and 1080. | | 6. Type in the <code>width</code> and <code>height</code>, for example, 1920 and 1080. |
| | | |
− | 7. Hit <code>OK</code> to save the settings and see the video feed.[[File:Play camera using VLC on RPI.png|alt=Play camera using VLC on RPI|center|thumb|1000x1000px|Play camera using VLC on RPI|link=http://wiki.veye.cc/index.php/File:Play_camera_using_VLC_on_RPI.png]] | + | 7. Hit <code>OK</code> to save the settings and see the video feed.[[File:Play camera using VLC on RPI.png|alt=Play camera using VLC on RPI|center|thumb|1000x1000px|Play camera using VLC on RPI|link=http://wiki.veye.cc/index.php/File:Play_camera_using_VLC_on_RPI.png]]<br /> |
| + | ======使用qv4l2播放图像====== |
| + | 首先安装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应用范例 === | | === Gstreamer应用范例 === |
| <code>export DISPLAY=:0</code> | | <code>export DISPLAY=:0</code> |
Line 142: |
Line 200: |
| ==== 视频预览(VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ==== | | ==== 视频预览(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> |
| + | |
| + | 或者: |
| + | |
| + | <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> |
| | | |
| ==== 视频预览并加时间戳显示(VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ==== | | ==== 视频预览并加时间戳显示(VEYE-MIPI-327,CS-MIPI-IMX307 @1080p mode) ==== |
Line 270: |
Line 332: |
| | | |
| === 本文修改记录 === | | === 本文修改记录 === |
| + | |
| + | * 2024-01-01 |
| + | |
| + | 增加对树莓派5的相关说明。 |
| | | |
| * 20230607 | | * 20230607 |