<html><head></head><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:13px">Note that that gstreamer has a number of OpenCV elements that could do what you are after or be adapted to do it.<br><div><span></span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: lucida console, sans-serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> Le Mardi 4 avril 2017 18h46, Damien Picard <picard.damien@gmail.com> a écrit :<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv9207383321"><div><div dir="ltr">Thank you !</div><div class="yiv9207383321gmail_extra"><br clear="none"><div class="yiv9207383321gmail_quote">2017-04-03 20:49 GMT+02:00 Thiago Sousa Santos <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:thiagossantos@gmail.com" target="_blank" href="mailto:thiagossantos@gmail.com">thiagossantos@gmail.com</a>></span>:<br clear="none"><blockquote class="yiv9207383321gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv9207383321yqt3032363659" id="yiv9207383321yqt38607"><div dir="ltr"><br clear="none"><div class="yiv9207383321gmail_extra"><br clear="none"><div class="yiv9207383321gmail_quote"><span class="yiv9207383321">On Mon, Apr 3, 2017 at 11:14 AM, Damien Picard <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:picard.damien@gmail.com" target="_blank" href="mailto:picard.damien@gmail.com">picard.damien@gmail.com</a>></span> wrote:<br clear="none"></span><blockquote class="yiv9207383321gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;"><div dir="ltr"><div><div><div><div><div><div>Hi,<br clear="none"><br clear="none"></div>Due to an issue in opencv4tegra, I can not capture from my UVC webcam using OpenCV. To get round this problem, I'm trying to use GStreamer and its Python bindings to capture jpeg images from the webcam.<br clear="none"><br clear="none"></div>To do that, I adapt<a rel="nofollow" shape="rect" target="_blank" href="https://gist.githubusercontent.com/willpatera/7984486/raw/54b71f20b6a055839e44d59663ee4783042305cf/gst-appsink-opencv.py"> this tutorial</a> with a custom pipeline.<br clear="none"></div>Currently my pipeline looks like this :<br clear="none"><br clear="none"></div>v4l2src ! image/jpeg,width=1920,height=1 080 ! jpegdec ! videoconvert ! appsink name=sink caps=video/x-raw, format=(string){BGR, GRAY8}; video/x-bayer,format=(string){ rggb,bggr,grbg,gbrg}<br clear="none"><br clear="none"></div><div>(The function that convert gstreamer to opencv array is exactly the same as in the tutorial)<br clear="none"></div><div><br clear="none"></div>It works (maybe the colors are not the good ones, but I'm not sure), but I'm wondering if there is a way to retrieve the jpeg images directly from gstreamer ? By this way, I will decode them using OpenCV and I hope that it could, at least, limits processing.<br clear="none"></div></div></blockquote><div><br clear="none"></div><div>Not sure if decoding inside opencv or in gstreamer itself makes any difference but yes you can have gstreamer pass the jpeg images to you.<br clear="none"><br clear="none"></div><div>If you pay attention to your pipeline, it contains the 'jpegdec' element that is the one decoding jpegs into a raw format that later gets sent to appsink and into your application. So, you should just remove jpegdec and videoconvert and you will have jpeg images delivered directly to appsink. Remember to also remove the caps restrictions from appsink so it can accept jpeg input. Something like:<br clear="none"><br clear="none">v4l2src ! image/jpeg,width=1920,height=1 080 ! appsink name=sink<br clear="none"><br clear="none"></div><div>Hope this helps,<br clear="none"> <br clear="none"></div><blockquote class="yiv9207383321gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;"><span class="yiv9207383321"></span><div dir="ltr"><div><br clear="none"></div>Thank you in advance.<span class="yiv9207383321m_-6354086088761546610gmail-HOEnZb"><font color="#888888"><br clear="all"></font></span><div><div><div><div><div><div><div><br clear="none">-- <br clear="none"><div class="yiv9207383321m_-6354086088761546610gmail-m_1484962628311915424gmail_signature"><div dir="ltr">Damien Picard<br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html">Expert GWT</a><br clear="none">Mob : 06 11 51 47 78</div></div>
</div></div></div></div></div></div></div></div>
<br clear="none">______________________________ _________________<br clear="none">
gstreamer-devel mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesk top.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/ mailman/listinfo/gstreamer-dev el</a><br clear="none">
<br clear="none"></blockquote></div><span class="yiv9207383321HOEnZb"><font color="#888888"><br clear="none"><br clear="all"><br clear="none">-- <br clear="none"></font></span><div class="yiv9207383321m_-6354086088761546610gmail_signature">Thiago Sousa Santos</div>
</div></div></div>
<br clear="none">______________________________ _________________<br clear="none">
gstreamer-devel mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists. freedesktop.org</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/ mailman/listinfo/gstreamer- devel</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><div class="yiv9207383321gmail_signature"><div dir="ltr">Damien Picard<br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.editions-eni.fr/livres/gwt-google-web-toolkit-developpez-des-applications-internet-riches-ria-en-java/.97a1a26e7d5be94763fc45ac2a1e961a.html">Expert GWT</a><br clear="none">Mob : 06 11 51 47 78</div></div>
</div></div></div><div class="yqt3032363659" id="yqt07171">_______________________________________________<br clear="none">gstreamer-devel mailing list<br clear="none"><a shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br clear="none"><a shape="rect" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br clear="none"></div><br><br></div>  </div> </div>  </div></div></body></html>