Why Smart Video Record only support RTSP?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
Why Smart Video Record only support RTSP? And will it support USB camera? Is there a way for me to make USB camera smart video record work?

Smart Record takes in an encoded source so I assume you can use it with any type of source so long as you include the relevant components to encode before the SR bin.

Thanks for your reply. I found that pad capability of record bin with rtsp source includes video/x-h264, while I just could get video/x-raw(memory:NVMM) in deepstream pipeline with USB camera.So I need to encode the video stream using H264?

Yes thats right. Just add an encoder before the SR bin. I also do it this way - I have a requirement to see all the metadata on the frames so I want to add SR after inference (and after stream demuxing); so I have a pipeline like this:

rtsp (or anything that works with a decodebin) ! decodebin ! streammux ! nvinfer ! tracker ! nvdsanalytics ! streamdemux ! queue ! nvvideoconvert ! “video/x-raw(memory:NVMM), format=I420” ! nvv4l2h265enc ! h265parse ! SR tee ! queue ! fakesink

Now, see the “SR tee” element. Just link the SR bin to that.

It seems to work really well and I see no performance issues whatsoever re-encoding (probably because its all done in hardware).

ps. I could also tap off the SR bin before decoding my rtsp sources and have some other magical setup to post-process the saved videos to draw the metadata onto them… but thats seems much more hard work than just re-encoding for me… ;-)


Thank you so much. I’ll try it ^_^

Hi,@jasonpgf2a,I want to know how you trigger smart record with a detection. I am a beginner so i really confused about the smart record example. And can i put the encode and SR work in a same plugin like gstdsexample, cause there is a save image function and i just use official deepstream-app -c order to run a project.

Hi @shuiniu,
There is I need to create your own plugin based on dsexample for smart record.
Most deep stream apps will have a probe function so you can check the detection metadata. Hi n here you can put your logic and simply call the smart record start function. It’s actually very simple.
Check deepstream-test5 for how to setup smart record. You will see in the ere that is simply starts smart record on a timer. You can start it from your probe when you get a specific detection.