Comments (12)
Can you try with gst-launch-1.0 libcamerasrc ! xvimagesink
instead? or gst-launch-1.0 libcamerasrc ! glimagesink
please?
It should work.
from libcamera.
@kbingham: can't use glimagesink
(from googling which is supposed to be installed in, but seems to have been removed from gstreamer1.0-plugins-bad
which is indeed installed). xvimagesink
doesn't work neither
pi@raspberrypi:~/Workspaces/libcamera $ GST_PLUGIN_PATH="/home/pi/Workspaces/libcamera/local/lib/aarch64-linux-gnu/gstreamer-1.0" gst-launch-1.0 libcamerasrc camera-name="/base/scb/pcie\@7d500000/pci\@0\,0/usb\@0\,0-1.1:1.0-0c45:6366" ! glimagesink
WARNING: erroneous pipeline: no element "glimagesink"
pi@raspberrypi:~/Workspaces/libcamera $ sudo apt-get install apt-file gstreamer1.0-tools gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apt-file is already the newest version (3.2.2).
gstreamer1.0-plugins-bad is already the newest version (1.18.4-3).
gstreamer1.0-plugins-base-apps is already the newest version (1.18.4-2).
gstreamer1.0-tools is already the newest version (1.18.4-2.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~ $ dpkg -L gstreamer1.0-plugins-bad
/.
/usr
/usr/lib
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstaccurip.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstadpcmdec.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstadpcmenc.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstaiff.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstaom.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstasfmux.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstassrender.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstaudiobuffersplit.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstaudiofxbad.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstaudiolatency.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstaudiomixmatrix.so
/usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstaudiovisualizers.so
...
pi@raspberrypi:~ $ dpkg -L gstreamer1.0-plugins-bad | grep glimagesink
pi@raspberrypi:~ $ GST_PLUGIN_PATH="/home/pi/Workspaces/libcamera/local/lib/aarch64-linux-gnu/gstreamer-1.0" gst-launch-1.0 libcamerasrc camera-name="/base/scb/pcie\@7d500000/pci\@0\,0/usb\@0\,0-1.1:1.0-0c45:6366" ! xvimagesink
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Could not initialise Xv output
Additional debug info:
../sys/xvimage/xvimagesink.c(1778): gst_xv_image_sink_open (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
No Xv Port available
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
from libcamera.
Adding boot config file in case this may help:
pi@raspberrypi:~ $ cat /boot/config.txt
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Enable DRM VC4 V3D driver
#dtoverlay=vc4-kms-v3d
#dtoverlay=arducam-pivariety
#dtoverlay=ov9281
dtoverlay=camera-mux-2port,cam0-ov9281,cam1-ov9281
force_turbo=1
max_framebuffers=2
# Disable compensation for displays with overscan
disable_overscan=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[all]
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
[all]
dtparam=i2c_vc=on
from libcamera.
Any clue? Help? Ideas to test?
Back here, USB camera plugged (I see /dev/video[01]
), looks like I have no much solution:
-
VLC is able to capture stream from
/dev/video0
-
a simple python script using
opencv
works as expected
pi@raspberrypi:~/Workspaces/testUSBCam $ cat testUSBCam.py
import cv2
cam = cv2.VideoCapture(0)
while True:
ret, image = cam.read()
cv2.imshow('testUSBCam', image)
k = cv2.waitKey(1)
if k != -1:
break
cam.release()
cv2.destroyAllWindows()
-
cam
fromlibcamera
(only available when built from source - seems not present in debian native package) is able to get images from USB camera: it writes them on disk but no way to get them in a live GUI -
gstreamer plugin from
libcamera
doesn't work -
libcamera-hello
fromlibcamera
does not work
pi@raspberrypi:~/Workspaces $ ./libcamera-apps/local/bin/libcamera-hello --list-cameras
No cameras available!
pi@raspberrypi:~/Workspaces $ ./libcamera-apps/local/bin/libcamera-hello
Made X/EGL preview window
[0:37:32.742973124] [2498] INFO Camera camera_manager.cpp:299 libcamera v0.0.2+47-0684c373
ERROR: *** no cameras available ***
from libcamera.
cam
fromlibcamera
(only available when built from source - seems not present in debian native package) is able to get images from USB camera: it writes them on disk but no way to get them in a live GUI
cam is just a test application, so it's not expected to have a GUI interface. It can however display frames in an SDL2 window (-S option) if libsdl2-dev and libsdl2_image-dev are installed when building libcamera.
- gstreamer plugin from
libcamera
doesn't work
Can you provide a tad more debug info ?
Try running with LIBCAMERA_LOG_LEVELS=0 and enable gst debug with the usual GST_DEBUG=.. (careful it might get rather verbose)
from libcamera.
Raspberry Pi's libcamera-apps suite are currently only able to work with Bayer sensors, see here.
from libcamera.
@fghoussen Could you also perhaps explain a bit more about what you're actually trying to accomplish overall?
As stated by @naushir the libcamera-apps provided by Raspberry Pi do not accept USB cameras.
For a USB camera you do not need to use libcamera, but you should be able to (excluding libcamera-apps provided by Raspberry Pi). Looking at your command above when trying to use gstreamer, I wonder if setting the GST_PLUGIN_PATH is affecting it from finding the existing plugins. Please make sure that gstreamer can find the desired components with gst-inspect-1.0 glimagesink
and gst-inspect-1.0 xvimagesink
or such.
As you are working with a USB camera, you could also use v4l2src from gstreamer instead of the libcamerasrc.
from libcamera.
To sum up USB are not supported, and, CSI-MIPI can not be detected... The problem is that no CSI-MIPI cameras have never been detected (I realise that just now...) on my raspberry pi: is there some patch I could apply (guided by you) to check why this occurs?...
Do I need to change the OS? If yes which one? Any other clue?
libcamera-apps provided by Raspberry Pi do not accept USB cameras.
Really?!.. If so this should be in top position in the doc... Didn't see it anywhere I looked. USB is a first entry point for almost everyone?!... I engage you to document that in top position in README.md
@fghoussen Could you also perhaps explain a bit more about what you're actually trying to accomplish overall?
I have one USB camera, two CSI-MIPI camera, a camarray hat (multiplexer that enables using 2 CSI cameras in stereo) and a fresh raspberry pi 4 8Gb: in each case I am just trying to understand how to get live images from cameras in different configuration (mono and/or stereo). This is just the basics.
As there is not way to get CSI-MIPI cams to work neither using gstreamer from libcamera
nor using libcamera-hello
, I started to step back and check if I could get to work USB cam using gstreamer from libcamera
or libcamera-hello
Can you provide a tad more debug info ?Try running with LIBCAMERA_LOG_LEVELS=0
Seems no... I didn't know libcamera
and cam
where not supposed to support USB cams... In #39 (comment), OV2311 was USB... Which means I have indeed never been able to see/list a CSI-MIPI camera...
pi@raspberrypi:~/Workspaces/libcamera $ ./local/bin/cam --list
[1:00:45.891999956] [4669] INFO Camera camera_manager.cpp:299 libcamera v0.0.2+47-0684c373
Available cameras:
1: 'Arducam OV2311 USB Camera: Ardu' (/base/scb/pcie@7d500000/pci@0,0/usb@0,0-1.1:1.0-0c45:6366)
pi@raspberrypi:~/Workspaces/libcamera $ ./local/bin/cam --camera 1 --capture --file
[1:01:33.762594353] [4674] INFO Camera camera_manager.cpp:299 libcamera v0.0.2+47-0684c373
Using camera /base/scb/pcie@7d500000/pci@0,0/usb@0,0-1.1:1.0-0c45:6366 as cam0
[1:01:33.921108221] [4674] INFO Camera camera.cpp:1026 configuring streams: (0) 1600x1200-MJPEG
cam0: Capture until user interrupts by SIGINT
3694.555635 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 49784
3694.727667 (5.81 fps) cam0-stream0 seq: 000001 bytesused: 49880
3694.759673 (31.24 fps) cam0-stream0 seq: 000002 bytesused: 50712
^CExiting
Running the only one USB camera I have ever been able to detect
pi@raspberrypi:~/Workspaces/libcamera $ ./local/bin/cam --camera 1 -S
[0:22:58.799681705] [2014] INFO Camera camera_manager.cpp:299 libcamera v0.0.2+47-0684c373
Using camera /base/scb/pcie@7d500000/pci@0,0/usb@0,0-1.1:1.0-0c45:6366 as cam0
Which sounds expected if USB is not supported...
Please make sure that gstreamer can find the desired components
Not used to gstreamer but looks fine to me. The problem may be, I realize this just now, is that the camera used with gstreamer is USB (checkout log up there) as the only one cam I have ever able to detect is USB
from libcamera.
To sum up USB are not supported, and, CSI-MIPI can not be detected... The problem is that no CSI-MIPI cameras have never been detected (I realise that just now...) on my raspberry pi: is there some patch I could apply (guided by you) to check why this occurs?...
If you start from a freshly install Raspberry Pi OS image, that should include everything needed to get any of the official Raspberry Pi cameras working out-of-the-box.
libcamera-apps provided by Raspberry Pi do not accept USB cameras.
Really?!.. If so this should be in top position in the doc... Didn't see it anywhere I looked. USB is a first entry point for almost everyone?!..
The expectations from the vast majority of our users is to seamlessly use one of our official Raspberry Pi cameras with libcamera-apps.
from libcamera.
I'm unclear if there is more to do for this issue on my end? If not, I'll close this down shortly.
from libcamera.
No solution. Can be closed.
from libcamera.
Just to clarify.
Uvc is not supported by raspberry pi's "libcamera-apps" therefore libcamera-vid / libcamera-hello ...
But uvc is supported by cam/qcam/gstreamer.
The gstreamer plugin should work with uvc cameras and Raspberry pi cameras. If there is a fault with the gstreamer plugin gstlibcamerasrc, please raise that at bugs.libcamera.org.
from libcamera.
Related Issues (20)
- Unable to build libcamera with Python bindings HOT 4
- IMX519 on bookworm
- RPI4B OV5647 Camera black screen! HOT 7
- libcamerasrc doesn't work with CM4 RPI Cam V2 and V3 HOT 5
- Can't start gstreamer pipeline after update HOT 4
- Raspberry Pi Camera Module 3 not available on RPi 5/bookworm HOT 2
- False colours from global shutter camera on RPi5 HOT 3
- Enabling sensor HDR for Camera Module v3 HOT 2
- RPI5 - Omnivision 9281 8 Bit Mode HOT 6
- No json for imx290 HOT 1
- libcamerify causes motion daemon to create zombie processes HOT 26
- "libqt5widgets" doesn't exist did you mean "libqt5widgets5" in your readme? HOT 2
- libcamerify causes motion daemon to create zombie processes
- `
- libcamerify not working rpi5 bookworm. Not enough buffers HOT 7
- Range format is ambiguous / libcamera is not installed HOT 8
- Installation issue HOT 2
- Since 6.6.31 Kernel: FramebufferAllocator allocates too much space HOT 19
- Camera frontend timeout fires too aggressively (crashing libcamerasrc on RPi5) HOT 5
- Mmap permission issue on Android 14 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libcamera.