Video streams dynamic record and playback

Please provide complete information as applicable to your setup.

• Hardware Platform: Jetson Nano Developer Kit
• DeepStream Version: 5.0
• JetPack Version: 4.4
• TensorRT Version: 7.1.0

Problem description:
Hi Sir/Madam: Just one question of how to store video dynamically by using Deepstream (python bindings). I tried to search on the Internet for a long time but still cannot find direct answers.
For example, I want to store my RTSP video streams for 3 past days, and if I want, I could watch the playback video.
Does Deepstream or Gstreamer support this function?
Thanks a lot for your help :)

@zyctimes You can store your video in many format with filesink in gstreamer pipeline. The Deepstream sample apps has some sample of how to use filesink in different situation.

You can use the splitmuxsink element which is able to save video in MP4 or any other video container.



Hi Fiona:

I didn’t find sample apps which directly use filesink. But I tried to find solution from Google, and the following pipeline is the closest to success:

…! nvdsosd ! nvvideoconvert ! ‘video/x-raw(memory:NVMM),format=NV12’ ! nvv4l2h264enc ! h264parse ! qtmux ! filesink

Here are my observation:

  1. This pipeline works:
  2. If input is video file, and we also use “nveglglessink” for local video display (I also tried not using “nveglglessink”, same result), when we kill the program, mp4 file will be saved but cannot be read. However, if we let the program finish (means whole video file is read and processed), and mp4 file will be saved and displayed.

Question is, sometimes I will kill the program when it is running. But in that case, mp4 file cannot be opened. Can you help for this small issue?
Thanks a lot :)

Hi Aphillipso:

Thanks for your comments. splitmuxsink can be an option, but most cases used for splitting video into pieces.

The video file requires to be closed properly to keep its integrity. So you need to send a EOS event downstream to let the qtmux know the video is ready to be closed.

  • If you are using gst-launch, add -e to enable EOS event when you terminate gst-launch.
  • In custom application you will need to send a EOS event as well and wait for EOS message from GstBus before terminating the application’s process.
  • Aphillips

Hi Appillipso:

Thanks a lot for your explanations. Very helpful and straightforward. Thank you very much.