<div dir="ltr"><div dir="ltr"><div dir="ltr"><div><br></div><div>Hello GStreamer developers,<br></div><div><br></div><div>I have a question regarding reading bytes from an appsink in a GStreamer pipeline. I have set up a pipeline using the "videotestsrc" source with two different video formats: "NV16_10LE32" and "NV16". Here are the pipelines I am using:</div><div><br></div><div>1. With NV16_10LE32 format:</div><div>videotestsrc is-live=true ! video/x-raw,width=1920,height=1080,framerate=30/1,format=(string)NV16_10LE32 ! appsink name=videosourcesink</div><div><br></div><div><br></div><div>2. With NV16 format:</div><div>videotestsrc is-live=true ! video/x-raw,width=1920,height=1080,framerate=30/1,format=(string)NV16 ! appsink name=videosourcesink</div><div><br></div><div><br></div><div>I have implemented a callback function for the appsink, where I attempt to read the bytes from the received buffer. Here is the callback function implementation:</div><div><br></div><div>```</div><div>GstFlowReturn VDRE2GStreamerCaptureEncodingSourceTask::on_new_sample_from_videoSource_sink(GstElement *elt, ProgramData *data)</div><div>{</div><div>  GstSample *sample;</div><div>  GstBuffer *app_buffer, *buffer;</div><div>  GstElement *source;</div><div>  GstFlowReturn ret;</div><div>  GstMapInfo map;</div><div><br></div><div>  // ...</div><div><br></div><div>  sample = gst_app_sink_pull_sample(GST_APP_SINK(elt));</div><div>  buffer = gst_sample_get_buffer(sample);</div><div>  </div><div>  app_buffer = gst_buffer_copy(buffer);</div><div>  gst_buffer_map(app_buffer, &map, GST_MAP_WRITE);</div><div><br></div><div>  g_print("Array size: %ld \n", map.size);</div><div><br></div><div>  // ...</div><div><br></div><div>  gst_buffer_unmap(app_buffer, &map);</div><div>  gst_object_unref(source);</div><div>  gst_sample_unref(sample);</div><div><br></div><div>  return ret;</div><div>}</div><div>```</div><div><br></div><div>My issue is as follows: when using the NV16_10LE32 (4:2:2 10 bits per component packed to 16) format, where a frame size of<b> 8294400</b> bytes is expected (resolution 1920x1080), I am getting a size of <b>5529600 </b>bytes instead. However, when I switch to the NV16 (4:2:2 8 bits per component) format, where a size of 4147200 bytes is expected, I get the correct result.</div><div><br></div><div>My question is: What could be causing this discrepancy in the byte count between the NV16_10LE32 and NV16 formats? Is there something wrong with my implementation or the pipeline configuration?</div><div><br></div><div>I appreciate your help and guidance in resolving this issue. If you need any additional information or further details, I would be happy to provide them.</div><div><br></div><div>Thank you,</div><div>Israel</div></div></div></div>