How to get constant source frame rate on multi rtsp


Lets assume i have 3 RTSP sources with different source frame rate:
source 1: RTSP 30fps
source 2: RTSP 15fps
source 3: RTSP 6fps (but because of badwidth issues it actually serves between 3 and 4 fps)

How could i set up the sources so i can get a constant 2 fps (actually inferenced) from each camera?

Please refer to

One possible solution is to set different drop-frame-interval per framerate.

I saw that solution, but that is in relation to each source framerate. I understand that a drop-frame-interval=3 means that frames 1 and 2 get dropped and frame 3 gets sent to the engine and having the framerate i can calculate the drop-frame-interval to get the FPS i want from each source.

But im looking for a way to this without depending on drop-frame-interval setting. For example:

gst-launch-1.0 filesrc location=movie.avi ! decodebin ! videorate ! "video/x-raw,framerate=5/1" ! autovideosink

this will produce a fixed 5 FPS regardless of what the source FPS is, and we dont need to any calculations to do that, is there a way to achieve this on C code for RTSP sources?

Not quite understand the usecase and need some information.
For one second, source 1 generates 30 frames, source 2 generates 15 frames, and source 3 generates 6 frames. You need all frames go to nvinfer? Or?

The nvstreammux expects all sources in identical framerate. Maybe it is easier to run three independent pipelines instead of using nvstreammux.

For all intents and purposes i just need the last frame of all 3 sources to go to nvinfer and of course by last i mean the latest frame that arrived from each source. For all following batches i want nvinfer to always get the latest frame from each source, so regardless of the FPS of the inference engine vs the FPS of each individual source im always processing all sources in real time.

I found this on the API doc:

Set the live-source property to true to inform the muxer that the sources are live. In
this case the muxer attaches the PTS of the last copied input buffer to the batched Gst
Buffer’s PTS. If the property is set to false, the muxer calculates timestamps based on
the frame rate of the source which first negotiates capabilities with the muxer.

Does that mean that if the live-source property is true then the round robbin algorithm will always collect the latest frame from each source? if thats the case then that solves my problem



No. Using latest buffer from each source is not possible. The nvstreammux plugin will process first buffer available in the queue for that source.

The nvstreammux needs all sources at same framerate. For your case, the possible solution is to set drop-frame-interval per source.