How to record overlapped videos

Hello,

Based on this below link you provided, I have implemented smart record code in python

My questions

  1. I want to record the overlapped videos. How can I achieve this?

  2. The moment I give start-sr signal for recording, the memory leak is happening. If I dont give start-sr signal, there is no leak. I will attach the with and without recording memory graphs below.

    following is the memory graph when I dont give start-sr signal for recording and the memory leak is less.

following is the graph when I give start-sr signal for recording and the huge memory is leaking

  1. once video is recorded, we are renaming it with our custom name and throwing below error.

    Error   no video stream found
    

    Do you think leak is happening because of this?

@junshengy @junshengy
please respond ASAP
Thanks,

Please discuss related issues in the DeepStream forum.

Here is video-processing-optical-flow forum.

1.Currently, setting the recorded file name is not supported. So you need to rename the file

2.How do you collect this data?

You also can monitor the memory usage if the issue caused by mem leak. please refer to DeepStream SDK FAQ - Intelligent Video Analytics / DeepStream SDK - NVIDIA Developer Forums , the script is for Jetson, but you can just have your attention on software memory usage if you are on dGPU. for dGPU, hardware memory usage, you can check nvidia-smi -l 1

3.Please wait for the sr-done signal to determine the end of recording. The usage is show in the FAQ.

Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• 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)
• The pipeline being used

**• Hardware Platform --------> GPU
**• DeepStream Version ---------> 7.0
• TensorRT Version -----------> 8.5
**• NVIDIA GPU Driver Version -----> 555

  1. Is it possible to record overlapped videos? what I mean is that two recorded videos should share some amount of same time period from the buffer.

Thanks for your patience…

can you please look into the last reply of below forum long back ago saying that overlapping video recording is not possible.

If it can be done really, Iam also facing the same issue as they described in above topic.

My issue::::
Suppose lets say I want to record a video of 10 seconds.

  1. Lets say first video recording started at 10:20:25. so Iam recording 5 sec back and 5 sec front. that means It will record the time period of 10:20:20 to 10:20:30

After the first recording, my current time will be 10:20:35 because I started recording at 10:20:25

  1. For the second recording, Iam asking to record 10 seconds back and 0 seconds front. According to my current time(10:20:35), it should record from 10:20:25 to 10:20:35. But it is not taking the previous buffer except for the first recording. Basically, what happening is that it is recording from wherever I stopped.

I have attached my python code file below. please let me know if anything wrong.

smart_record.txt (9.8 KB)

Can you please look into the above issue.

@junshengy
thanks a lot.

Sorry for giving wrong guidance, recording overlapped videos should not be possible.

For each NvDsSRStart call, the value of max-size-time/min-threshold-time properties of queue is set to start the recording.

This means that when start-sr is called for the second time, the data will be written to the file immediately from the current time point instead of reading the data from the cache.

  g_object_set (G_OBJECT (ctx->recordQue), "max-size-time",
                startTime * 1000 * 1000 * 1000ULL, NULL);

  g_object_set (G_OBJECT (ctx->recordQue), "min-threshold-time", 0, NULL);

  g_object_set (G_OBJECT (privData->recordAudioQue), "max-size-time",
                startTime * 1000 * 1000 * 1000ULL, NULL);

  g_object_set (G_OBJECT (privData->recordAudioQue), "min-threshold-time", 0, NULL);
1 Like

Could you explain the purpose of doing this? Maybe there are other ways to avoid overlap recording.

1 Like

We will get the events to capture video recording for every 5 secs, But we want to record it for 10 seconds. So, In this case, I should definitely go back abs(current_time - event_time) + 5 seconds.

Can’t I record overlapping videos in other way?

This requires some special operations,need to use multiple nvurisrcbin elements.

Add multiple nvurisrcbin elements to your pipeline, and then connect the multiple nvurisrcbin elements to the same source stream. When you want to record overlapped videos, send the event to the second/third nvurisrcbin in turn to avoid first nvurisrbin’s buffer clearing.

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

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