Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when launching QRpi #1

Open
supporto-wifiproject opened this issue Nov 20, 2023 · 3 comments
Open

Error when launching QRpi #1

supporto-wifiproject opened this issue Nov 20, 2023 · 3 comments

Comments

@supporto-wifiproject
Copy link

supporto-wifiproject commented Nov 20, 2023

I got this error when I launch QRpi
Using pipeline:
libcamerasrc ! video/x-raw, width=(int)1024, height=(int)768, framerate=(fraction)15/1 ! videoconvert ! videoscale ! video/x-raw, width=(int)1024, height=(int)768 ! appsink

(QRpi:774): GLib-GObject-WARNING **: 10:25:52.137: invalid cast from 'GstLibcameraSrc' to 'GstBin'

(QRpi:774): GStreamer-CRITICAL **: 10:25:52.137: gst_bin_iterate_elements: assertion 'GST_IS_BIN (bin)' failed

(QRpi:774): GStreamer-CRITICAL **: 10:25:52.137: gst_iterator_next: assertion 'it != NULL' failed

(QRpi:774): GStreamer-CRITICAL **: 10:25:52.137: gst_iterator_free: assertion 'it != NULL' failed

[ WARN:[email protected]] global cap_gstreamer.cpp:1535 open OpenCV | GStreamer warning: cannot find appsink in manual pipeline
[ WARN:[email protected]] global cap_gstreamer.cpp:1173 isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
[ WARN:[email protected]] global cap.cpp:204 open VIDEOIO(GSTREAMER): backend is generally available but can't be used to capture by name
Failed to open camera.
I'm worjing on a Pi4 with no desktop environment.
Could you help me, please?

@codewithriza
Copy link

Problem

It appears that the error you're encountering is related to the GStreamer pipeline setup using libcamerasrc on your Raspberry Pi 4. The error message suggests an issue with casting GstLibcameraSrc to GstBin.

Solution

One potential solution to address this issue is to encapsulate the libcamerasrc element within a bin in your GStreamer pipeline. Here's an example modification:

#!/bin/bash

gst-launch-1.0 -e libcamerasrc ! video/x-raw, width=1024, height=768, framerate=15/1 ! videoconvert ! videoscale ! video/x-raw, width=1024, height=768 ! appsink

Thank you! If you have any concerns or doubts, please feel free to let me know.

@supporto-wifiproject
Copy link
Author

I launch the command and I got this warning: WARNING: erroneous pipeline: no element "videoconvert"
Then I lauch QRpi but I got the same problem

@codewithriza
Copy link

It seems that the warning "WARNING: erroneous pipeline: no element 'videoconvert'" indicates that the 'videoconvert' element is not available within your GStreamer installation or configuration.

To resolve this issue, you may need to install the necessary GStreamer plugins or verify if they are properly installed on your system. 'videoconvert' is a part of the GStreamer base plugins and is commonly used for format conversion within GStreamer pipelines.

Try installing the GStreamer base plugins using your system's package manager. For instance, on Debian-based systems, you can use:

sudo apt-get install gstreamer1.0-plugins-base

Replace this command with the appropriate package manager command based on your system.

If 'videoconvert' is already installed or after installing it, if the issue persists, consider modifying the GStreamer pipeline to use an alternative or equivalent element that performs a similar function. For instance, 'autovideoconvert' or 'ffmpegcolorspace' could be viable alternatives.

Modify the pipeline as follows:

libcamerasrc ! video/x-raw, width=(int)1024, height=(int)768, framerate=(fraction)15/1 ! autovideoconvert ! videoscale ! video/x-raw, width=(int)1024, height=(int)768 ! appsink

After making these changes, try running the command again. If the problem persists, providing more details about your system configuration or the specific GStreamer version being used can help in further troubleshooting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants