Snapshotting frames from a playbin instance
Thiago Santos
thiagoss at osg.samsung.com
Wed Aug 19 13:19:05 PDT 2015
On 08/19/2015 03:46 PM, James Felix Black wrote:
> On Wed, Aug 19, 2015, at 13:52, Thiago Santos wrote:
>> On 08/19/2015 02:42 PM, James Felix Black wrote:
>>> 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.
>> Do you have jpegenc (or any other jpeg encoder) in your system?
>> gst-inspect-1.0 jpegenc should show it. Or gst-inspect-1.0 |grep jpeg.
> I was missing jpegenc; thanks. Having installed it, I now get an
> "Internal data flow error".
>
> default convertframe.c:325:gst_video_convert_sample:Could not convert
> video frame: Internal data flow error.
>
> This is using a one-second timeout on the frame conversion
> (GST_SECOND). Hmmm. Any pointers here?
I'd recommend using GST_DEBUG to get some log and check what exactly was
the error.
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
--
Thiago Sousa Santos
Senior Multimedia Engineer, Open Source Group
Samsung Research America - Silicon Valley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150819/c7f138be/attachment.html>
More information about the gstreamer-devel
mailing list