How to save video in 10 minutes chunks without overwriting previous chunk (how to change file location) using splitmuxsink

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) RTX-3060
• DeepStream Version 6.3

My Python pipeline has multiple RTSP source, I am trying to save the stream into10-10min long videos (without overwriting previous videos)

I found

and

but I am having hard time understanding how to change file name every 10 min using “format-location-full” signal.

How to trigger the Signal?
What callback function should I write to change the filename ?

About how to use the “format-location-full”, you can refer to the official demo of Gstreamer splitmuxsink.c. For more details, you can also file a topic in the Gstreamer forum. Thanks

FYI:
In your pipeline init script, you should have something like this:

file_sink = pipeline.create_element("splitmuxsink", "vs_filesink")
file_sink.connect("format-location",name_new_file)
file_sink.set_property('max-size-time',600*1000_000_000)

Then in the callback function:

def name_new_file(splitmuxsink, id):
        utc_now=datetime.now()
        day_folder=Path(video_path)/utc_now.strftime("%Y%m%d")
        day_folder.mkdir(parents=True, exist_ok=True)
        clip_path = (day_folder/utc_now.strftime("%Y%m%d_%H%M%S.mp4")).resolve()
        logging.info(f"new video clip: {clip_path}")
        return clip_path
1 Like

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