Difference between revisions of "VEYE CS Camera for Jetson TX2/zh"
(→开发环境准备) |
(→概述) |
||
Line 4: | Line 4: | ||
===概述=== | ===概述=== | ||
− | 本文讲述怎样将VEYE系列和CS系列模组接入到英伟达公司的Jetson TX2和AGX | + | 本文讲述怎样将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脚本直接控制摄像头模组。 | VEYE-MIPI-327/CS-MIPI-IMX307是星光级内置ISP的摄像头模组,输出为MIPI-CSI2接口UYVY流模式。对于图像效果参数,我们并没有采用V4L2接口实现,而是采用了DRA(Directly Register Access)模式,我们提供了一组Shell脚本直接控制摄像头模组。 | ||
Line 19: | Line 19: | ||
<br /> | <br /> | ||
− | ==== | + | ====英伟达AGX Xavier==== |
转接板是兼容TX2转接板的,连接方式如图: | 转接板是兼容TX2转接板的,连接方式如图: | ||
[[File:AGX XAVIER 6cam.jpg|center|thumb|800x800px|Connect VEYE cameras to AGX Xavier(绿色版本托板为临时版本,正式版本是黑色的) ]] | [[File:AGX XAVIER 6cam.jpg|center|thumb|800x800px|Connect VEYE cameras to AGX Xavier(绿色版本托板为临时版本,正式版本是黑色的) ]] | ||
− | |||
− | ===更新Jetson | + | ==== 英伟达Xavier NX Devkit ==== |
+ | Xavier NX 的接口是兼容树莓派和Jetson Nano的。 连接方式如图(TODO): | ||
+ | |||
+ | ===更新Jetson TX2,AGX Xavier和Xavier NX系统=== | ||
====开发环境准备==== | ====开发环境准备==== | ||
Line 45: | Line 47: | ||
<code>./source_sync.sh -t tegra-l4t-r32.3.1</code> | <code>./source_sync.sh -t tegra-l4t-r32.3.1</code> | ||
+ | |||
+ | ''- Jetpack4.4'' | ||
+ | |||
+ | <code>./source_sync.sh -t tegra-l4t-r32.4.2</code> | ||
*配置开发环境 | *配置开发环境 | ||
Line 65: | Line 71: | ||
<code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.3_Linux_P2888/</code> | <code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.3_Linux_P2888/</code> | ||
+ | |||
+ | - ''Xavier NX Jetpack4.4'' | ||
+ | |||
+ | <code>export TOP_DIR=/home/xumm/nvidia/nvidia_sdk/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT</code> | ||
- 通用部分 | - 通用部分 | ||
Line 107: | Line 117: | ||
<code>sudo ./flash.sh jetson-xavier mmcblk0p1</code> | <code>sudo ./flash.sh jetson-xavier mmcblk0p1</code> | ||
+ | |||
+ | ''- Xavier NX Devkit'' | ||
+ | |||
+ | <code>sudo ./flash.sh jetson-xavier-nx-devkit mmcblk0p1</code> | ||
====下载我们的bsp包==== | ====下载我们的bsp包==== | ||
<code>cd $L4T_DIR</code> | <code>cd $L4T_DIR</code> | ||
Line 143: | Line 157: | ||
<code>sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1</code> | <code>sudo ./flash.sh -k kernel jetson-xavier mmcblk0p1</code> | ||
+ | |||
+ | ''- Xavier NX'' | ||
+ | |||
+ | 在Host PC执行 | ||
+ | |||
+ | <code>cd $L4T_DIR</code> | ||
+ | |||
+ | <code>sudo ./flash.sh -k kernel jetson-xavier-nx-devkit mmcblk0p1</code> | ||
*烧写DTS分区,进入烧写模式,在Host PC执行 | *烧写DTS分区,进入烧写模式,在Host PC执行 | ||
Line 157: | Line 179: | ||
<code>sudo ./flash.sh -r -k kernel-dtb jetson-xavier mmcblk0p1</code> | <code>sudo ./flash.sh -r -k kernel-dtb jetson-xavier mmcblk0p1</code> | ||
+ | |||
+ | ''- AGX Xavier'' | ||
+ | |||
+ | <code>sudo ./flash.sh -r -k kernel-dtb jetson-xavier-nx-devkit mmcblk0p1</code> | ||
烧写完成后,断电重启。 | 烧写完成后,断电重启。 | ||
Line 173: | Line 199: | ||
''- 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_csimx307veye327_config_32.3.1 $L4T_DIR/sources/kernel/kernel-4.9/arch/arm64/configs/tegra_csimx307veye327_defconfig</code> |
+ | |||
+ | ''- 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> | ||
*编译 | *编译 | ||
Line 240: | Line 270: | ||
<code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/VEYE-MIPI-327/tegra194-p2888-0001-p2822-0000.dts $TX2_DTS_PATH/galen/kernel-dts/</code> | <code>cp $RELEASE_PACK_DIR/AGX-Xaviar/JetPack_4.3_Linux_P2888/dts\ dtb/VEYE-MIPI-327/tegra194-p2888-0001-p2822-0000.dts $TX2_DTS_PATH/galen/kernel-dts/</code> | ||
+ | |||
+ | ''- Xavier NX@Jetpack4.4'' | ||
+ | |||
+ | <code>cp $RELEASE_PACK_DIR/Xavier-NX/JetPack_4.4_DP_Linux_DP_JETSON_XAVIER_NX_DEVKIT/dts\ dtb/common/t19x/* -r $XAVIER_DTS_PATH/</code> | ||
+ | |||
+ | 对于CS-MIPI-IMX307 | ||
+ | |||
+ | <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 $TX2_DTS_PATH/jakku/kernel-dts/common/</code> | ||
+ | |||
+ | 对于VEYE-MIPI-327 | ||
+ | |||
+ | <code>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 $TX2_DTS_PATH/jakku/kernel-dts/common/</code> | ||
*编译 | *编译 | ||
Line 251: | Line 293: | ||
<code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb $L4T_DIR/kernel/dtb/</code> | <code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb $L4T_DIR/kernel/dtb/</code> | ||
− | ''- XAVIER'' | + | ''- AGX XAVIER'' |
<code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra194-p2888-0001-p2822-0000.dtb $L4T_DIR/kernel/dtb/</code> | <code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra194-p2888-0001-p2822-0000.dtb $L4T_DIR/kernel/dtb/</code> | ||
+ | |||
+ | ''- XAVIER NX'' | ||
+ | |||
+ | <code>cp $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/tegra194-p3668-all-p3509-0000.dtb $L4T_DIR/kernel/dtb/</code> | ||
kernel和DTS编译完成后,可以按照上面的步骤升级Image和DTB。 | kernel和DTS编译完成后,可以按照上面的步骤升级Image和DTB。 | ||
Line 366: | Line 412: | ||
===参考资料=== | ===参考资料=== | ||
Jetson start up: https://developer.nvidia.com/embedded/learn/getting-started-jetson | Jetson start up: https://developer.nvidia.com/embedded/learn/getting-started-jetson | ||
+ | |||
+ | Xavier NX: https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devki | ||
TX2 development kit: https://developer.nvidia.com/embedded/jetson-tx2-developer-kit | TX2 development kit: https://developer.nvidia.com/embedded/jetson-tx2-developer-kit | ||
SDK Manager: https://docs.nvidia.com/sdk-manager/index.html | 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: [https://developer.download.nvidia.cn/embedded/L4T/r28_Release_v2.0/GA/Docs/Jetson_TX1_and_TX2_Developer_Kits_User_Guide.pdf?lumI95GW6BEyMmhP1Is8E79OYo105-tpsC2bOVQmBZ6Tw8AkLU4pSDMPCuzOaEonWMiDO2hliXbNvtkH9do81TNIXmLZGGoV7xoEehyEgfc2WO8e0Czz5chLSHoCqIuPLL1 link] | TX2 user guide: [https://developer.download.nvidia.cn/embedded/L4T/r28_Release_v2.0/GA/Docs/Jetson_TX1_and_TX2_Developer_Kits_User_Guide.pdf?lumI95GW6BEyMmhP1Is8E79OYo105-tpsC2bOVQmBZ6Tw8AkLU4pSDMPCuzOaEonWMiDO2hliXbNvtkH9do81TNIXmLZGGoV7xoEehyEgfc2WO8e0Czz5chLSHoCqIuPLL1 link] |
Revision as of 20:26, 8 June 2020
如何在英伟达Jetsno TX2和AGX Xavier平台使用VEYE系列和CS系列摄像头模组
1 概述
本文讲述怎样将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脚本直接控制摄像头模组。
2 硬件准备及安装
我们设计了专用的转接板,支持6路摄像头,兼容TX2 Devkit和Xavier。
2.1 英伟达TX2 Developer Kit
2.2 英伟达AGX Xavier
转接板是兼容TX2转接板的,连接方式如图:
2.3 英伟达Xavier NX Devkit
Xavier NX 的接口是兼容树莓派和Jetson Nano的。 连接方式如图(TODO):
3 更新Jetson TX2,AGX Xavier和Xavier NX系统
3.1 开发环境准备
- 编译工具链
请参考这个链接安装编译工具链。
- 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
3.2 下载我们的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
3.2.1 bsp包包括以下主要内容:
- 预编译好的linux kernel:Image
- 预编译好的不同平台下的dtb
- driver源码
- dts源码
- i2c通信工具集
3.3 使用预编译好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
烧写完成后,断电重启。
3.4 使用源码进行编译
3.4.1 编译kernel
- patch代码
cp $RELEASE_PACK_DIR/drivers_source/cs_imx307\ veye327/* $NVIDIA_PATH/drivers/media/i2c/
- r32.2.1
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
- r32.3.1
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
- r32.4.2
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
- 编译
cd $L4T_DIR/sources/kernel/kernel-4.9/
make ARCH=arm64 O=$TEGRA_KERNEL_OUT tegra_csimx307veye327_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
3.4.2 编译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/
对于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 $TX2_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 $TX2_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 $TX2_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 $TX2_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 $TX2_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 $TX2_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。
4 应用和测试
4.1 系统状态检测
完成系统安装后,在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设备节点,应当是存在的。
4.2 视频流软件包和测试
我们的摄像头模组,在TX2系统中映射为/dev/videoX设备节点。X值是按照detect的逻辑顺序[0-5]递增的。举例说,如果只接入一个摄像头,则X为0。如果接入5个,则X体现为[0-4]。
gstreamer中,v4l2src可以通过指明device=/dev/videoX来访问不同的摄像头。
4.2.1 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
- 视频预览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
4.3 视频控制软件包的使用
- i2c bus说明:
ADP-N1共6个MIPI接口,对应的i2c地址为[30-35]。
dmesg 显示的3X部分一致。
subdev veye327 3X-003b bound
subdev csimx307 3X-003b bound
执行i2c控制脚本时,需使用-b选项来指明控制的对应摄像头。
- VEYE-MIPI-327
具体使用说明请见:VEYE-MIPI-327 I2C脚本使用说明。
- CS-MIPI-IMX307
具体使用说明请见:CS-MIPI-IMX307 I2C脚本使用说明。
5 瑞泰RTSO-9001的补充说明
5.1 硬件连接方法
与瑞泰RTSO-9001配套,需使用树莓派相机扩展板RTST-RPI转接板。
备注:当前版本的RTSO-9001的MIPI CSI-2接口供电能力不足以支撑我们摄像头的功率需求,需要额外5V供电给摄像头。上图中并未提现。
5.2 软件的补充说明
- 针对瑞泰RTSO-9001,对应的目录为:
nvidia_jetson_veye_bsp\TX2\JetPack_4.2.2_Linux_RTSO-9001
- 受与瑞泰公司协议限制,我方不发布源代码
- 我方资料已提交瑞泰公司,建议客户与瑞泰联系获取完善版本的支持镜像
6 参考资料
Jetson start up: https://developer.nvidia.com/embedded/learn/getting-started-jetson
Xavier NX: https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devki
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/