Raspberry Pi camera mmal Error - python-3.x

Recently I use my Picamera. When I run
sudo raspistill -o myImage.jpg
I get the following error
mmal: Cannot read camera info, keeping the defaults for OV5647
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not detected. Please check carefully the camera module is installed correctly
So I enabled Picamera but it doesn't works.
How should I do?

Related

I can't start libcamera on Raspberry pi. Error undefined symbol

I have little knowledge of Linux and have installed libcamera to stream video from rbpicamera to vlc (or kodi, tvheadend, etc). But it gives error and I don't know what is happening.
libcamera-vid -t 0 --width 1920 --height 1080 --codec h264 --inline --listen -o tcp://0.0.0.0:8888
[0:13:03.287872564] [2248] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3829-dfc6d711
[0:13:03.852263918] [2263] WARN RPI raspberrypi.cpp:1258 Mismatch between Unicam and CamHelper for embedded data usage!
[0:13:03.862314595] [2263] INFO RPI raspberrypi.cpp:1374 Registered camera /base/soc/i2c0mux/i2c#1/imx219#10 to Unicam device /dev/media2 and ISP device /dev/media0
[0:13:03.868779438] [2248] INFO Camera camera.cpp:1035 configuring streams: (0) 1280x960-YUV420
[0:13:03.872784647] [2263] INFO RPI raspberrypi.cpp:761 Sensor: /base/soc/i2c0mux/i2c#1/imx219#10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
libcamera-vid: symbol lookup error: /lib/arm-linux-gnueabihf/libcamera_app.so: undefined symbol: _ZNK9libcamera11ControlList8containsERKNS_9ControlIdE
Let's see if you can give me a hand please.
It always gives the same error. I've reinstalled everything and it's still exactly the same. I've been around the net a thousand times and I haven't found the error or the solution.
Error:
libcamera-vid: symbol lookup error: /lib/arm-linux-gnueabihf/libcamera_app.so: undefined symbol: _ZNK9libcamera11ControlList8containsERKNS_9ControlIdE
I'm with the S.O. Dietpi on a Raspberry Pì 2. The camera works perfectly.
Here is the guide I have followed to install libcamera:
https://libcamera.org/getting-started.html#

Opencv4nodejs limit size of video capture

I'm trying to use opencv4nodejs to serve webcam footage to a webpage encoded in base64
I can't reliably get opencv to poll the camera at more than 10fps. I believe this is due to performance reasons
I want to limit the size of the frame to help. I'm using
this.cvCap.set(cv.CAP_PROP_FRAME_WIDTH,300);
this.cvCap.set(cv.CAP_PROP_FRAME_HEIGHT,300);
But when I use these commands I get the following error
/home/brandonp/repos/nestwebcam/dist/webcam/webcam.service.js:30
const image = cv.imencode(".jpg", frame).toString('base64');
^
Io::Imencode - OpenCV Error: (Raw image encoder error: Empty JPEG image (DNL not supported)) in throwOnEror, in file /home/brandonp/repos/nestwebcam/node_modules/opencv-build/opencv/opencv/modules/imgcodecs/src/grfmt_base.cpp, line 145, status -10
(Use `node --trace-uncaught ...` to show where the exception was thrown)
I think the error is due to, your camera disconnected or not readable. Please check if your camera is working or not using the command raspistill -o testshot.jpg

Sink to the virtual v4l2 device

