How do I connect to the camera in the deepstream-dewarper-app?

Please provide complete information as applicable to your setup.

**• Hardware Platform Jetson
**• DeepStream Version 5.1
**• JetPack Version 4.5.1
**• TensorRT Version 7.1.3
**• NVIDIA GPU Driver Version
• Issue Type( questions, new requirements, bugs)

The examples on GitHub - NVIDIA-AI-IOT/Deepstream-Dewarper-App: This project demonstrate how to infer and track from a 360 videos by using the dewarper plugin. provide a description of the command line to work with:
./deepstream-dewarper-app [1:file sink|2: fakesink|3:display sink] [1:without tracking| 2: with tracking] [ <camera_id1> <config_file1>] [ <camera_id2> <config_file2>] … [ <camera_idN> <config_fileN>]
But it’s not clear what to write in <camera_idN>. Tried to specify /dev/video0, but it doesn’t work. Is it even possible to connect to the camera via deepstream-dewarper-app and get the video file with distortion corrected?

According to the code Deepstream-Dewarper-App/deepstream_dewarper_test.c at main · NVIDIA-AI-IOT/Deepstream-Dewarper-App (github.com), the command line should be :

./deepstream-dewarper-app [1:file sink|2: fakesink|3:display sink] [1:no tracking| 2:tracking] <uri1> <source id1> [<uri2> <source id2>] ... [<uriN> <source idN>]

E.G. For your two usb cameras

./deepstream-dewarper-app 2 1 v4l2:///dev/video0 0 v4l2:///dev/video1 1
1 Like

I run:

sudo ./deepstream-dewarper-app  2 1 v4l2://dev/video0 0 camera_config_dewarper.txt

with config:

[property]
#dewarp-dump-frames=10
output-width=3264
output-height=2464
# aisle-calibration-file property is getting used in case of deepstream-360d-app,
# if set below properties under group [surfaceX] will be ignored
#aisle-calibration-file=csv_files/nvaisle_2M.csv
# spot-calibration-file property is getting used in case of deepstream-360d-app,
# if set below properties under group [surfaceX] will be ignored
#spot-calibration-file=csv_files/nvspot_2M.csv

#########################################
# Note - Max 4 surfaces are supported
#########################################
num-batch-buffers=1 

[surface0]
# 1=PushBroom, 2=VertRadCyl 3= Perspective_Perspective FISH_PERSPECTIVE=4, FISH_FISH=5, FISH_CYL=6, FISH_EQUIRECT=7,
# FISH_PANINI=8, PERSPECTIVE_EQUIRECT=9, PERSPECTIVE_PANINI=10, EQUIRECT_CYLINDER=11, EQUIRECT_EQUIRECT=12 EQUIRECT_FISHEYE=13,
# EQUIRECT_PANINI=14, EQUIRECT_PERSPECTIVE=15, EQUIRECT_PUSHBROOM=16, EQUIRECT_STEREOGRAPHIC=17, EQUIRECT_VERTCYLINDER=18
projection-type=5
surface-index=0
#dewarped surface parameters
width=3264
height=2464
top-angle=90
bottom-angle=-90
pitch=0
yaw=0
roll=0
focal-length=350
rot-axes=2
src-fov=180
#control=1.0

I get this Error:

ERROR from element source: Cannot identify device 'dev/video0'.

In this output:

args1: v4l2://dev/video0args2: 0Warning: 'input-dims' parameter has been deprecated. Use 'infer-dims' instead.

(deepstream-dewarper-app:15083): GStreamer-WARNING **: 10:56:53.205: Name 'nvinfer0' is not unique in bin 'dewarper-app-pipeline', not adding

(deepstream-dewarper-app:15083): GStreamer-WARNING **: 10:56:53.205: Name 'nvtracker' is not unique in bin 'dewarper-app-pipeline', not adding

(deepstream-dewarper-app:15083): GStreamer-WARNING **: 10:56:53.205: Name 'nvtiler' is not unique in bin 'dewarper-app-pipeline', not adding

(deepstream-dewarper-app:15083): GStreamer-WARNING **: 10:56:53.206: Name 'nv-onscreendisplay' is not unique in bin 'dewarper-app-pipeline', not adding

