1

I'm using feeding data into GStreamer via appsrc and outputting via multifilesink. This works fine. However, if there is too much data (ex. because the resolution is too high), the output begins to lag. In fact, the more time passes, the more latent are the files output by multifilesink.

For example, if I let this process continue for a while, multifilesink may be outputting frames that are a minute old, even if it started with a very small lag.

How can I tell GStreamer to drop frames to avoid reaching such a large latency?

Notes:

  • My appsrc has is-live and do-timestamp set.
  • I have tried adding max-latency and block(false) to appsrc , but that didn't seem to change anything.
  • I have also tried setting the max-lateness on my multifilesink, but that didn't seem to do anything either.

(PS: My code can be found here, in answer to another question about this type of setup.)

Community
  • 1
  • 1
logidelic
  • 1,525
  • 15
  • 42

1 Answers1

1

Finally solved this by adding a leaky queue in my pipeline before my capsfilter. In my case:

GstElement* queue = gst_element_factory_make("queue", NULL);
g_object_set(G_OBJECT(queue), "leaky", 2, NULL);
g_object_set(G_OBJECT(queue), "max-size-time", 500 * GST_MSECOND, NULL);

Did the trick.

logidelic
  • 1,525
  • 15
  • 42
  • logidelic could you have a look at this? https://stackoverflow.com/questions/57521804/opencv-gstreamer-from-an-app-getting-initial-30s-delay – Wojtek Turowicz Aug 16 '19 at 09:09