Can't get same video snippet length with Smart Record Video

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU): Jetson
• DeepStream Version: 6.3
• JetPack Version (valid for Jetson only): 5.1.2
• TensorRT Version: 8.5.2.2
• NVIDIA GPU Driver Version (valid for GPU only):
• Issue Type( questions, new requirements, bugs): question

I’m trying to use Smart Record Video to generate videos of 8sec length. As suggested in the previous answer we need to lower the I-Frame rate. I tried this. I generated an rtsp stream where every frame is an I-Frame and I ran it at different fps (10 to100). I choose a very low resolution to make sure that the frames are not corrupted. Nevertheless, all videos are mostly of length 7999ms, 7901ms, 7971ms,… and occasionally 8000ms. When playing the mp4 file with an app it will always display 7 sec unless, the video is 8000ms or longer.

I tried taking decimal number as video length input but that also didn’t work.

Do you see any solution to this problem other than taking longer videos and trimming them afterwards?

How did you test? I can’t reproduce this issue. Here is my test.
source: rtsp source with 15fps, 25 GOP.
command-line: ./deepstream-testsr-app rtsp://xxx -s 1
mp4 time length: after checking with ffprobe -i With_BBox_00001_20240903-145433_532370.mp4, the result is Duration: 00:00:08.04. if using VLC, the duration is also 8 seconds.

Thanks for your answer.

Here is the way I’m running it:

define CACHE_SIZE_SEC 15
define SMART_REC_DEFAULT_DURATION 10
define START_TIME 2
define SMART_REC_DURATION 6

I took a new test today with similar parameters to yours
source: rtsp source with 15fps, 1 GOP (only I-Frames)
command line: ./deepstream-testsr-app rtsp://xxx --sink-type=1 --enc-type=0 --bbox-enable=0 --sr-mode=1

I got 7934ms for the video snippets. Interestingly enough, today it was constant over a several recordings. Last time it was changing more. Nevertheless in my case VLC shows obviously 7sec. Since you had video length of 8004ms it makes completely sense that VLC will show 8 sec.

If I take 15fps and 25GOP I have a bigger interval of resulting video length [6734, 7800]ms which makes sense since there is only 1 I-Frame every so often. This setting is certainly preferred when streaming but it would cause even bigger problems to achieve a constant video length.

Sorry for the late reply, Is this still an DeepStream issue to support? Thanks! what do you mean about “but it would cause even bigger problems to achieve a constant video length”?

Yes, the problem is still not solved.

What I mean is that you have 15fps and 25GOP. Since GOP is the distance between two I frames it would mean in your case every 25/15= 1.6 sec an I-Frame gets forwarded. In my example I send out I-Frames every 15th~67ms. That’s why I said I would expect even bigger problems with your setting to achieve a constant video length.

How many videos did you take? One or several?

they are close to the set value 8 seconds. NvDsSRStop is called by timer. NvDsSRStop will notify the recording thread to stop recording. there will be some time error because the workflow is async. you can set START_TIME to and SMART_REC_DURATION to 7 if you want all recording to be 8 sec at least.

I see. This doesn’t solve the problem but we can close it here.
Thanks for looking into it!

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