QML Camera
Trying to run Qt 5.5 declarative-camera
example on the Raspberry Pi 2 with the 'Raspberry Pi Camera' and getting an error after some delay:
CameraBin error: "Internal data flow error."
GUI runs but the viewfinder is black.
Video recording works fine with GStreamer:
gst-launch-1.0 v4l2src ! video/x-h264 ! avimux ! filesink location=1.mp4
GStreamer packages installed from the Debian jessie:
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
Qt is built from source. GStreamer Qt plugin is enabled (it even swears with GStreamer asserts when no gstreamer1.0-plugins-bad
or gstreamer1.0-plugins-ugly
installed).
What's missing?
Qt Widgets Camera
The qt5/qtmultimedia/examples/multimediawidgets/camera
application is really acting a little like the one from the Recording Video from USB Cam with Qt5:
The viewfinder shows just one frame. When I press 'Capture Photo', it gives:
CameraBin error: "Failed to allocate required memory."
CameraBin error: "Internal data flow error."
When switching to the 'Video' tab:
CameraBin error: "Internal data flow error."
CameraBin error: "Failed to allocate required memory."
CameraBin error: "Internal data flow error."
Setting different resolutions (or not setting at all) doesn't help.
GStreamer 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."