Detecting video stream resolution in appsink with GStreamer 1.0
Fabrizio Dini
fabrizio.dini at magentalab.it
Wed Jan 31 08:39:01 UTC 2018
Hi there!
Given the way my code has been written, the fastest way to fix this was to
change the call
GstCaps* queried_caps = gst_pad_query_caps(pad, NULL);
with the call
GstCaps* queried_caps = gst_pad_get_current_caps(pad);
and it worked! Thank you all for your help!
Cheers
Fabrizio
On Mon, Jan 29, 2018 at 3:55 PM, Tim Müller <tim at centricular.com> wrote:
> On Mon, 2018-01-29 at 07:23 -0700, tobatrance wrote:
>
> Hi,
>
> > Once you pulled a sample with gst_app_sink_pull_sample you can
> > extract its buffer with gst_sample_get_buffer and following get the
> > video frame and video info with gst_video_frame_map. The video info
> > object got the information you're looking for.
>
> That should work. Alternatively, you can also look at the GstCaps in
> the GstSample with gst_sample_get_caps() and either poke at the fields
> directly or parse it into a VideoInfo struct with
> gst_video_info_from_caps(). Or you look at the caps on the element's
> sink pad with gst_pad_get_current_caps().
>
> Cheers
> -tim
>
> --
> Tim Müller, Centricular Ltd - http://www.centricular.com
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
--
Fabrizio Dini
Magenta srl - Via Pasquini 6, 50127 Firenze - Italy
+39 393 5672224 (mobile)
+39 055 286 856
fabrizio.dini at magentalab.it <f.dini at magentalab.it>
Company web page: www.magentalab.it, trafficflow.magentalab.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20180131/f131a174/attachment-0001.html>
More information about the gstreamer-devel
mailing list