GstBuffer to a PNG or JPEG Buffer Not using OpenCV

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GstBuffer to a PNG or JPEG Buffer Not using OpenCV

RK29
This post was updated on .
 GstBuffer* buf = gst_sample_get_buffer(sample);
        GstMapInfo info;
        gst_buffer_map(buf, &info, GST_MAP_READ);

        guint8* dataPtr = info.data;
       GstCaps* caps = gst_sample_get_caps(sample);
   
I want to get the PNG Buffer. using Decodebin not playbin. Not using opencv
So far I tried :  
caps = gst_caps_from_string("image/png");
 to_sample =  gst_video_convert_sample(from_sample, caps,
GST_CLOCK_TIME_NONE, &err);///gst_video_convert_sample does not exists.

Can someonegive a proper example?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: GstBuffer to a PNG Buffer Not using OpenCV

Tim-Philipp Müller-2
Hi,

> gst_video_convert_sample does not exists.
> Can someonegive a proper example?

gst_video_convert_sample most certainly exists, but you need to include
the headers for and link with the gstreamer video library:

https://gstreamer.freedesktop.org/documentation/video/index.html?gi-language=c#video-library

So #include <gst/video/video.h> and add gstreamer-video-1.0 to the part
in your build files where you check for gstreamer-1.0 via pkg-config.

Cheers
 Tim

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel