Difference between revisions of "VEYE CS Camera for Jetson TX2/zh"

From wiki_veye
Jump to navigation Jump to search
(参考资料)
(使用预编译好Image和DTB)
(One intermediate revision by the same user not shown)
Line 208: Line 208:
 
*patch代码
 
*patch代码
  
<code>cp $RELEASE_PACK_DIR/drivers_source/cs_imx307\ veye327/* $NVIDIA_PATH/drivers/media/i2c/</code>
+
<code>cp $RELEASE_PACK_DIR/drivers_source/veyecam/* $NVIDIA_PATH/drivers/media/i2c/</code>
  
 
''- r32.2.1''
 
''- r32.2.1''
  
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_csimx307veye327_config_32.2.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_csimx307veye327_defconfig</code>
+
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.2.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig</code>
  
 
''- r32.3.1''
 
''- r32.3.1''
  
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_csimx307veye327_config_32.3.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_csimx307veye327_defconfig</code>
+
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.3.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig</code>
  
 
''- r32.4.2''
 
''- r32.4.2''
  
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_csimx307veye327_config_32.4.2 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_csimx307veye327_defconfig</code>  
+
<code>cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.4.2 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig</code>  
  
 
*编译
 
*编译
Line 226: Line 226:
 
<code>cd $L4T_DIR/sources/kernel/kernel-4.9/</code>
 
<code>cd $L4T_DIR/sources/kernel/kernel-4.9/</code>
  
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_csimx307veye327_defconfig</code>  
+
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_veyecam_defconfig</code>  
  
 
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT Image -j4</code>
 
<code>make ARCH=arm64 O=$TEGRA_KERNEL_OUT Image -j4</code>
Line 259: Line 259:
  
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/CS-MIPI-IMX307/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/CS-MIPI-IMX307/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
 +
 +
对于CS-MIPI-SC132
 +
 +
<code>cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/CS-MIPI-SC132/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/</code>
  
 
对于VEYE-MIPI-327
 
对于VEYE-MIPI-327
Line 283: Line 287:
  
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/CS-MIPI-IMX307/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/CS-MIPI-IMX307/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
 +
 +
对于CS-MIPI-SC132
 +
 +
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/CS-MIPI-SC132/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/</code>
  
 
对于VEYE-MIPI-327
 
对于VEYE-MIPI-327
Line 295: Line 303:
  
 
<code>cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/CS-MIPI-IMX307/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/</code>
 
<code>cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/CS-MIPI-IMX307/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/</code>
 +
 +
对于CS-MIPI-SC132
 +
 +
<code>cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/CS-MIPI-SC132/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/</code>
  
 
对于VEYE-MIPI-327
 
对于VEYE-MIPI-327
Line 345: Line 357:
  
 
<code>subdev csimx307 3X-003b bound</code>
 
<code>subdev csimx307 3X-003b bound</code>
 +
 +
此外,检查/dev/videoX设备节点,应当是存在的。
 +
 +
*CS-MIPI-SC132型号
 +
 +
<code>dmesg | grep cssc132</code>  
 +
 +
应当有类似如下提示:
 +
 +
<code>subdev cssc132 3X-003b bound</code>
  
 
此外,检查/dev/videoX设备节点,应当是存在的。
 
此外,检查/dev/videoX设备节点,应当是存在的。
Line 361: Line 383:
  
 
<code>gst-launch-1.0 v4l2src ! "video/x-raw,format=(string)UYVY, width=(int)1280, height=(int)720, framerate=(fraction)60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false</code>
 
<code>gst-launch-1.0 v4l2src ! "video/x-raw,format=(string)UYVY, width=(int)1280, height=(int)720, framerate=(fraction)60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false</code>
 +
 +
*视频预览1280*1080@45fpsHD(硬件加速)
 +
 +
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1280, height=(int)1080,framerate=(fraction)45/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false</code>
  
 
*视频预览640*480@130fps(模组支持此分辨率时,硬件加速)
 
*视频预览640*480@130fps(模组支持此分辨率时,硬件加速)
Line 398: Line 424:
  
 
<code>subdev csimx307 3X-003b bound</code>
 
<code>subdev csimx307 3X-003b bound</code>
 +
 +
<code>subdev cssc132 3X-003b bound</code>
  
 
执行i2c控制脚本时,需使用-b选项来指明控制的对应摄像头。
 
执行i2c控制脚本时,需使用-b选项来指明控制的对应摄像头。
Line 405: Line 433:
 
具体使用说明请见:[[VEYE-MIPI-290/327/zh/i2c|VEYE-MIPI-327 I2C脚本使用说明]]。
 
具体使用说明请见:[[VEYE-MIPI-290/327/zh/i2c|VEYE-MIPI-327 I2C脚本使用说明]]。
  
*CS-MIPI-IMX307
+
*CS-MIPI-IMX307和CS-MIPI-SC132
  
具体使用说明请见:[[CS-MIPI-X i2c/zh|CS-MIPI-IMX307 I2C脚本使用说明]]。
+
具体使用说明请见:[[CS-MIPI-X i2c/zh|CS-MIPI-X I2C脚本使用说明]]。
 
===瑞泰RTSO-9001的补充说明===
 
===瑞泰RTSO-9001的补充说明===
  

Revision as of 09:21, 30 June 2020

English

如何在英伟达Jetsno TX2,AGX Xavier和Xavier NX平台使用VEYE系列和CS系列摄像头模组

概述

本文讲述怎样将VEYE系列和CS系列模组接入到英伟达公司的Jetson TX2和AGX Xavier开发板,Xavier NX Devkit以及我们兼容的其他TX2主板上。采用的软件版本为(Jetpack4.2.2,L4T版本r32.2.1)以及(Jetpack4.3,L4T版本r32.3.1)以及(Jetpack4.4,L4T版本r32.4.2),我们提供了编译好的固件和源代码两种方式来方便用户的使用。

VEYE-MIPI-327/CS-MIPI-IMX307是星光级内置ISP的摄像头模组,输出为MIPI-CSI2接口UYVY流模式。对于图像效果参数,我们并没有采用V4L2接口实现,而是采用了DRA(Directly Register Access)模式,我们提供了一组Shell脚本直接控制摄像头模组。

硬件准备及安装

我们设计了专用的转接板,支持6路摄像头,兼容TX2 Devkit和Xavier。

6cam interposer board connected with 6 cameras


英伟达TX2 Developer Kit

TX2 Devkit 6 cameras connection


英伟达AGX Xavier

转接板是兼容TX2转接板的,连接方式如图:

Connect VEYE cameras to AGX Xavier(绿色版本托板为临时版本,正式版本是黑色的)

英伟达Xavier NX Devkit

Xavier NX 的接口是兼容树莓派和Jetson Nano的。 连接方式如图:

Xavier NX connection with VEYE-MIPI-327
Xavier NX connection with VEYE-MIPI-327
Xavier NX connection with CS-MIPI-IMX307
Xavier NX connection with CS-MIPI-IMX307


整体烧写Jetson Xavier NX Devkit

客户可选择直接使用我们编译好的镜像进行系统更新,以支持我司摄像头模组。

  • 镜像下载路径:

链接:https://pan.baidu.com/s/1sWrcfEOivjuQ7T7P5bVcng

下载后请先解压后烧写。

如百度云盘下载过慢,可以单独联系我公司客服xumm@csoneplus.com索取。

  • 烧写方法

参考官方链接

更新Jetson TX2,AGX Xavier和Xavier NX系统

开发环境准备

  • 编译工具链

请参考这个链接安装编译工具链。

  • L4T源码和Rootfs

可以通过SDK Manager或者直接下载两种方式来获得源码。具体参考官方文档,此处不再赘述。

使用SDK Manager时同步代码采用如下指令:

- Jetpack4.2.2

./source_sync.sh -t tegra-l4t-r32.2.1

- Jetpack4.3

./source_sync.sh -t tegra-l4t-r32.3.1

- Jetpack4.4

./source_sync.sh -t tegra-l4t-r32.4.2

  • 配置开发环境

以下步骤假设SDK安装目录为<TOPDIR>,源代码在$L4T_DIR/sources目录。

- TX2@Jetpack4.2.2

export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P3310/

- TX2@Jetpack4.3

export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.3_Linux_P3310/

- AGX XavierJetpack4.2.2

export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.2.2_Linux_GA_P2888/

- AGX XavierJetpack4.3

export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.3_Linux_P2888/

- Xavier NX Jetpack4.4

export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT

- 通用部分

export L4T_DIR=$TOP_DIR/Linux_for_Tegra

export LOCALVERSION=-tegra

export LDK_ROOTFS_DIR=$TOP_DIR/Linux_for_Tegra/rootfs

export ARCH=arm64

export CROSS_COMPILE=aarch64-linux-gnu-

export CROSS32CC=arm-linux-gnueabihf-gcc

export TEGRA_KERNEL_OUT=$L4T_DIR/sources/kernel/out_kernel

export KERNEL_PATH=$L4T_DIR/sources/kernel/out_kernel

export NVIDIA_PATH=$L4T_DIR/sources/kernel/nvidia

export TX2_DTS_PATH=$L4T_DIR/sources/hardware/nvidia/platform/t18x

export XAVIER_DTS_PATH=$L4T_DIR/sources/hardware/nvidia/platform/t19x

cd $L4T_DIR/sources/kernel/kernel-4.9/

  • 生成默认版本烧写镜像,烧写默认镜像到板子,准备好L4T环境

cd $L4T_DIR

sudo ./apply_binaries.sh  

进入recovery mode并烧写标准版本镜像

- TX2

sudo ./flash.sh jetson-tx2 mmcblk0p1

- AGX Xavier

sudo ./flash.sh jetson-xavier mmcblk0p1

- Xavier NX Devkit

sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1

下载我们的bsp包

cd $L4T_DIR

git clone https://github.com/veyeimaging/nvidia_jetson_veye_bsp.git

export RELEASE_PACK_DIR=$L4T_DIR/nvidia_jetson_veye_bsp

bsp包包括以下主要内容:
  • 预编译好的linux kernel:Image
  • 预编译好的不同平台下的dtb
  • driver源码
  • dts源码
  • i2c通信工具集

使用预编译好Image和DTB

  • 升级Image文件

无论是使用预编译好的程序还是使用自行编译出的Image:

- TX2

把新的Image拷贝的TX2的/boot/目录下。

在Jetson TX2板子上执行

sudo cp <path to your Image dir>/Image /boot/Image -f

- AGX Xavier

在Host PC执行

cd $L4T_DIR

sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1

- Xavier NX

在Host PC执行

cd $L4T_DIR

sudo ./flash.sh -k kernel jetson-xavier-nx-devkit mmcblk0p1

  • 烧写DTS分区,进入烧写模式,在Host PC执行

cp <path to your dtb dir>/dtbfilename $L4T_DIR/kernel/dtb/ -f

cd $L4T_DIR

- TX2

sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1

- AGX Xavier

sudo ./flash.sh -r -k kernel-dtb jetson-xavier mmcblk0p1

- AGX Xavier

sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit mmcblk0p1

烧写完成后,断电重启。

使用源码进行编译

编译kernel
  • patch代码

cp $RELEASE_PACK_DIR/drivers_source/veyecam/* $NVIDIA_PATH/drivers/media/i2c/

- r32.2.1

cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.2.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig

- r32.3.1

cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.3.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig

- r32.4.2

cp $RELEASE_PACK_DIR/drivers_source/kernel_veyecam_config_32.4.2 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_veyecam_defconfig

  • 编译

cd $L4T_DIR/sources/kernel/kernel-4.9/

make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_veyecam_defconfig

make ARCH=arm64 O=$TEGRA_KERNEL_OUT Image -j4

编译完成的Image文件在 $TEGRA_KERNEL_OUT/arch/arm64/boot/Image,可以用于整体烧写,也可以用于动态升级。

以下用于整体烧写

sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $L4T_DIR/kernel/ -f

编译DTS
  • patch代码

- TX2@Jetpack4.2.2

cp $RELEASE_PACK_DIR/TX2/JetPack_4.2.2_Linux_GA_P3310/dts\ dtb/common/t18x/* -r $TX2_DTS_PATH/

对于CS-MIPI-IMX307

cp $RELEASE_PACK_DIR/TX2/JetPack_4.2.2_Linux_GA_P3310/dts\ dtb/CS-MIPI-IMX307/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/

对于VEYE-MIPI-327

cp $RELEASE_PACK_DIR/TX2/JetPack_4.2.2_Linux_GA_P3310/dts\ dtb/VEYE-MIPI-327/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/

- TX2@Jetpack4.3

cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/common/t18x/* -r $TX2_DTS_PATH/

对于CS-MIPI-IMX307

cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/CS-MIPI-IMX307/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/

对于CS-MIPI-SC132

cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/CS-MIPI-SC132/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/

对于VEYE-MIPI-327

cp $RELEASE_PACK_DIR/TX2/JetPack_4.3_Linux_P3310/dts\ dtb/VEYE-MIPI-327/tegra186-quill-p3310-1000-a00-00-base.dts $TX2_DTS_PATH/quill/kernel-dts/

- AGX Xavier@Jetpack4.2.2

cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.2.2_Linux_GA_P2888/dts\ dtb/common/t19x/* -r $XAVIER_DTS_PATH/

对于CS-MIPI-IMX307

cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.2.2_Linux_GA_P2888/dts\ dtb/CS-MIPI-IMX307/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/

对于VEYE-MIPI-327

cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.2.2_Linux_GA_P2888/dts\ dtb/VEYE-MIPI-327/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/

- AGX Xavier@Jetpack4.3

cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/common/t19x/* -r $XAVIER_DTS_PATH/

对于CS-MIPI-IMX307

cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/CS-MIPI-IMX307/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/

对于CS-MIPI-SC132

cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/CS-MIPI-SC132/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/

对于VEYE-MIPI-327

cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/VEYE-MIPI-327/tegra194-p2888-0001-p2822-0000.dts $XAVIER_DTS_PATH/galen/kernel-dts/

- Xavier NX@Jetpack4.4

cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/common/t19x/* -r $XAVIER_DTS_PATH/

对于CS-MIPI-IMX307

cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/CS-MIPI-IMX307/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/

对于CS-MIPI-SC132

cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/CS-MIPI-SC132/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/

对于VEYE-MIPI-327

cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/VEYE-MIPI-327/tegra194-p3509-0000-a00.dtsi $XAVIER_DTS_PATH/jakku/kernel-dts/common/

  • 编译

cd $L4T_DIR/sources/kernel/kernel-4.9/

make ARCH=arm64 O=$TEGRA_KERNEL_OUT dtbs

- TX2

cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb $L4T_DIR/kernel/dtb/

- AGX XAVIER

cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra194-p2888-0001-p2822-0000.dtb $L4T_DIR/kernel/dtb/

- XAVIER NX

cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra194-p3668-all-p3509-0000.dtb $L4T_DIR/kernel/dtb/

kernel和DTS编译完成后,可以按照上面的步骤升级Image和DTB。

应用和测试

系统状态检测

完成系统安装后,在Jetson TX2板端执行以下命令来检测是否正确连接摄像头。

  • VEYE-MIPI-327型号

dmesg | grep veye327  

应当有类似如下提示:

Detected VEYE327 sensor

subdev veye327 3X-003b bound

此外,检查/dev/videoX设备节点,应当是存在的。

  • CS-MIPI-IMX307型号

dmesg | grep csimx307  

应当有类似如下提示:

Detected CS307 sensor

subdev csimx307 3X-003b bound

此外,检查/dev/videoX设备节点,应当是存在的。

  • CS-MIPI-SC132型号

dmesg | grep cssc132  

应当有类似如下提示:

subdev cssc132 3X-003b bound

此外,检查/dev/videoX设备节点,应当是存在的。

视频流软件包和测试

我们的摄像头模组,在TX2系统中映射为/dev/videoX设备节点。X值是按照detect的逻辑顺序[0-5]递增的。举例说,如果只接入一个摄像头,则X为0。如果接入5个,则X体现为[0-4]。

gstreamer中,v4l2src可以通过指明device=/dev/videoX来访问不同的摄像头。

Gstreamer Usage
  • 视频预览1080p HD(硬件加速)

gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

  • 视频预览720p@60 HD(模组支持此分辨率时,硬件加速)

gst-launch-1.0 v4l2src ! "video/x-raw,format=(string)UYVY, width=(int)1280, height=(int)720, framerate=(fraction)60/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

  • 视频预览1280*1080@45fpsHD(硬件加速)

gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)1280, height=(int)1080,framerate=(fraction)45/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

  • 视频预览640*480@130fps(模组支持此分辨率时,硬件加速)

gst-launch-1.0 v4l2src ! "video/x-raw,format=(string)UYVY, width=(int)640, height=(int)480, framerate=(fraction)130/1" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! nvoverlaysink sync=false

  • 并列预览两路视频 1080p HD(硬件加速)

WIDTH=960

HEIGHT=540

CAPS="video/x-raw,format=(string)UYVY, width=1920, height=1080"

gst-launch-1.0 nvcompositor name=comp sink_0::xpos=0 sink_0::ypos=0 sink_0::width=$WIDTH sink_0::height=$HEIGHT sink_1::xpos=$WIDTH sink_1::ypos=0 sink_1::width=$WIDTH sink_1::height=$HEIGHT ! nvoverlaysink v4l2src device=/dev/video0 ! $CAPS ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420"! comp. v4l2src device=/dev/video1 ! $CAPS ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420"! comp.

  • 视频录像1080p HD(硬件加速)

gst-launch-1.0 v4l2src num-buffers=300 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! nvvidconv ! "video/x-raw(memory:NVMM),format=(string)I420" ! omxh264enc qp-range=20,20:20,20:-1,-1 ! matroskamux ! queue ! filesink location=videoname.mkv

  • 录像回放(硬件加速)

gst-launch-1.0 filesrc location=videoname.mkv ! matroskademux ! h264parse ! omxh264dec ! nvoverlaysink

  • 抓拍图片

gst-launch-1.0 v4l2src num-buffers=1 ! "video/x-raw,format=(string)UYVY, width=(int)1920, height=(int)1080" ! jpegenc ! filesink location=jpgname.jpg

视频控制软件包的使用

  • i2c bus说明:

ADP-N1共6个MIPI接口,对应的i2c地址为[30-35]。

dmesg 显示的3X部分一致。

subdev veye327 3X-003b bound

subdev csimx307 3X-003b bound

subdev cssc132 3X-003b bound

执行i2c控制脚本时,需使用-b选项来指明控制的对应摄像头。

  • VEYE-MIPI-327

具体使用说明请见:VEYE-MIPI-327 I2C脚本使用说明

  • CS-MIPI-IMX307和CS-MIPI-SC132

具体使用说明请见:CS-MIPI-X I2C脚本使用说明

瑞泰RTSO-9001的补充说明

硬件连接方法

CS-MIPI-IMX307 与瑞泰RTSO-9001(TX2)


与瑞泰RTSO-9001配套,需使用树莓派相机扩展板RTST-RPI转接板。

备注:当前版本的RTSO-9001的MIPI CSI-2接口供电能力不足以支撑我们摄像头的功率需求,需要额外5V供电给摄像头。上图中并未提现。

软件的补充说明

  • 针对瑞泰RTSO-9001,对应的目录为:

nvidia_jetson_veye_bsp\TX2\JetPack_4.2.2_Linux_RTSO-9001

  • 受与瑞泰公司协议限制,我方不发布源代码
  • 我方资料已提交瑞泰公司,建议客户与瑞泰联系获取完善版本的支持镜像

参考资料

Jetson start up: https://developer.nvidia.com/embedded/learn/getting-started-jetson

Jetson Download Center: https://developer.nvidia.com/embedded/downloads

Xavier NX: https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devkit

TX2 development kit: https://developer.nvidia.com/embedded/jetson-tx2-developer-kit

SDK Manager: https://docs.nvidia.com/sdk-manager/index.html

L4T Doc: https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3242/index.htm

TX2 user guide: link

北京瑞泰新时代公司网址:http://www.realtimes.cn/