Delay between EOS and pipeline stopping

I am using Docker image

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 5.1
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only) 11.2
• Issue Type( questions, new requirements, bugs) questions
• 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)


I am started from the deepstream python examples. I have added a python signal to handle SIGINT message and send an eos to the pipeline so the filesink can properly save my video. It works well when input source is a video file but it takes a whiles for the pipeline to stop with live sources (rtsp streaming from ip camera).

I basically add this code:

def send_signal(n,f):"Sending signal")
    signal_type, send_signal,
loop = GObject.MainLoop()
bus = pipeline.get_bus()
bus.connect("message", bus_call, loop)

And in my log I can see something like:

Number of objects in frame 0 38
Number of objects in frame 0 39
Number of objects in frame 0 40
^C2021-03-18 08:15:26.912 | INFO | pipeline:send_signal:49 - Sending signal
Number of objects in frame 0 41

Number of objects in frame 0 143
Number of objects in frame 0 144
2021-03-18 08:15:33.331 | INFO | probe_callbacks.fps_counter:on_frame_meta:32 - Fps of stream is 15.944659997594599
Number of objects in frame 0 145
Number of objects in frame 0 146
Number of objects in frame 0 147
2021-03-18 08:15:33.523 | SUCCESS | pipeline:bus_message_handler:34 - End of Stream
2021-03-18 08:15:33.525 | INFO | pipeline:run_loop:67 - Exiting app…

Is there anyway to accelerate this stop?

Seems it’s not a deepstream related issue, can you debug it referring the gstreamer doc Application Development Manual