QCamera/QtCamera GStreamer V4L problem



  • On Raspberry Pi 2B with Debian Jessie, Qt 5.5, the qt5/qtmultimedia/examples/multimediawidgets/camera application shows just one frame and gives these errors when changing mode (for example, by clicking on 'Capture Photo' button or 'Video' tab):

    CameraBin error: "Internal data flow error."
    CameraBin error: "Failed to allocate required memory."
    

    GStreamer warning/error output on launch:

    0:00:01.898512576  1923  0x17bbb50 WARN                    v4l2 gstv4l2bufferpool.c:658:gst_v4l2_buffer_pool_start:<camera_source:pool:src> using 3 buffers instead of 2
    

    When clicking on 'Video' or 'Capture Photo':

    0:00:32.243379958  1923  0x17bbb50 WARN           v4l2allocator gstv4l2allocator.c:651:gst_v4l2_allocator_new:<camera_source:pool:src:allocator> Could not probe supported memory type, assuming MMAP is supported, this is expected for older drivers not  yet ported to videobuf2 framework
    0:00:33.208261007  1923  0x17bbb50 ERROR          v4l2allocator gstv4l2allocator.c:727:gst_v4l2_allocator_start:<camera_source:pool:src:allocator> error requesting 2 buffers: Device or resource busy
    0:00:33.209047925  1923  0x17bbb50 ERROR                   v4l2 gstv4l2bufferpool.c:768:gst_v4l2_buffer_pool_start:<camera_source:pool:src> we received 0 buffer from device '/dev/video0', we want at least 2
    0:00:33.209696460  1923  0x17bbb50 ERROR             bufferpool gstbufferpool.c:533:gst_buffer_pool_set_active:<camera_source:pool:src> start failed
    0:00:33.210209266  1923  0x17bbb50 WARN                 v4l2src gstv4l2src.c:478:gst_v4l2src_decide_allocation:<camera_source> error: Failed to allocate required memory.
    0:00:33.210667803  1923  0x17bbb50 WARN                 v4l2src gstv4l2src.c:478:gst_v4l2src_decide_allocation:<camera_source> error: Buffer pool activation failed
    0:00:33.211621438  1923  0x17bbb50 WARN                 basesrc gstbasesrc.c:3161:gst_base_src_prepare_allocation:<camera_source> Subclass failed to decide allocation
    CameraBin error: "Failed to allocate required memory."
    0:00:33.212857100  1923  0x17bbb50 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<camera_source> error: Internal data flow error.
    0:00:33.213240169  1923  0x17bbb50 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<camera_source> error: streaming task paused, reason not-negotiated (-4)
    CameraBin error: "Internal data flow error."
    

    The libv4l log (it just stops):

    libv4l2: open: 14
    request == VIDIOC_QUERYCAP
    result == 0
    request == VIDIOC_ENUMINPUT
    result == 0
    request == VIDIOC_ENUMINPUT
    result == -1 (Invalid argument)
    request == VIDIOC_ENUMSTD
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == -1 (Invalid argument)
    request == VIDIOC_G_STD
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_G_INPUT
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 0, description: 4:2:0, packed YUV
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 1, description: 4:2:2, packed, YUYV
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 2, description: RGB24 (LE)
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 3, description: JPEG
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 4, description: H264
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 5, description: MJPEG
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 6, description: 4:2:2, packed, YVYU
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 7, description: 4:2:2, packed, VYUY
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 8, description: 4:2:2, packed, UYVY
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 9, description: 4:2:0, packed, NV12
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 10, description: RGB24 (BE)
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 11, description: 4:2:0, packed YVU
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 12, description: 4:2:0, packed, NV21
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 13, description: RGB32 (BE)
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 14, description: 
    result == -1 (Invalid argument)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: YUYV
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: YUYV 2592x1944
      field: 1 bytesperline: 5184 imagesize: 10119168
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: YUYV 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: UYVY
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: UYVY 2592x1944
      field: 1 bytesperline: 5184 imagesize: 10119168
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: UYVY 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: YU12
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: YU12 2592x1944
      field: 1 bytesperline: 3888 imagesize: 7589376
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: YU12 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: YV12
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: YV12 2592x1944
      field: 1 bytesperline: 3888 imagesize: 7589376
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: YV12 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: JPEG
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: JPEG 2592x1944
      field: 1 bytesperline: 2592 imagesize: 5059584
      colorspace: 7, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: JPEG 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: MJPG
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: MJPG 2592x1944
      field: 1 bytesperline: 2592 imagesize: 5059584
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: MJPG 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: BGR4
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: BGR4 2592x1944
      field: 1 bytesperline: 10368 imagesize: 20238336
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: BGR4 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: BGR3
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: BGR3 2592x1944
      field: 1 bytesperline: 7776 imagesize: 15178752
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: BGR3 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: RGB3
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: RGB3 2592x1944
      field: 1 bytesperline: 7776 imagesize: 15178752
      colorspace: 8, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: RGB3 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: NV21
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: NV21 2592x1944
      field: 1 bytesperline: 3888 imagesize: 7589376
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: NV21 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: NV12
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: NV12 2592x1944
      field: 1 bytesperline: 3888 imagesize: 7589376
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: NV12 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: YVYU
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: YVYU 2592x1944
      field: 1 bytesperline: 5184 imagesize: 10119168
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: YVYU 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: H264
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: H264 2592x1944
      field: 1 bytesperline: 2592 imagesize: 5059584
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: H264 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    libv4l2: close: 14
    libv4l2: PLUGIN: dlopen(/usr/lib/arm-linux-gnueabihf/libv4l/plugins/libv4l-mplane.so);
    libv4l2: PLUGIN: plugin open() returned NULL
    libv4l2: open: 14
    request == VIDIOC_QUERYCAP
    result == 0
    request == VIDIOC_ENUMINPUT
    result == 0
    request == VIDIOC_ENUMINPUT
    result == -1 (Invalid argument)
    request == VIDIOC_ENUMSTD
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == 0
    request == VIDIOC_QUERYCTRL
    result == -1 (Invalid argument)
    request == VIDIOC_G_STD
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_S_INPUT
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 0, description: 4:2:0, packed YUV
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 1, description: 4:2:2, packed, YUYV
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 2, description: RGB24 (LE)
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 3, description: JPEG
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 4, description: H264
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 5, description: MJPEG
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 6, description: 4:2:2, packed, YVYU
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 7, description: 4:2:2, packed, VYUY
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 8, description: 4:2:2, packed, UYVY
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 9, description: 4:2:0, packed, NV12
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 10, description: RGB24 (BE)
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 11, description: 4:2:0, packed YVU
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 12, description: 4:2:0, packed, NV21
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 13, description: RGB32 (BE)
    result == 0
    request == VIDIOC_ENUM_FMT
      index: 14, description: 
    result == -1 (Invalid argument)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: YUYV
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: YUYV 2592x1944
      field: 1 bytesperline: 5184 imagesize: 10119168
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: YUYV 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: UYVY
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: UYVY 2592x1944
      field: 1 bytesperline: 5184 imagesize: 10119168
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: UYVY 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: YU12
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: YU12 2592x1944
      field: 1 bytesperline: 3888 imagesize: 7589376
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: YU12 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: YV12
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: YV12 2592x1944
      field: 1 bytesperline: 3888 imagesize: 7589376
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: YV12 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: JPEG
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: JPEG 2592x1944
      field: 1 bytesperline: 2592 imagesize: 5059584
      colorspace: 7, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: JPEG 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: MJPG
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: MJPG 2592x1944
      field: 1 bytesperline: 2592 imagesize: 5059584
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: MJPG 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: BGR4
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: BGR4 2592x1944
      field: 1 bytesperline: 10368 imagesize: 20238336
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: BGR4 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: BGR3
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: BGR3 2592x1944
      field: 1 bytesperline: 7776 imagesize: 15178752
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: BGR3 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: RGB3
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: RGB3 2592x1944
      field: 1 bytesperline: 7776 imagesize: 15178752
      colorspace: 8, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: RGB3 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: NV21
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: NV21 2592x1944
      field: 1 bytesperline: 3888 imagesize: 7589376
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: NV21 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: NV12
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: NV12 2592x1944
      field: 1 bytesperline: 3888 imagesize: 7589376
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: NV12 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: YVYU
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: YVYU 2592x1944
      field: 1 bytesperline: 5184 imagesize: 10119168
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: YVYU 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_ENUM_FRAMESIZES
      index: 0 pixelformat: H264
      16x16 -> 2592x1944
    result == 0
    request == VIDIOC_TRY_FMT
      pixelformat: H264 2592x1944
      field: 1 bytesperline: 2592 imagesize: 5059584
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_ENUM_FRAMEINTERVALS
      index: 0 pixelformat: H264 2592x1944:
      1/90 -> 1/1
    result == 0
    request == VIDIOC_CROPCAP
    result == -1 (Inappropriate ioctl for device)
    request == VIDIOC_G_FMT
      pixelformat: BGR4 320x200
      field: 1 bytesperline: 1280 imagesize: 266240
      colorspace: 1, priv: feedcafe
    result == 0
    request == VIDIOC_REQBUFS
      count: 0 type: 1 memory: 1
    result == 0
    request == VIDIOC_CREATE_BUFS
    result == 0
    request == VIDIOC_REQBUFS
      count: 0 type: 1 memory: 2
    result == -1 (Invalid argument)
    request == VIDIOC_REQBUFS
      count: 0 type: 1 memory: 4
    result == -1 (Invalid argument)
    request == VIDIOC_G_CTRL
    result == -1 (Invalid argument)
    request == VIDIOC_REQBUFS
      count: 3 type: 1 memory: 1
    result == 0
    request == VIDIOC_QUERYBUF
    result == 0
    request == VIDIOC_QUERYBUF
    result == 0
    request == VIDIOC_QUERYBUF
    result == 0
    libv4l2: Passing mmap((nil), 266240, ..., 0, through to the driver
    request == VIDIOC_QBUF
    result == 0
    libv4l2: Passing mmap((nil), 266240, ..., 41000, through to the driver
    request == VIDIOC_QBUF
    result == 0
    libv4l2: Passing mmap((nil), 266240, ..., 82000, through to the driver
    request == VIDIOC_QBUF
    result == 0
    request == VIDIOC_STREAMON
    result == 0
    request == VIDIOC_DQBUF
      timestamp -140454174.036203
    result == 0
    request == VIDIOC_G_CTRL
    result == -1 (Invalid argument)
    request == VIDIOC_DQBUF
      timestamp 8436.495678
    result == 0
    request == VIDIOC_DQBUF
      timestamp 8436.506770
    result == 0
    request == VIDIOC_QBUF
    result == 0
    request == VIDIOC_DQBUF
      timestamp 8436.517860
    result == 0
    request == VIDIOC_QBUF
    result == 0
    request == VIDIOC_DQBUF
      timestamp 8436.617679
    result == 0
    

    The libv4l log after changing the mode to 'Video':

    request == VIDIOC_QBUF
    result == 0
    request == VIDIOC_QBUF
    result == 0
    request == VIDIOC_QBUF
    result == 0
    request == VIDIOC_G_FMT
      pixelformat: BGR4 320x200
      field: 1 bytesperline: 1280 imagesize: 266240
      colorspace: 1, priv: feedcafe
    result == 0
    libv4l2: v4l2_buffers_mapped(): buffers still mapped
    libv4l2: v4l2_check_buffer_change_ok(): stream busy
    request == VIDIOC_REQBUFS
      count: 0 type: 1 memory: 1
    result == -1 (Device or resource busy)
    request == VIDIOC_REQBUFS
      count: 0 type: 1 memory: 2
    result == -1 (Invalid argument)
    request == VIDIOC_REQBUFS
      count: 0 type: 1 memory: 4
    result == -1 (Invalid argument)
    request == VIDIOC_G_CTRL
    result == -1 (Invalid argument)
    libv4l2: v4l2_buffers_mapped(): buffers still mapped
    libv4l2: v4l2_check_buffer_change_ok(): stream busy
    request == VIDIOC_REQBUFS
      count: 2 type: 1 memory: 1
    result == -1 (Device or resource busy)
    

    Qt is built from source. GStreamer Qt plugin is enabled. GStreamer 1.0, packages:

    gstreamer1.0-plugins-bad
    gstreamer1.0-plugins-base
    gstreamer1.0-plugins-good
    gstreamer1.0-plugins-ugly
    gstreamer1.0-tools
    libgstreamer-plugins-bad1.0-0
    libgstreamer-plugins-base1.0-0
    libgstreamer1.0-0
    

    Video recording works fine with GStreamer:

    gst-launch-1.0 v4l2src ! video/x-h264 ! avimux ! filesink location=1.mp4
    

    I've tried to hardcode the resolution, codec and capture mode (or even avoid setting the resolution), but result is the same. QML QtCamera obviously doesn't act differently.

    What can be done?

    update
    I can run that gst-launch command, then terminate it while launching the Qt application. And sometimes that makes the Qt application start and go past the first frame, so the ViewFinder displays the video correctly.

    update 2
    I think there is a deadlock in QtMultimediaWidgets or in the Qt GStreamer plugin.

    After one or two frames the QPainter Surface doesn't manage to set m_ready to truein time and rendering stalls. It sets it to true after the fact, but render/paint aren't called to make use of it.



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