Snapshotting frames from a playbin instance
James Felix Black
james at yamtime.com
Wed Aug 19 10:42:44 PDT 2015
Linux ARM (nVidia Jetson TK1), gstreamer-1.5.2, Qt 5.5, qt-
streamer 1.2.0
I have a simple X11 application that I'm working, based for now on the
qt-gstreamer demo code [1] that plays a video to the screen, and
snapshots "interesting" frames to disk. I'm using Qt and the qt-
gstreamer package, and I am able to access sample data directly off the
pipeline (using the "sample" property at a given time), and write the
raw video to disk as such:
QGlib::Value val = pipeline->property("sample"); GstSample * v =
(GstSample *)g_value_get_boxed(val);
// write the contents of v's memory buffer to disk ....
What I get is a raw file of 4bytes * 1920 * 1080. That's cool! But what
I want to do is:
GstCaps * jpegCaps = gst_caps_new_simple("image/jpeg", "width",
G_TYPE_INT, 640, NULL); GError * err; GstSample * jpeg =
gst_video_convert_sample(v, jpegCaps, 100, &err);
... and then write the contents of *that* sample to disk, instead.
However, if I do that conversion, jpeg is null and the error is:
"Cannot find any image encoder for caps image/jpeg"
OK, that seems fair. But my pipeline (again see the example code at [1])
is constructed as such:
m_pipeline =
QGst::ElementFactory::make("playbin").dynamicCast<QGst::Pipeline>();
My question then becomes: how should I approach this problem? Should I
modify the pipeline? I see that there's a "convert-sample" signal on
playbin; is that what I should be using?
Any light anyone can shed would be most welcome.
Cheers!
[1]https://github.com/detrout/qt-gstreamer/tree/master/examples/player
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150819/06456929/attachment-0001.html>
More information about the gstreamer-devel
mailing list