nvstreammux not getting the latest frame

Hi, if the downstream plugins after nvstreammux are slow, I am unable to get nvstreammux to drop the old frames and get the latest frame.

I have tried putting a queue before nvstreammux and it does not work.

Is there any solution to this problem?

Hi,
Please try to configure ‘interval’ in [primary-gie]

# config-file property is mandatory for any gie section.
# Other properties are optional and if set will override the properties set in
# the infer config file.
[primary-gie]
enable=1
gpu-id=0
model-engine-file=../../models/Primary_Detector_Nano/resnet10.caffemodel_b8_fp16.engine
batch-size=8
#Required by the app for OSD, not a plugin property
bbox-border-color0=1;0;0;1
bbox-border-color1=0;1;1;1
bbox-border-color2=0;0;1;1
bbox-border-color3=0;1;0;1
<b>interval=4</b>
gie-unique-id=1
nvbuf-memory-type=0
config-file=config_infer_primary_nano.txt

We are not using the config file, but apart from getting the pgie to skip frames, is there anyway for it to drop frames? May I know why does the queue not drop frames?

Hi,
queue is a gstreamer plugin and not developed by NVIDIA.
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-queue.html

Not sure how to configure it to drop frames. You may go to http://gstreamer-devel.966125.n4.nabble.com/

We have seen similar condition on Jetson Nano and implement the parameter ‘interval’. Still suggest you give it a try.

I can help with this.

To see an element’s properties, use gst-inspect-1.0. If we run that on ‘queue’, you’ll note the following properties:

...
  max-size-buffers    : Max. number of buffers in the queue (0=disable)
                        flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 200
  max-size-bytes      : Max. amount of data in the queue (bytes, 0=disable)
                        flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 10485760
  max-size-time       : Max. amount of data in the queue (in ns, 0=disable)
                        flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 1000000000
...
  leaky               : Where the queue leaks, if at all
                        flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                        Enum "GstQueueLeaky" Default: 0, "no"
                           (0): no               - Not Leaky
                           (1): upstream         - Leaky on upstream (new buffers)
                           (2): downstream       - Leaky on downstream (old buffers)

So, what you want, in a queue upstream of nvstreammux, is to set leaky=2 and then constrain it by probably time or by buffers (hint: I recommend time), or some combination thereof.

Note that time is specified in nanoseconds, and operates on the PTS (Presentation Time Stamp) in your buffers. Therefore, you must ensure that your buffers are getting timestamped, or else any time-based constraint on queue size will have no effect.

How do I set it so that the max-size-time varies depending on how fast things downstream of streammux run? By setting it (0=disable)?

Hi abrar.shahriar,

Please help to open a new topic for your issue. Thanks

1 Like