How to draw on frame within osd_sink_pad_buffer_probe using opencv and put the modified frame back to the RTSP output

• Hardware Platform (Jetson / GPU)
Jetson Orin
• DeepStream Version
6.1.1
• JetPack Version (valid for Jetson only)
5.0.2
• TensorRT Version
8.4.1-1+cuda11.4

I am trying to draw over the full frame within osd_sink_pad_buffer_probe using opencv and then put it back into the output RTSP stream.
I was able to draw over the full frame and save the image but the RTSP is not displaying the image with the drawing.
I draw a custom rectangle using:

cv2.rectangle(frame, (0,0), (300,70), (0,0,0),-1)

How can I draw on the image and then send it to the RTSP stream?

You can use nvdsvideotemplate plugin to process the raw data directly.
https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvdsvideotemplate.html

1 Like

For nvdsvideotemplate I will have to modify deepstream source code and point to the custom lib generated correct?

is there any way I can modifythe frame from osd_sink_pad_buffer_probe using python ?

Ok, you can refer to the app below to learn how to use cv2 with python:
https://github.com/NVIDIA-AI-IOT/deepstream_python_apps/blob/master/apps/deepstream-imagedata-multistream/deepstream_imagedata-multistream.py

1 Like

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