[gst-devel] Getting converted frame from playbin2 element

vaisaari vaisaari at gmail.com
Mon Jan 3 12:12:39 CET 2011


Hi all,

I'm trying to implement a function that returns the current frame of
playbin2 element as a QImage (Qt data type). When I call the function (for
the same video), sometimes it works perfectly, sometimes parts of the frame
(bottom rows) are missing. What am I doing wrong? Should I somehow be able
to wait for the "convert-frame" operation to finish, or what? You can find
my example code below. Thank you for your help!
 

QImage Video::getFrame()
{

GstBuffer *buffer;
GstCaps *caps;

caps = gst_caps_new_simple("video/x-raw-rgb","bpp", G_TYPE_INT, 24,"depth",
G_TYPE_INT, 24,NULL);

g_signal_emit_by_name(player, "convert-frame", caps, &buffer);

unsigned char* data=(unsigned char *) GST_BUFFER_DATA (buffer);
QImage img(data, width, height, QImage::Format_RGB888);

return img;
}


-- 
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Getting-converted-frame-from-playbin2-element-tp3171830p3171830.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list