DeepStream with websocket

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson Orin Nano)
• DeepStream Version: 7.1
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Hi there,

is it possible to use deepstream with websocket,
so I have a frontend application, when a user uploads a video, I need to run the video in deepstream and send the predictions to the frontend, in real time.

Is it correct to use websocket to do this? or Is there anything in deepstream that can solve this?

thenks

what predictions do you want to do? only detection? what prediction results do you want to send back? only bboxes or video with bboxes?
Yes. after a user uploads a video. You may use DeepStream to do inference on the video and get the inference results in real time. Here are some ideas.

  1. If you want to use websocket to send, please refer to the native sample deepstream-test1. All object bboxes can be got from object meta, then you may send the bboxes to client via websocket.
  2. If you want to send video with bboxes back, you may use RTSP server. Please refer to native sample deepstream-app, which supports RTSPStreaming.

Thanks for the reply!

I’m currently using my custom yolo ball detection model. After a user uploads a video, I am running the video in DeepStream and send results to the frontend frame by frame using websocket with its bboxes, so I am visualizing it on the frontend in real time.

but the process is very slow like fps ~ 1-2

that’s why i am asking Is there anything in deepstream that can solve this slow fps
aslo am using python to send results to frontend (FYI)

thanks

  1. regarding " frame by frame using websocket with its bboxes", have you already drawn bboxes on the video before sending? did you use websocket to send the encoded stream?
  2. using RTSP/RTP protocol to sending video is recommended. Please refer to this Python sample.
1 Like

Thanks for the reply!

I tried running deepstream_test1_rtsp_out.py and it worked, but I can’t see the stream because I’m connected to the Jetson Orin nano via SSH. how can i see stream?

thanks

The RTSP URL is printed on the terminal, for example, “rtsp://localhost:%d/ds-test”. you can use player to play the RTSP stream.

1 Like

Thanks for the reply!

Since the deepstream_test1_rtsp_out.py file only supports h264_elementary_stream, can it be made to also support .mp4 video files?

thanks

do you mean using rtsp to transimit mp4 or outputting mp4 file instead of rtsp server?

1 Like

no i mean i can only run it with h264_elementary_stream:
python deepstream_test1_rtsp_out.py -i /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/streams/sample_720p.h264

but when i change input path (-i) to .mp4 video: python deepstream_test1_rtsp_out.py -i /opt/nvidia/deepstream/deepstream/sources/deepstream_python_apps/apps/streams/sample_720p.mp4
it is not working

Thanks for the reply!

i fixed it by add uridecodebin to the pipline

thanks

sorry one question

deepstream_test1_rtsp_out.py is running successfully but after a few frames I get this error

Frame Number=1178 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1179 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1180 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1181 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1182 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1183 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1184 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1185 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1186 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1187 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1188 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1189 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1190 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1191 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1192 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1193 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1194 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1195 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1196 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1197 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1198 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1199 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1200 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1201 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1202 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1203 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1204 Number of Objects=3 Vehicle_count=1 Person_count=2
Frame Number=1205 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1206 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1207 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1208 Number of Objects=2 Vehicle_count=1 Person_count=1
Frame Number=1209 Number of Objects=3 Vehicle_count=1 Person_count=2
/dvs/git/dirty/git-master_linux/nvutils/nvbufsurftransform/nvbufsurftransform_copy.cpp:438: => Failed in mem copy

