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 and VideoOutput QML components but nothing shows up on the screen although GStreamer claims frames are being generated (GST_DEBUG=4). Is there any environment variable needed for setting up the video surface needed by the GStreamer? Any help would be greatly appreciated...

    Thanks,
    Ram


  • Lifetime Qt Champion

    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 with QCamera and QCameraViewFinder, the camera works fine.
    If I switch to QML application, there is nothing on the screen. Please see the GStreamer 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.


  • Lifetime Qt Champion

    If you start your widget application after your QML application, does it work correctly ?



  • @SGaist

    Sorry for the delayed reply. I don't need to run both the applications. I'm evaluating software rendering and is not working with QML multimedia.

    Thanks for your help!


  • Lifetime Qt Champion

    Are you thinking about using the Qt Quick 2D renderer ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.