Invalid image format error

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

Invalid image format error

ramtheconqueror
I'm using GStreamer (camerabin) to generate the jpg files which does work as expected on Linux dev machine and on Windows desktop. But my Qt application throws this error

QML Image: Invalid image data: file:///home/camera/capture_0.png

I'm using camerabin of GStreamer and using this image-capture-caps.

GstCaps *caps = gst_caps_new_full (gst_structure_new ("video/x-raw",
    "format", G_TYPE_STRING, "YUY2", "width", G_TYPE_INT, 1280, "height", G_TYPE_INT, 1024, NULL), NULL);
g_object_set (m_cameraBin, "image-capture-caps", caps, NULL);
gst_caps_unref (caps);
m_cameraBin->setProperty("location", "/home/camera/capture_%d.jpg");

I then call QGlib::emit<void>(m_cameraBin, "start-capture");

I've tried different formats like RGB which didn't work either.

Any help? Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Invalid image format error

Sebastian Dröge-3
On Di, 2016-04-12 at 08:21 -0700, ramtheconqueror wrote:

> I'm using GStreamer (camerabin) to generate the jpg files which does work as
> expected on Linux dev machine and on Windows desktop. But my Qt application
> throws this error
>
> QML Image: Invalid image data: file:///home/camera/capture_0.png
>
> I'm using camerabin of GStreamer and using this image-capture-caps.
>
> GstCaps *caps = gst_caps_new_full (gst_structure_new ("video/x-raw",
>     "format", G_TYPE_STRING, "YUY2", "width", G_TYPE_INT, 1280, "height",
> G_TYPE_INT, 1024, NULL), NULL);
> g_object_set (m_cameraBin, "image-capture-caps", caps, NULL);
> gst_caps_unref (caps);
> m_cameraBin->setProperty("location", "/home/camera/capture_%d.jpg");
>
> I then call QGlib::emit(m_cameraBin, "start-capture");
>
> I've tried different formats like RGB which didn't work either.
>
> Any help? Thanks
>
video/x-raw is raw video, QImage (and your code) assumes a image
format. Try using "image/png" to get a PNG image.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

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

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Invalid image format error

ramtheconqueror
is not gstreamer than uses jpegenc plugin to create the jpg file? Thanks