I have tried an example on Ubuntu 19.04
gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video10
But gstreamer fails
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Cannot identify device '/dev/video10'.
Additional debug info:
v4l2_calls.c(609): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
system error: No such file or directory
Setting pipeline to NULL ...
Freeing pipeline ...
Why it doesn't work? I haven't found this in the documentation, do I need to create /dev/video10 somehow?
I did the same for the default device /dev/video1, but it is an input camera device on my laptop:
sudo gst-launch-1.0 videotestsrc ! v4l2sink
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video1' is not a output device.
Additional debug info:
v4l2_calls.c(639): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x4a00000
Setting pipeline to NULL ...
Freeing pipeline ...
Thank in advance.
The title of your questions suggests you would like to write to a virtual video device. v4l2 devices can be both input and output video devices. Your camera is a video input (capture) device. Directing a v4l2sink (so an endpoint of the pipeline) in gstreamer will likely fail.
You can however generate a virtual output device. What you are looking for is something like the v4l2-loopback device. It allows you to generate a virtual /dev/video10 device like this:
modprobe v4l2loopback video_nr=10
Another possible solution for the same error message: recreate the v4l2loopback interface:
sudo rmmod -f v4l2loopback
sudo modprobe v4l2loopback
This might apply to others experiencing the error message from the original question, but who are already aware they need a v4l2loopback device as gstreamer sink.
When trying to stream a video to the existing v4l2loopback device I streamed to using ffmpeg before, I got the same error message
Device '/dev/video0' is not a output device.
Investigation
When comparing the state of a working loopback video device and a non-working one (i.e. after writing to it with ffmpeg) with v4l2-ctl --all -d 0 using diff, I found the following difference :
--- working 2020-11-19 18:03:52.499440518 +0100
+++ non-working 2020-11-19 18:03:57.472802868 +0100
## -3,21 +3,18 ##
Card type : GPhoto2 Webcam
Bus info : platform:v4l2loopback-000
Driver version : 5.9.8
- Capabilities : 0x85208002
- Video Output
+ Capabilities : 0x85208000
Video Memory-to-Memory
Read/Write
Streaming
Extended Pix Format
Device Capabilities
- Device Caps : 0x05208002
- Video Output
+ Device Caps : 0x05208000
Video Memory-to-Memory
Read/Write
Streaming
Extended Pix Format
Priority: 0
-Video output: 0 (loopback in)
Format Video Output:
Width/Height : 960/640
Pixel Format : 'YU12' (Planar YUV 4:2:0)
Somehow that "Video Output" capability is required for gstreamer to work successfully and taken away by my previous ffmpeg call.
The behaviour only occured when I loaded the v4l2loopback module with the exclusive_caps=1 option, see 1.
The solution was to unload / load the v4l2loopback kernel commands, forcefully removing the v4l2loopback kernel module and adding it again using rmmod / modprobe (see above).

Open web video with nodejs

Hi i'm trying to build a nodejs app on my raspberry pi model 4 that after receiving an input (nfc tag)
open a url that contain a video.
Es 'http://www.example.com/webapi/content?rfid=05:66:77:66:93:67'.
The problem is that when i try to open my link with vlc or omxplayer it drop an error and doesn't show me any video. I try to put the link in the "open network stream" on vlc in windows and i have the same issue, but if i put the link in the browser I see the video correctly. If i try to open other videos i didn't get any problem.
Unfortunately I can't post the link to the site for privacy reasons. Any advice on what the problem might be?
Error log on raspberry pi:
[01cf9b80] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[01d089f0] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[01d089f0] main interface error: no suitable interface module
[01c72b58] main libvlc error: interface "dbus,none" initialization failed
[01d152c0] main interface error: no suitable interface module
[01c72b58] main libvlc error: interface "globalhotkeys,none" initialization failed
[01c72b58] main libvlc: Esecuzione di vlc con l'interfaccia predefinita. Usa 'cvlc' per utilizzare vlc senza interfaccia.
error: XDG_RUNTIME_DIR not set in the environment.
[01d152c0] skins2 interface error: cannot initialize OSFactory
[01d152c0] [cli] lua interface: Listening on host "*console".
VLC media player 3.0.8 Vetinari
Command Line Interface initialized. Type `help' for help.
> [b1002098] mp4 stream error: no moov before mdat and the stream is not seekable
[b1001e58] prefetch stream error: cannot seek (to offset 48)
[b1054990] mmal_codec decoder: VCSM init succeeded: CMA
[mov,mp4,m4a,3gp,3g2,mj2 # 0xb104e340] stream 0, offset 0x4d3: partial file

Qt Camera on Raspberry Pi 2: Internal data flow error

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."

Resources