problem with v4l2src

Nicolas Dufresne nicolas at ndufresne.ca
Wed Feb 6 21:13:37 UTC 2019


Le mardi 05 février 2019 à 02:50 -0600, tobatrance a écrit :
> Hey Nicolas,
> 
> thanks a lot for your fast response. I got a few more questions:
> 
> 
> Nicolas Dufresne-5 wrote
> > Le lundi 04 février 2019 à 06:28 -0600, tobatrance a écrit :
> > > Hi,
> > > 
> > > I got a problem with my v4l2 pipeline. I'm using this one in my
> > > application:
> > > 
> > > v4l2src ! "video/x-raw, framerate=60/1" ! appsink
> > > ...
> > The initial warning indicates that the src have run out of buffers.
> > Your application is not returning the buffers fast enough. 
> 
> I'm actually consuming the samples/buffers immediately after receiving
> those. I think i might try reducing the framerate in my pipeline as my
> monitor runs in 60Hz and therefore I would never be able to consume 
> an infinite amount of those without running out of buffers somewhen.
> 
> 
> 
> Nicolas Dufresne-5 wrote
> > You can of course upgrade your kernel, but you could also ensure you
> > don't starve the source. You could copy and return immediately the
> > frames (the would not be zero copy) or you could use a pad probe to
> > intercept the allocation query and request more buffers to be
> > allocated.
> 
> Could you give an example for using a pad probe to request more buffers?

Here's an example how to setup the query,

https://gitlab.freedesktop.org/mesa/kmscube/blob/master/gst-decoder.c#L242

For you case, you'll need to call:

gst_query_add_allocation_pool (query, NULL, image_size, min, -1);

The GST_VIDEO_META_API_TYPE might help to avoid copies, but require you
to read that meta, or use GstVideoFrame API. This was the purpose of
this override in kmscube.

> 
> Best,
> Henning
> 
> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190206/d30ad4af/attachment.sig>


More information about the gstreamer-devel mailing list