(deepstream-dewarper-app:15083): GStreamer-WARNING **: 10:56:53.206: Name 'fake-renderer' is not unique in bin 'dewarper-app-pipeline', not adding
Now playing:
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-5.1/lib/libnvds_mot_klt.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF
gstnvtracker: Past frame output is OFF
0:00:05.132980780 15083   0x55b5b81a70 INFO                 nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<nvinfer0> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1702> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/Deepstream-Dewarper-App/inference_files/resnet34_peoplenet_pruned.etlt_b1_gpu0_fp16.engine
INFO: [Implicit Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1         3x544x960       
1   OUTPUT kFLOAT output_bbox/BiasAdd 12x34x60        
2   OUTPUT kFLOAT output_cov/Sigmoid 3x34x60         

0:00:05.133141357 15083   0x55b5b81a70 INFO                 nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<nvinfer0> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1806> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/Deepstream-Dewarper-App/inference_files/resnet34_peoplenet_pruned.etlt_b1_gpu0_fp16.engine
0:00:05.155372573 15083   0x55b5b81a70 INFO                 nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<nvinfer0> [UID 1]: Load new model:inference_files/config_infer_primary_peoplenet.txt sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
Running...
ERROR from element source: Cannot identify device 'dev/video0'.
Error details: v4l2_calls.c(609): gst_v4l2_open (): /GstPipeline:dewarper-app-pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstV4l2Src:source:
system error: No such file or directory
Returned, stopping playback
Average fps 0.000233
Deleting pipeline

A little typo, it is “v4l2:///dev/video0” instead of “v4l2://dev/video0”.

Yes, I noticed this error and fixed it, but the program did not work properly again:
$ sudo ./deepstream-dewarper-app 2 1 v4l2:///dev/video0 0 camera_config_dewarper.txt
I get this output:

args1: v4l2:///dev/video0args2: 0Warning: 'input-dims' parameter has been deprecated. Use 'infer-dims' instead.

(deepstream-dewarper-app:18606): GStreamer-WARNING **: 12:22:04.082: Name 'nvinfer0' is not unique in bin 'dewarper-app-pipeline', not adding

(deepstream-dewarper-app:18606): GStreamer-WARNING **: 12:22:04.083: Name 'nvtracker' is not unique in bin 'dewarper-app-pipeline', not adding

(deepstream-dewarper-app:18606): GStreamer-WARNING **: 12:22:04.083: Name 'nvtiler' is not unique in bin 'dewarper-app-pipeline', not adding

(deepstream-dewarper-app:18606): GStreamer-WARNING **: 12:22:04.083: Name 'nv-onscreendisplay' is not unique in bin 'dewarper-app-pipeline', not adding

(deepstream-dewarper-app:18606): GStreamer-WARNING **: 12:22:04.083: Name 'fake-renderer' is not unique in bin 'dewarper-app-pipeline', not adding
Now playing:
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-5.1/lib/libnvds_mot_klt.so
gstnvtracker: Optional NvMOT_RemoveStreams not implemented
gstnvtracker: Batch processing is OFF
gstnvtracker: Past frame output is OFF
0:00:05.209767887 18606   0x556651b870 INFO                 nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<nvinfer0> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1702> [UID = 1]: deserialized trt engine from :/opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/Deepstream-Dewarper-App/inference_files/resnet34_peoplenet_pruned.etlt_b1_gpu0_fp16.engine
INFO: [Implicit Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1         3x544x960       
1   OUTPUT kFLOAT output_bbox/BiasAdd 12x34x60        
2   OUTPUT kFLOAT output_cov/Sigmoid 3x34x60         

0:00:05.209928308 18606   0x556651b870 INFO                 nvinfer gstnvinfer.cpp:619:gst_nvinfer_logger:<nvinfer0> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:1806> [UID = 1]: Use deserialized engine model: /opt/nvidia/deepstream/deepstream-5.1/sources/apps/sample_apps/Deepstream-Dewarper-App/inference_files/resnet34_peoplenet_pruned.etlt_b1_gpu0_fp16.engine
0:00:05.234142461 18606   0x556651b870 INFO                 nvinfer gstnvinfer_impl.cpp:313:notifyLoadModelStatus:<nvinfer0> [UID 1]: Load new model:inference_files/config_infer_primary_peoplenet.txt sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
Opening in BLOCKING MODE
Available Sensor modes :
Resolution: 3264 x 2464 ; Framerate = 21.000000; Analog Gain Range Min 1.000000, Max 10.625000, Exposure Range Min 13000, Max 683709000

Resolution: 3264 x 1848 ; Framerate = 28.000001; Analog Gain Range Min 1.000000, Max 10.625000, Exposure Range Min 13000, Max 683709000

Resolution: 1920 x 1080 ; Framerate = 29.999999; Analog Gain Range Min 1.000000, Max 10.625000, Exposure Range Min 13000, Max 683709000

Resolution: 1640 x 1232 ; Framerate = 29.999999; Analog Gain Range Min 1.000000, Max 10.625000, Exposure Range Min 13000, Max 683709000

Resolution: 1280 x 720 ; Framerate = 59.999999; Analog Gain Range Min 1.000000, Max 10.625000, Exposure Range Min 13000, Max 683709000

Resolution: 1280 x 720 ; Framerate = 120.000005; Analog Gain Range Min 1.000000, Max 10.625000, Exposure Range Min 13000, Max 683709000

DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
DEFAULT no IOCTL called
Running...
Not Implemented
Segmentation fault

As I understand it, the problem is that NvMOT_RemoveStreams is not implemented in /opt/nvidia/deepstream/deepstream-5.1/lib/libnvds_mot_klt.so. If I’m right, how do I fix it?

No. Even if the NvMOT_RemoveStreams is not implemented, nvstracker will use default functions inside the library. The failure is not caused by nvtracker.

The problem may related to your camera. It is recommended to use gst-launch to figure out the correct camera pipeline and then change the deepstream sample app according to the correct pipeline.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.