<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>Linux ARM (nVidia Jetson TK1), gstreamer-1.5.2, Qt 5.5, qt-streamer 1.2.0<br></div>
<div> </div>
<div>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:<br></div>
<div> </div>
<div><div> QGlib::Value val = pipeline->property("sample");<br></div>
<div> GstSample * v = (GstSample *)g_value_get_boxed(val);<br></div>
<div> </div>
<div> // write the contents of v's memory buffer to disk ....<br></div>
<div> </div>
<div>What I get is a raw file of 4bytes * 1920 * 1080. That's cool! But what I want to do is:<br></div>
<div> </div>
<div> GstCaps * jpegCaps = gst_caps_new_simple("image/jpeg", "width", G_TYPE_INT, 640, NULL);</div>
<div> GError * err;<br></div>
<div> GstSample * jpeg = gst_video_convert_sample(v, jpegCaps, 100, &err);<br></div>
<div> </div>
<div>... and then write the contents of *that* sample to disk, instead. However, if I do that conversion, jpeg is null and the error is:<br></div>
<div> </div>
<div>"Cannot find any image encoder for caps image/jpeg"<br></div>
<div> </div>
<div>OK, that seems fair. But my pipeline (again see the example code at [1]) is constructed as such:<br></div>
<div> </div>
<div> m_pipeline = QGst::ElementFactory::make("playbin").dynamicCast<QGst::Pipeline>();<br></div>
<div> </div>
<div>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?<br></div>
<div> </div>
<div>Any light anyone can shed would be most welcome.<br></div>
<div> </div>
<div>Cheers!</div>
<div> </div>
<div>[1] https://github.com/detrout/qt-gstreamer/tree/master/examples/player<br></div>
</div>
<div> </div>
</body>
</html>