Bodyposenet I want to start with usb camera video 0

I downloaded tao apps from git hub.

I want to start bodyposenet with video 0 on usb.

But I don’t know how to write yaml.

How should I write it?


[source0]

enable=1

#Type - 1=CameraV4L2 2=URI 3=MultiURI

type=1

camera-width=640

camera-height=480

camera-fps-n=30

camera-fps-d=1

camera-v4l2-dev-node=0

■ bodyposenet example yaml

./deepstream-bodypose2d-app 4 ../../../models/bodypose2d/model.etlt 2345 8554 v4l2:///dev/video0 test.mp4
Request sink_0 pad from streammux
Please reach RTSP with rtsp://ip:8554/ds-out-avc
Now playing: v4l2:///dev/video0
WARNING: [TRT]: CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
WARNING: [TRT]: CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
0:00:05.491902426 37963 0x559d91ed1a90 INFO                 nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-infer-engine1> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1909> [UID = 1]: deserialized trt engine from :/home/user/workspace/nvidia/deepstream_tao_apps/models/bodypose2d/model.etlt_b32_gpu0_fp16.engine
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [FullDims Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1:0       288x384x3       min: 1x288x384x3     opt: 32x288x384x3    Max: 32x288x384x3    
1   OUTPUT kFLOAT heatmap_out/BiasAdd:0 36x48x19        min: 0               opt: 0               Max: 0               
2   OUTPUT kFLOAT conv2d_transpose_1/BiasAdd:0 144x192x38      min: 0               opt: 0               Max: 0               

0:00:05.610762783 37963 0x559d91ed1a90 INFO                 nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-infer-engine1> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2012> [UID = 1]: Use deserialized engine model: /home/user/workspace/nvidia/deepstream_tao_apps/models/bodypose2d/model.etlt_b32_gpu0_fp16.engine
0:00:05.848245554 37963 0x559d91ed1a90 INFO                 nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-infer-engine1> [UID 1]: Load new model:../../../configs/bodypose2d_tao/bodypose2d_pgie_config.txt sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
Running...
In cb_newpad
Failed to link decoderbin src pad to converter sink pad
###Decodebin did not pick nvidia decoder plugin.
ERROR from element source: Internal data stream error.
Error details: gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstV4l2Src:source:
streaming stopped, reason not-linked (-1)
Returned, stopping playback
Average fps 0.000233
Totally 0 persons are inferred
Deleting pipeline

You can try format with list: v4l2:///dev/video0 (Assume you have only one USB camera and the index is 0).
From the source code you can see he source-list is parsed by function nvds_parse_source_list and the source is created by function create_source_bin, which uses plugin uridecodebin and it has format v4l2:///* as above, refer the format FAQ here.

I have written the following settings in bodypose2d_app_config.yml, but I get an error.

source-list:
#  list: file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4;file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
  list: v4l2:///dev/video0
GST_DEBUG=3 ./deepstream-bodypose2d-app bodypose2d_app_config.yml 
Request sink_0 pad from streammux
!! [WARNING] Unknown param found : type
!! [WARNING] Unknown param found : enc
!! [WARNING] Unknown param found : udpport
!! [WARNING] Unknown param found : rtspport
!! [WARNING] Unknown param found : filename
total 1 item
group model-config found 0
Now playing: SESSION_MANAGER=local/user-desktop:@/tmp/.ICE-unix/1831,unix/user-desktop:/tmp/.ICE-unix/1831
0:00:00.050698455 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:3057:gst_v4l2_object_get_nearest_size:<nvvideo-h264enc:sink> Unable to try format: Unknown error -1
0:00:00.050710525 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:2942:gst_v4l2_object_probe_caps_for_format:<nvvideo-h264enc:sink> Could not probe minimum capture size for pixelformat YM12
0:00:00.050715705 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:3057:gst_v4l2_object_get_nearest_size:<nvvideo-h264enc:sink> Unable to try format: Unknown error -1
0:00:00.050720525 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:2948:gst_v4l2_object_probe_caps_for_format:<nvvideo-h264enc:sink> Could not probe maximum capture size for pixelformat YM12
0:00:00.050727825 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:2395:gst_v4l2_object_add_interlace_mode:0x5632d73e63e0 Failed to determine interlace mode
0:00:00.050736905 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:3057:gst_v4l2_object_get_nearest_size:<nvvideo-h264enc:sink> Unable to try format: Unknown error -1
0:00:00.050741385 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:2942:gst_v4l2_object_probe_caps_for_format:<nvvideo-h264enc:sink> Could not probe minimum capture size for pixelformat NM12
0:00:00.050745805 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:3057:gst_v4l2_object_get_nearest_size:<nvvideo-h264enc:sink> Unable to try format: Unknown error -1
0:00:00.050750405 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:2948:gst_v4l2_object_probe_caps_for_format:<nvvideo-h264enc:sink> Could not probe maximum capture size for pixelformat NM12
0:00:00.050755086 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:2395:gst_v4l2_object_add_interlace_mode:0x5632d73e63e0 Failed to determine interlace mode
0:00:00.050781246 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:3057:gst_v4l2_object_get_nearest_size:<nvvideo-h264enc:src> Unable to try format: Unknown error -1
0:00:00.050786186 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:2942:gst_v4l2_object_probe_caps_for_format:<nvvideo-h264enc:src> Could not probe minimum capture size for pixelformat H264
0:00:00.050790336 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:3057:gst_v4l2_object_get_nearest_size:<nvvideo-h264enc:src> Unable to try format: Unknown error -1
0:00:00.050794736 55385 0x5632d72dfb80 WARN                    v4l2 gstv4l2object.c:2948:gst_v4l2_object_probe_caps_for_format:<nvvideo-h264enc:src> Could not probe maximum capture size for pixelformat H264
WARNING: [TRT]: CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
WARNING: [TRT]: CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage and speed up TensorRT initialization. See "Lazy Loading" section of CUDA documentation https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#lazy-loading
0:00:05.031777890 55385 0x5632d72dfb80 INFO                 nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-infer-engine1> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1909> [UID = 1]: deserialized trt engine from :/home/user/workspace/nvidia/deepstream_tao_apps/models/bodypose2d/model.etlt_b32_gpu0_fp16.engine
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [FullDims Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1:0       288x384x3       min: 1x288x384x3     opt: 32x288x384x3    Max: 32x288x384x3    
1   OUTPUT kFLOAT heatmap_out/BiasAdd:0 36x48x19        min: 0               opt: 0               Max: 0               
2   OUTPUT kFLOAT conv2d_transpose_1/BiasAdd:0 144x192x38      min: 0               opt: 0               Max: 0               

0:00:05.150303354 55385 0x5632d72dfb80 INFO                 nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-infer-engine1> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2012> [UID = 1]: Use deserialized engine model: /home/user/workspace/nvidia/deepstream_tao_apps/models/bodypose2d/model.etlt_b32_gpu0_fp16.engine
0:00:05.349866059 55385 0x5632d72dfb80 INFO                 nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-infer-engine1> [UID 1]: Load new model:/home/user/workspace/nvidia/deepstream_tao_apps/configs/bodypose2d_tao/bodypose2d_pgie_config.yml sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
Running...
In cb_newpad
Failed to link decoderbin src pad to converter sink pad
###Decodebin did not pick nvidia decoder plugin.
0:00:06.378225559 55385 0x5632d7004b60 WARN          v4l2bufferpool gstv4l2bufferpool.c:809:gst_v4l2_buffer_pool_start:<source:pool:src> Uncertain or not enough buffers, enabling copy threshold
0:00:07.027110741 55385 0x5632d7004b60 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<source> error: Internal data stream error.
0:00:07.027128541 55385 0x5632d7004b60 WARN                 basesrc gstbasesrc.c:3072:gst_base_src_loop:<source> error: streaming stopped, reason not-linked (-1)
ERROR from element source: Internal data stream error.
Error details: gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin/GstV4l2Src:source:
streaming stopped, reason not-linked (-1)
Returned, stopping playback
Average fps 0.000233
Totally 0 persons are inferred
Deleting pipeline
v4l2-ctl --list-formats-ext -d /dev/video0
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture

	[0]: 'MJPG' (Motion-JPEG, compressed)
		Size: Discrete 1920x1080
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1024x768
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.008s (120.101 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.017s (60.000 fps)
		Size: Discrete 1280x1024
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 320x240
			Interval: Discrete 0.008s (120.101 fps)
	[1]: 'YUYV' (YUYV 4:2:2)
		Size: Discrete 1920x1080
			Interval: Discrete 0.167s (6.000 fps)
		Size: Discrete 1280x720
			Interval: Discrete 0.111s (9.000 fps)
		Size: Discrete 1024x768
			Interval: Discrete 0.167s (6.000 fps)
		Size: Discrete 640x480
			Interval: Discrete 0.033s (30.000 fps)
		Size: Discrete 800x600
			Interval: Discrete 0.050s (20.000 fps)
		Size: Discrete 1280x1024
			Interval: Discrete 0.167s (6.000 fps)
		Size: Discrete 320x240
			Interval: Discrete 0.033s (30.000 fps)

If I want to run without customization, does the USB camera have to support one of the following formats?

YM12
NM12
H264

The error changed when I set the output type to 2:fake.

output: ## 1:file ouput

1:file ouput 2:fake output 3:eglsink output 4:RTSP output

type: 2

GST_DEBUG=3 ./deepstream-bodypose2d-app bodypose2d_app_config.yml 
Request sink_0 pad from streammux
total 1 item
group model-config found 0
Now playing: SESSION_MANAGER=local/toyoaki-desktop:@/tmp/.ICE-unix/1831,unix/toyoaki-desktop:/tmp/.ICE-unix/1831
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
0:00:04.482589768 69773 0x55b0614ce920 INFO                 nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-infer-engine1> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1909> [UID = 1]: deserialized trt engine from :/home/toyoaki/workspace/nvidia/deepstream_tao_apps/models/bodypose2d/model.etlt_b32_gpu0_fp16.engine
INFO: ../nvdsinfer/nvdsinfer_model_builder.cpp:610 [FullDims Engine Info]: layers num: 3
0   INPUT  kFLOAT input_1:0       288x384x3       min: 1x288x384x3     opt: 32x288x384x3    Max: 32x288x384x3    
1   OUTPUT kFLOAT heatmap_out/BiasAdd:0 36x48x19        min: 0               opt: 0               Max: 0               
2   OUTPUT kFLOAT conv2d_transpose_1/BiasAdd:0 144x192x38      min: 0               opt: 0               Max: 0               

0:00:04.666677438 69773 0x55b0614ce920 INFO                 nvinfer gstnvinfer.cpp:680:gst_nvinfer_logger:<primary-infer-engine1> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2012> [UID = 1]: Use deserialized engine model: /home/toyoaki/workspace/nvidia/deepstream_tao_apps/models/bodypose2d/model.etlt_b32_gpu0_fp16.engine
0:00:04.859123175 69773 0x55b0614ce920 INFO                 nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-infer-engine1> [UID 1]: Load new model:/home/toyoaki/workspace/nvidia/deepstream_tao_apps/configs/bodypose2d_tao/bodypose2d_pgie_config.yml sucessfully
Decodebin child added: source
Decodebin child added: decodebin0

We can support the H264 format. You can set the camera output format to h264.

In that case, would real-time video not be supported?
Is it possible to receive the video via RTSP?

Yes. We can support RTSP source. But it strictly follows RFC 2326. https://gstreamer.freedesktop.org/documentation/rtsp/rtspsrc.html?gi-language=c

Thank you very much.
Could you please tell me how to write URLs in yaml?

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Please refedoesn’the demo: bodypose2d_app_config.yml

list: rtsp://xxxxx

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