0

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."
Community
  • 1
  • 1
Velkan
  • 7,067
  • 6
  • 43
  • 87
  • Probably its related to requested resolution. Have you checked following issue ? http://stackoverflow.com/questions/17650710/recording-video-from-usb-cam-with-qt5 – deimus Oct 19 '15 at 14:29
  • @deimus, I tried changing resolutions in QML (640x480, 1920x1080, 2592x1944 and not setting the resolution). That post is based on incomplete C++ code, so it's harder to reproduce and the error there is different anyways. I'll test with QCamera eventually. – Velkan Oct 19 '15 at 14:48
  • Ok, then probably is better to debug the code and figure out which particular line is failing/freezing – deimus Oct 19 '15 at 14:50
  • 3
    It's a standard RPI camera. Why it has to be so hard? – Velkan Oct 20 '15 at 07:50
  • @Velkan Have you been able to get qcamera working with picam? I am having an issue where the camera status never progresses to active status in my rpi thats on ubuntu mate. [ https://raspberrypi.stackexchange.com/questions/72931/qcamera-does-not-get-to-active-state-in-raspberry-pi-3-no-frames-being-detecte ]. – sith Sep 26 '17 at 04:05
  • @sith, no, I think that there is a race condition somewhere in the driver or a plugin. The camera was filming correctly only once. On all other tries it was locking up on a single frame. – Velkan Sep 26 '17 at 06:22

0 Answers0