Possible buffering issue

Nicolas Dufresne nicolas at ndufresne.ca
Tue Jun 6 18:46:42 UTC 2017


Le mardi 06 juin 2017 à 10:28 -0700, dayunbao a écrit :
> Here's the pipeline I'm using:
> 
> v4l2src -> videorate -> queue -> identity -> jpegenc -> queue -> jifmux ->
> multifilesink
> 
> The pipeline is taking a picture once a second, and then does the following
> two things:
> 
> 1) when the identity's handoff signal fires, it sends the data to another
> process (via a socket) for some processing of the image, and 
> 
> 2) also writes the images to disk as jpegs. 
> 
> The images that are written to disk are fine, but there seems to be an issue
> with the data being sent over the socket.  I get images like the one below
> quite often.  It seems that I'm not always getting all the data from the
> buffer (even though I'm verifying that the proper amount of data is being
> sent and received on both ends of the socket), although I'm not totally sure
> that's the issue.  I'm using OpenCV to display the data sent over the socket
> as an image, by the way.  In case you're wondering, what you're seeing in
> the top of the picture are two comics tacked to a wall.  The colors are all
> out of wack, but I'm not too worried about that right now.
> 
> I realize there are a lot of places where things could go wrong in my
> program, but I'm trying to narrow them down.  Is there something I can do
> with my pipeline to make sure I'm getting all the data, and that it  isn't
> being overwritten as I'm trying to read it?  I recently added the first

To be honest, drivers should never produce a frame like this, or at
least should mark it as corrupted. Unless of course it's a bug in
libv4l2 (that you can try by rebuilding without that).

As of today, you only last option would be to add a tee between v4l2src
and the queue. This will break the allocation query, and will ensure
v4l2src keep a certain amount of buffers in the driver and copy as
needed.

Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170606/c0158de2/attachment.sig>


More information about the gstreamer-devel mailing list