TX2上硬件编解码加速CSI接口摄像头

时间:2024-03-19 15:41:05

1.TX2上的CSI硬件

  1. 1.官方的开发板把所为的六路CSI接到了一个60*2的接口的所谓camera development给了一个板载摄像头,毛病。如果你想自己把这六个接口用起来,一个转接口145☹再见。所以你不得不花点钱买个拓展版。
    TX2上硬件编解码加速CSI接口摄像头
    TX2上硬件编解码加速CSI接口摄像头

  2. 关于摄像头驱动
    Nvidia官方会有一个TX2 deriver package,里面有提供一部分的摄像头驱动可以在NVL4T docs文档里查看。
    TX2上硬件编解码加速CSI接口摄像头
    可以根据这些型号来购买摄像头。虽然都便宜。TX2上硬件编解码加速CSI接口摄像头
    NVidia提供了一个方便的库使得我们可以方便的自己安装对应sensor的驱动。作为请学生只买的48一个的ov。研究了一下how to add a module。
    TX2上硬件编解码加速CSI接口摄像头

In applications that support a direct V4L2 interface, use this interface to communicate to the NVIDIA V4L2 driver without having to use the camera core user mode library. Use this path for capturing RAW data from sensor or for validating sensor drivers.
The application uses the kernel mode V4L2 drivers as follows:

TX2上硬件编解码加速CSI接口摄像头

  • To add one or more camera modules to a device tree
  • 1Locate or create a tegra-camera-platform device node in the kernel source tree at:

/hardware/nvidia/platform/t19x/common/kernel-dts/t19x-common-modules/tegra194-camera-imx185-a00.dtsi

  • 2In a Tegra-camera-platform device node, create a module table (modules) with one or more modules.
    Each module must contain its basic information and the definition of the devices that are inside that module.

2.关于硬件编解码。

  • 1.视频编解码流程
  • TX2上硬件编解码加速CSI接口摄像头
  • 2.Deepstream上的硬件编解码例程。

在deepstream userGuide里有关于这个例程的介绍。Nvidia拥有独立的硬件解码模块DEC
samples里的DECPERF是关于硬件编解码的例程。

工作流程:

  1. 将数据包喂给流水线
  2. 添加解码任务
  3. 分析解码性能
    TX2上硬件编解码加速CSI接口摄像头
    1.第一步:创建一个DeviceWorker.

DeviceWorker负责整个DeepStream工作流程。它包括多通道解码和分析流水线维护。DeviceWorker由createDeviceWorker函数创建,具有多个通道(g_nChannels)和GPU ID(g_devID)作为参数。`

IDeviceWorker *pDeviceWorker = createDeviceWorker(g_nChannels, g_devID, g_maxBatchSize); 
 

2.第二步:数据输入

more data can be load. 
bool getData(uint8_t **ppBuf, int *pnBuf);
 // reset the dataProvider to reload from the video file from the beginning. 
void reload(); 

3.第三步:添加解码任务

// Add decode task, the parameter is the format of codec. 
pDeviceWorker->addDecodeTask(cudaVideoCodec_H264); 
 

4运行DeviceWorker

// Start and stop the DeviceWorker. 
pDeviceWorker->start();
 pDeviceWorker->stop();