Slow plugin skipping frames when needed

MathieuP mathieu.pierfitte at
Wed Nov 14 06:46:00 UTC 2018

Hi Tim, thanks for the answer.

This plugin is not a pass-through plugin. For my use case, I think it's
better to drop frames I don't have time to analyze instead of outputting
everything using a video-filter, but only analyzing a bunch of them. For a
fluid streaming experience, I assume I should still be able to achieve this
by using a tee and synchronizing the two streams based the timestamps in the
end of the pipeline. I haven't tested this yet, though.

About the fact that all upstream plugins should work in Pull mode too, I
feel like there has to be a way around this, because this is exactly what
queue2 can do ("converting" Push to Pull when using a ring buffer). However,
I could not find any other plugin doing the same thing, so this one looks
like the exception.

In the end, I ended up handling this queue internally and spawning a new
task on the srcpad to make everything work in Push mode.
I feel like it is not as clean as I expected it would be in the end, because
this plugin is now responsible for too many unrelated operations (handling a
queue and analyzing images).
Also, I plan on creating other "analyzer" plugins in the future, so I would
have loved to be able to extract this "queue" part to reuse it, but I gave
up on this idea for now.

Tim Müller wrote
> On Mon, 2018-11-12 at 21:59 -0600, MathieuP wrote:
> Hi Mathieu,
> Some more context would be good.
> Pull mode usually only works for byte-based streams that can do random
> access (theoretically it should also be possible to do pull mode
> sequentially on a stream but so far this is only something the API
> provides, I'm not aware of anything actually implementing that).
> Pull mode always needs the co-operation of the upstream elements, and
> there are very few elements that support it, and none of them video-
> specific.
> I think you will probably have to find a solution that works with push
> mode, unless you read input from a file with raw video data or so.
> Is your analysis plugin a pass-through filter of some sort, e.g. could
> it just pass through video frames immediately as they come in at full
> framerate, but only analyse a fraction of them?
> Or did you want to take video in, and output data of a different kind
> for each analysed frame, so the output would be at a lower/variable
> frame rate?
> Cheers
>  Tim
> -- 
> Tim Müller, Centricular Ltd -
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel at .freedesktop


Sent from:

More information about the gstreamer-devel mailing list