How to save a video from a Gstreamer pipeline after getting the trigger from Nvdsanalytics

Please provide complete information as applicable to your setup.

• Hardware Platform: dGPU
• DeepStream Version: 5.0
• TensorRT Version: 7.0.0-1+cuda10.2
• NVIDIA GPU Driver Version: 465.19.01

Hello there,
I am looking for a way to store a particular segment of video after an event/detection occurs in a pipeline, this event/detection trigger will come from nvdsanalytics output, I am able to get the trigger but how can I save the video? do I need to create a new pipeline which will detach or attach based on the trigger (like this: deepstream_python_apps/ at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub) or is there a specific and better way? I would also like to get last n sec of video before getting the trigger which also means I continuously need to store the videos in a chunk and also continuously delete it until I get the trigger

Thanks in advance,

The smart recording may help. Smart Video Record — DeepStream 6.1.1 Release documentation

Hii @Fiona.Chen, thanks for the reply, I looked into it, I am using python for my project and seems like the smart video record is only available in c, is there a way I can use it in my project in python?

We don’t have python bindings for smart recording interfaces. There are two ways. Either you create the python binding for smart recording interfaces by yourself, or you can insert video encoder, file mux and file sink to the pipeline to save the video you want. It is just a routine gstreamer pipeline. There is a lot gstreamer samples in internet.

Hello @Fiona.Chen , I found the functions and .h file for smart recording but I could not find the flow where it is being used in the active Gstreamer pipeline, can you please point me to the file where is is used so that I can understand how it is mapped to the pipeline.

There is sample in deepstream-app sample code. Another sample is deepstream-testsr. They are all in c/c++. C/C++ Sample Apps Source Details — DeepStream 6.1.1 Release documentation

seems like Deespstream-5.0 doesn’t have deepstream-testsr in its source location, is there a way I can look into this folder without installing DS-5.1

You can just find the sample code in DS5.1 package. No other way.

1 Like

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