尝试使用'Raspberry Pi Camera'在Raspberry Pi 2上运行Qt 5.5 declarative-camera
示例,并在延迟一段时间后出错:
CameraBin error: "Internal data flow error."
GUI运行,但取景器为黑色。
视频录制适用于GStreamer:
gst-launch-1.0 v4l2src ! video/x-h264 ! avimux ! filesink location=1.mp4
从Debian jessie安装的GStreamer软件包:
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是从源码构建的。 GStreamer Qt插件已启用(当没有安装gstreamer1.0-plugins-bad
或gstreamer1.0-plugins-ugly
时,它甚至会对GStreamer断言发誓。
缺少什么?
qt5/qtmultimedia/examples/multimediawidgets/camera
应用程序的行为有点像Recording Video from USB Cam with Qt5中的应用程序:
取景器只显示一帧。当我按下“拍摄照片”时,它会给出:
CameraBin error: "Failed to allocate required memory."
CameraBin error: "Internal data flow error."
切换到“视频”标签时:
CameraBin error: "Internal data flow error."
CameraBin error: "Failed to allocate required memory."
CameraBin error: "Internal data flow error."
设置不同的分辨率(或根本不设置)无济于事。
发布时:
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
点击“视频”或“捕捉照片”时:
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."