Change QML Camera viewfinder and capture pixel format
-
-
Hi @SGaist, thanks for your reply.
I've tried, but something's wrong. I am 100% sure that my camera supports MJPEG, as I've already tested it with QV4L2.
However, when I query the QCamera instance capabilites by calling supportedViewFinderSettings(), only YUYV format settings are listed.What could be the cause?
-
Good question. I am currently not sure whether GStreamer is also used for camera handling but I would check if it's possible to set the stream type with it too.
-
Good question. I am currently not sure whether GStreamer is also used for camera handling but I would check if it's possible to set the stream type with it too.
@SGaist Could you please point me to the relevant classes you are thinking about?
-
I was thinking about checking that directly on the command line.
-
@SGaist By checking with gst-inspect it seems like the v4l2src element supports image/jpeg and not video/mjpeg.
However, with this pipeline:gst-launch v4l2src device=/dev/video2 ! image/jpeg, framerate=30/1 ! filesink location=test.mjpeg
the generated file is too big to be a single jpeg image, thus I assume a MJPEG video is created.
Nonetheless, when I try and open it with VLC, only the first frame is shown... I'm quite confused. -
You may have to resort to low-level handling for the stream type switching.
-
@SGaist That's what I feared... Is there any Qt class you have in mind? I could handle this via V4L2 but I was hoping for a portable solution.
-
I just had a doubt, what if you use the xvimagesink ?
Are you seeing the live image of your camera ? -
I just had a doubt, what if you use the xvimagesink ?
Are you seeing the live image of your camera ?@SGaist xvimagesink does not support image/jpeg, I just get:
WARNING: erroneous pipeline: could not link v4l2src0 to xvimagesink0, xvimagesink0 can't handle caps image/jpeg
-
Can you open the camera with VLC ?
-
@SGaist I've never used VLC on the command line, and I'm having trouble figuring out how to stream directly from my local camera. Could you please provide me with some indications on how to do?
-
I meant just testing with the VLC application.
-
@SGaist Yeah sorry, I've just noticed the "Open capture device" option in the GUI program... My bad.
Anyway, I get the same problem, VLC defaults to YUYV and I get extremely low FPS. As far as I could see there were no option to set the capture format at all. -
Then I fear you are going to have to go lower level to set the stream type...
-
@SGaist Yes, that's what I feared too.
Since there seems to be no suitable Qt-based solution at all, I'm closing the topic as solved. -
Did you check with the GStreamer folks whether there was something possible with directly from their v4l2 plugin ?
-
Did you check with the GStreamer folks whether there was something possible with directly from their v4l2 plugin ?
@SGaist Well, no, but I might as well try at this point.