<div dir="ltr">Thanks for the prompt reply!  The jpegs that are saved to disk further down the pipeline are all fine.  Would that indicate a problem somewhere in my code outside of Gstreamer?<div><br></div><div>Here's what I'm doing inside the function that's called when the identity's handoff signal is fired (keep in mind this is Python):</div><div><br></div><div>memory = Gst.Buffer.get_all_memory(buf)</div><div>(result, info) = Gst.memory.map(memory, Gst.MapFlahs.READ)</div><div>if result:</div><div>   set up sockets...</div><div>   sentTotal = 0</div><div>   while sentTotal < info.size:</div><div>      sent = self.connection.send(info.data)</div><div>      sentTotal += sent</div><div>   Gst.Memory.unmap(memory, info)</div><div>   close socket...</div><div><br></div><div>The process that's receiving the data, which is written in C++, is displaying the data as images with the following code:</div><div><br></div><div>read data over socket into buffer called data...</div><div>Mat bayer(720, 1280, CV_16U, data);</div><div>Mat converted;</div><div>cvtColor(bayer, converted, COLOR_BayerRG2RGB);</div><div>imshow("Socket Image", converted);</div><div>waitKey(0);</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 6, 2017 at 11:46 AM, Nicolas Dufresne <span dir="ltr"><<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le mardi 06 juin 2017 à 10:28 -0700, dayunbao a écrit :<br>
> Here's the pipeline I'm using:<br>
><br>
> v4l2src -> videorate -> queue -> identity -> jpegenc -> queue -> jifmux -><br>
> multifilesink<br>
><br>
> The pipeline is taking a picture once a second, and then does the following<br>
> two things:<br>
><br>
> 1) when the identity's handoff signal fires, it sends the data to another<br>
> process (via a socket) for some processing of the image, and <br>
><br>
> 2) also writes the images to disk as jpegs. <br>
><br>
> The images that are written to disk are fine, but there seems to be an issue<br>
> with the data being sent over the socket.  I get images like the one below<br>
> quite often.  It seems that I'm not always getting all the data from the<br>
> buffer (even though I'm verifying that the proper amount of data is being<br>
> sent and received on both ends of the socket), although I'm not totally sure<br>
> that's the issue.  I'm using OpenCV to display the data sent over the socket<br>
> as an image, by the way.  In case you're wondering, what you're seeing in<br>
> the top of the picture are two comics tacked to a wall.  The colors are all<br>
> out of wack, but I'm not too worried about that right now.<br>
><br>
> I realize there are a lot of places where things could go wrong in my<br>
> program, but I'm trying to narrow them down.  Is there something I can do<br>
> with my pipeline to make sure I'm getting all the data, and that it  isn't<br>
> being overwritten as I'm trying to read it?  I recently added the first<br>
<br>
</span>To be honest, drivers should never produce a frame like this, or at<br>
least should mark it as corrupted. Unless of course it's a bug in<br>
libv4l2 (that you can try by rebuilding without that).<br>
<br>
As of today, you only last option would be to add a tee between v4l2src<br>
and the queue. This will break the allocation query, and will ensure<br>
v4l2src keep a certain amount of buffers in the driver and copy as<br>
needed.<br>
<span class="HOEnZb"><font color="#888888"><br>
Nicolas</font></span><br>______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
<br></blockquote></div><br></div>