<div dir="ltr">Hello everybody!<div><br></div><div>I have a little problem in a project of mine that uses a GStreamer pipeline to get a video stream from an IP camera. The pipeline ends with an appsink, where a few image processing is made. The problem is that I cannot detect the video stream resolution because the properties I read does not have meaningful values.</div><div><br></div><div>Please note that the code was written on GStreamer 0.10, and later moved to GStreamer 1.0, but it was not used for a while, so I cannot say if this problem is due to changing gst-0.10 with gst-1.0 or not. However... </div><div><br></div><div>In the code I start building the pipeline, which is actually just an uridecodebin plugin. On this plugin "pad-added" signal, I add the app-sink, query the pad caps and inspect the GstStructure to detect what kind of video stream I have to handle. The problem is that the fields in the caps GstStructure seems not have valid values to read.</div><div><br></div><div>Properties are read with: </div><div><br></div><div><font face="monospace, monospace">GstStructure* props = gst_caps_get_structure(caps, 0);</font></div><div><br></div><div>and cycled with a for loop on the number of fields (read with <font face="monospace, monospace">gst_structure_n_fields(props)</font>).</div><div>For each property, I read the fieldname:</div><div><br></div><div><font face="monospace, monospace">const gchar* fieldname = gst_structure_nth_field_name(props,j);</font><br></div><div><br></div><div>and then read the value into a variable, according to the field name. For example:</div><div><br></div><div><div> <font face="monospace, monospace">  if (g_strrstr(fieldname, "width"))</font></div><div><font face="monospace, monospace">    {</font></div><div><font face="monospace, monospace">                 res = gst_structure_get_int(props, fieldname, &width);<br></font></div></div><div><font face="monospace, monospace">    }</font></div><div><br></div><div>The problem is that gst_structure_get_int() returns false, and investigating further I've found that the fields I cannot read are not Int but GstIntRange. However, dumping them with</div><div><br></div><div><font face="monospace, monospace">g_strdup_value_contents(gst_structure_get_value(props, fieldname))</font><br></div><div><br></div><div>showed that their content is useless. For example, the field "width" had content "[1,2147483647]" while "framerate" was "[ 0/1, 2147483647/1 ]".</div><div><br></div><div>I googled a lot but couldn't find an explanation to this behavior. So, here's my questions:</div><div><br></div><div>What is the correct way to detect video stream properties with GStreamer 1.0? Am I supposed to do that in the callback that receives the buffers? Can it be done on pad creation?</div><div><br></div><div>Thank you very much for your help, and sorry for the long mail...</div><div><br></div><div>Fabrizio Dini</div><div><br></div><div><br></div></div>