<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1505166468468_4725">Great. Thank you Nicolas.</div><div id="yui_3_16_0_ym19_1_1505166468468_4727">Regards,</div><div id="yui_3_16_0_ym19_1_1505166468468_4728">Simon<br></div><div id="yui_3_16_0_ym19_1_1505166468468_4729"><span></span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, 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 face="Arial" size="2"> El Lunes 11 de septiembre de 2017 21:56, Nicolas Dufresne <nicolas@ndufresne.ca> escribió:<br></font></div>  <br><br> <div class="y_msg_container"><div dir="ltr">Le lundi 11 septembre 2017 à 15:24 +0000, simo zz a écrit :<br clear="none">> Hello,<br clear="none">> I am trying to understand what is the file format understood by<br clear="none">> videoconvert in the following pipeline:<br clear="none">> <br clear="none">> v4l2src device=/dev/webcam ! videoconvert ! video/x-<br clear="none">> raw,width=544,height=288 ! multifilesink location=file%06d.raw<br clear="none"><br clear="none">In this pipeline, videoconvert will be passthrough, because you didn't<br clear="none">specify a format in your caps filter, and multifilesink supports<br clear="none">everything format possible.<br clear="none"><br clear="none">> <br clear="none">> From the following doc<br clear="none">> <br clear="none">> <a href="" class="removed-link" shape="rect" target="_blank">https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins</a><br clear="none">> -base-plugins/html/gst-plugins-base-plugins-videoconvert.html<br clear="none">> <br clear="none">> I can read that videconvert will automatically convert the video to a<br clear="none">> format understood by the video sink.<br clear="none">> My request arise from the fact that I am a little bit confused with<br clear="none">> pixel formats.<br clear="none">> My USB camera has the following formats (read with v4l2-ctl --list-<br clear="none">> formats --device=/dev/webcam from a Linux distro)<br clear="none">> <br clear="none">> ioctl: VIDIOC_ENUM_FMT<br clear="none">>     Index       : 0<br clear="none">>     Type        : Video Capture<br clear="none">>     Pixel Format: 'YUYV'<br clear="none">>     Name        : YUYV 4:2:2<br clear="none">> <br clear="none">>     Index       : 1<br clear="none">>     Type        : Video Capture<br clear="none">>     Pixel Format: 'MJPG' (compressed)<br clear="none">>     Name        : Motion-JPEG<br clear="none">> <br clear="none">> After reading the following page:<br clear="none">> <br clear="none">> <a href="" class="removed-link" shape="rect" target="_blank">http://blogs.adobe.com/VideoRoad/2010/06/what_is_yuv.html</a><br clear="none">> <br clear="none">> I undestand that YUYV 422 is a 3 channel file format.<br clear="none">> <br clear="none">> But each raw file generated by the gststreamer pipeline is 313344<br clear="none">> bytes long, which is equals to 2 * 544 * 288 = 2 * width * height so<br clear="none">> I understand that the file format generated by the pipeline has 2<br clear="none">> channels so I don't understand what format is used.<br clear="none">> The assumption of 2 channels arise from the fact that if I specify<br clear="none">> format=GBR in the caps string, I obtain a raw file 470016 bytes long,<br clear="none">> which is 3 * 544 * 288 and later I can correctly decode the raw data<br clear="none">> to a png file using OpenCV.<br clear="none">> <br clear="none">> So what is my file format generated by videoconvert ?<br clear="none">> How can I be sure of it ?<br clear="none"><br clear="none">When using gst-launch-1.0, you can add the -v option, this will print<br clear="none">the format selected by each element. As you have fixed size buffer, and<br clear="none">that your camera only have two formats, it's clear the JPEG is not<br clear="none">selected (would be dynamic sized files). So that means you have YUYV,<br clear="none">which maps to YUY2.<br clear="none"><br clear="none">YUY2 is a 16bit per pixel format (hence the size being width*height*2),<br clear="none">which is defined as packed. Each UV pair are re-uded for two Y values.<br clear="none">This is what we call subsampling.<div class="yqt9211389981" id="yqtfd40024"><br clear="none"><br clear="none">> <br clear="none">> PS: I sent the same request to the gstreamer-android mailing list. It<br clear="none">> was an error.<br clear="none">> <br clear="none">> Thank you in advance for your help.<br clear="none">> Regards,<br clear="none">> Simon</div><br clear="none">> _______________________________________________<br clear="none">> gstreamer-devel mailing list<br clear="none">> <a href="" class="removed-link" shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br clear="none">> <a href="" class="removed-link" shape="rect" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></div>_______________________________________________<br clear="none">gstreamer-devel mailing list<br clear="none"><a href="" class="removed-link" shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br clear="none"><a href="" class="removed-link" shape="rect" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><div class="yqt9211389981" id="yqtfd21524"><br clear="none"></div><br><br></div>  </div> </div>  </div></div></body></html>