how to get the video resolution from pipeline

Florian Zwoch fzwoch at gmail.com
Wed Feb 7 10:52:29 UTC 2018


In your sample callback try something like this:

gint width;
gint height;

GstSample* sample = gst_app_sink_pull_sample (appsink);
GstBuffer* buffer = gst_sample_get_buffer (sample);
GstCaps* caps = gst_sample_get_caps (sample);
GstStructure* structure = gst_caps_get_structure (caps, 0);

gst_structure_get_int (structure, "width", &width);
gst_structure_get_int (structure, "height", &height);

g_print ("video size is %dx%d\n", width, height);

gst_sample_unref (sample);



More information about the gstreamer-devel mailing list