ERROR: Failed to make stream wait on event, cuda err_no:700, err_str:cudaErrorIllegalAddress
ERROR: Preprocessor transform input data failed., nvinfer error:NVDSINFER_CUDA_ERROR
0:02:29.997338428 586966 0xaaaadf097400 WARN                 nvinfer gstnvinfer.cpp:1420:gst_nvinfer_input_queue_loop:<primary-inference> error: Failed to queue input batch for inferencing
Error: gst-stream-error-quark: Failed to queue input batch for inferencing (1): /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(1420): gst_nvinfer_input_queue_loop (): /GstPipeline:pipeline0/GstNvInfer:primary-inference
ERROR: Failed to synchronize on cuda copy-coplete-event, cuda err_no:700, err_str:cudaErrorIllegalAddress
0:02:30.038101682 586966 0xaaaadf010760 WARN                 nvinfer gstnvinfer.cpp:2461:gst_nvinfer_output_loop:<primary-inference> error: Failed to dequeue output from inferencing. NvDsInferContext error: NVDSINFER_CUDA_ERROR
0:02:30.038202549 586966 0xaaaadf010760 WARN                 nvinfer gstnvinfer.cpp:681:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::releaseBatchOutput() <nvdsinfer_context_impl.cpp:1990> [UID = 1]: Tried to release an outputBatchID which is already with the context
Frame Number=1210 Number of Objects=0 Vehicle_count=0 Person_count=0
libnvosd (1386):(ERROR) : cuGraphicsEGLRegisterImage failed : 700 
0:02:30.039152214 586966 0xaaaadf010760 WARN                 nvinfer gstnvinfer.cpp:2423:gst_nvinfer_output_loop:<primary-inference> error: Internal data stream error.
0:02:30.039192888 586966 0xaaaadf010760 WARN                 nvinfer gstnvinfer.cpp:2423:gst_nvinfer_output_loop:<primary-inference> error: streaming stopped, reason error (-5)
ERROR: Failed to synchronize on cuda copy-coplete-event, cuda err_no:700, err_str:cudaErrorIllegalAddress
0:02:30.039300316 586966 0xaaaadf010760 WARN                 nvinfer gstnvinfer.cpp:2461:gst_nvinfer_output_loop:<primary-inference> error: Failed to dequeue output from inferencing. NvDsInferContext error: NVDSINFER_CUDA_ERROR
0:02:30.039360286 586966 0xaaaadf010760 WARN                 nvinfer gstnvinfer.cpp:681:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::releaseBatchOutput() <nvdsinfer_context_impl.cpp:1990> [UID = 1]: Tried to release an outputBatchID which is already with the context
Frame Number=1211 Number of Objects=0 Vehicle_count=0 Person_count=0
libnvosd (1386):(ERROR) : cuGraphicsEGLRegisterImage failed : 700 
ERROR: Failed to synchronize on cuda copy-coplete-event, cuda err_no:700, err_str:cudaErrorIllegalAddress
0:02:30.040063830 586966 0xaaaadf010760 WARN                 nvinfer gstnvinfer.cpp:2461:gst_nvinfer_output_loop:<primary-inference> error: Failed to dequeue output from inferencing. NvDsInferContext error: NVDSINFER_CUDA_ERROR
0:02:30.040116632 586966 0xaaaadf010760 WARN                 nvinfer gstnvinfer.cpp:681:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::releaseBatchOutput() <nvdsinfer_context_impl.cpp:1990> [UID = 1]: Tried to release an outputBatchID which is already with the context
Frame Number=1212 Number of Objects=0 Vehicle_count=0 Person_count=0
libnvosd (1386):(ERROR) : cuGraphicsEGLRegisterImage failed : 700 
Frame Number=1213 Number of Objects=0 Vehicle_count=0 Person_count=0
libnvosd (1386):(ERROR) : cuGraphicsEGLRegisterImage failed : 700 
ERROR: Failed to make stream wait on event, cuda err_no:700, err_str:cudaErrorIllegalAddress
ERROR: Preprocessor transform input data failed., nvinfer error:NVDSINFER_CUDA_ERROR
0:02:30.044721850 586966 0xaaaadf097400 WARN                 nvinfer gstnvinfer.cpp:1420:gst_nvinfer_input_queue_loop:<primary-inference> error: Failed to queue input batch for inferencing
Frame Number=1214 Number of Objects=0 Vehicle_count=0 Person_count=0
libnvosd (1386):(ERROR) : cuGraphicsEGLRegisterImage failed : 700 
ERROR: Failed to make stream wait on event, cuda err_no:700, err_str:cudaErrorIllegalAddress
ERROR: Preprocessor transform input data failed., nvinfer error:NVDSINFER_CUDA_ERROR
0:02:30.049559171 586966 0xaaaadf097400 WARN                 nvinfer gstnvinfer.cpp:1420:gst_nvinfer_input_queue_loop:<primary-inference> error: Failed to queue input batch for inferencing
Frame Number=1215 Number of Objects=0 Vehicle_count=0 Person_count=0
libnvosd (1386):(ERROR) : cuGraphicsEGLRegisterImage failed : 700 
CUDA Runtime error cudaFreeHost(host_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:78
CUDA Runtime error cudaFree(device_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:79
CUDA Runtime error cudaFreeHost(host_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:78
CUDA Runtime error cudaFree(device_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:79
CUDA Runtime error cudaFreeHost(host_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:78
CUDA Runtime error cudaFree(device_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:79
CUDA Runtime error cudaFreeHost(host_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:78
CUDA Runtime error cudaFree(device_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:79
CUDA Runtime error cudaFreeHost(host_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:78
CUDA Runtime error cudaFree(device_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:79
CUDA Runtime error cudaFreeHost(host_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:78
CUDA Runtime error cudaFree(device_) # an illegal memory access was encountered, code = cudaErrorIllegalAddress [ 700 ] in file /dvs/git/dirty/git-master_linux/deepstream/sdk/src/utils/nvll_osd/memory.hpp:79

how can i fix it

could you open a new topic for this new issue? Thanks!

1 Like

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