SoftwareContext and QML Camera
-
Hello All,
I've compiled Qt 5.9 for a board with no hardware acceleration and we don't want to use X11. Using
linuxfb
QML works fine after setting these environment variables.QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0 QMLSCENE_DEVICE=softwarecontext
Now, I want to use the camera / mediaplayer. Initialising the
Camera
andVideoOutput
QML components but nothing shows up on the screen althoughGStreamer
claims frames are being generated (GST_DEBUG=4
). Is there any environment variable needed for setting up the video surface needed by theGStreamer
? Any help would be greatly appreciated...Thanks,
Ram -
Hi,
Might be a silly question but are you sure you are getting images with content from the camera ?
-
Hi,
Might be a silly question but are you sure you are getting images with content from the camera ?
Hi @SGaist
If I use
QMainWindow
(i.e., use widgets) along withQCamera
andQCameraViewFinder
, the camera works fine.
If I switch toQML
application, there is nothing on the screen. Please see theGStreamer
output (GST_DEBUG=4) below.0:00:05.321409586 221 0x268600 INFO GST_STATES gstelement.c:2419:gst_element_continue_state:<camerabin> completed state change to PLAYING 0:00:05.321595211 221 0x268600 INFO GST_STATES gstelement.c:2324:_priv_gst_element_state_changed:<camerabin> notifying about state-changed PAUSED to PLAYING (VOID_PENDING pending) 0:00:05.322469461 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.133333332 out ts 0:00:02.032928945 0:00:05.368815919 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.166666665 out ts 0:00:02.097022611 0:00:05.369229586 221 0x1d9860 WARN v4l2src gstv4l2src.c:849:gst_v4l2src_create:<camera_source> lost frames detected: count = 1 - ts: 0:00:02.097022611 0:00:05.403758586 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.199999998 out ts 0:00:02.130178903 0:00:05.436278003 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.233333331 out ts 0:00:02.165139987 0:00:05.468890711 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.266666664 out ts 0:00:02.197661361 0:00:05.503736086 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.299999997 out ts 0:00:02.230155986 0:00:05.536265336 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.333333330 out ts 0:00:02.265127403 0:00:05.568742294 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.366666663 out ts 0:00:02.297644903 0:00:05.603719836 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.399999996 out ts 0:00:02.330132236 0:00:05.636222086 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.433333329 out ts 0:00:02.365100945 0:00:05.668740336 221 0x1d9860 INFO v4l2src gstv4l2src.c:830:gst_v4l2src_create:<camera_source> sync to 0:00:00.466666662 out ts 0:00:02.397607820
Thanks again.
-
If you start your widget application after your QML application, does it work correctly ?
-
Are you thinking about using the Qt Quick 2D renderer ?
-
Are you thinking about using the Qt Quick 2D renderer ?
Hi SGaist,
You asked:
"Might be a silly question but are you sure you are getting images with content from the camera ?"I have got that problem with the QML Camera.
I can make images and show images on the screen but I cannot see a video stream in the VideoOutput.
The camera's LED lights like during normal work.Best Regards
Darek -
Hi,
Please give more information about your setup.
Qt version
OS version
Camera type
etc. -
i.MX6ull
Yocto Rocko with a framebuffer
export DISPLAY=:0
export QMLSCENE_DEVICE=softwarecontext
export QT_QPA_PLATFORM=linuxfb
Qt 5.9.2
2 different type of the USB Camera (UVC) from LogitechI have got a video output when I am using GStreamer from the command line, for example:
gst-launch-1.0 v4l2src device=/dev/video1 ! imxpxpvideosinkThe problem is that I cannot use a GStreamer separate because the imxpxpvideosink doesn't have an overlay feature.
In that case, I have to use a QML Camera inside the Qt application.Best Regards
Darek -
Depending on what you need the QtGstreamer module might be interest.