Open jekkos opened 3 years ago
What happens when you do a webcam-filters --list-dev-caps /dev/video0
(or whichever /dev/videoX
is your actual webcam)?
I get the same message in fact. I double checked if I can change some setting on this device, it seems fine.
sudo v4l2-ctl --set-ctrl=exposure_absolute=90 -d /dev/video0
this works
➜ ~ webcam-filters --list-dev-caps /dev/video0
<Gst.Caps object at 0x7f382db4f100 (GstCaps at 0x26e9940)>
Traceback (most recent call last):
File "/home/restore/.local/bin/webcam-filters", line 9, in <module>
sys.exit(main())
File "/home/restore/.local/lib/python3.8/site-packages/webcam_filters/__main__.py", line 5, in main
cli.main(prog_name="webcam-filters")
File "/home/restore/.local/lib/python3.8/site-packages/click/core.py", line 1061, in main
with self.make_context(prog_name, args, **extra) as ctx:
File "/home/restore/.local/lib/python3.8/site-packages/click/core.py", line 923, in make_context
self.parse_args(ctx, args)
File "/home/restore/.local/lib/python3.8/site-packages/click/core.py", line 1379, in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
File "/home/restore/.local/lib/python3.8/site-packages/click/core.py", line 2364, in handle_parse_result
value = self.process_value(ctx, value)
File "/home/restore/.local/lib/python3.8/site-packages/click/core.py", line 2326, in process_value
value = self.callback(ctx, self, value)
File "/home/restore/.local/lib/python3.8/site-packages/webcam_filters/gst.py", line 369, in print_device_caps
for c in caps:
TypeError: 'Caps' object is not iterable
Did you install all of the system dependencies? Specifically, is gst-python
installed and what version? #5 is similar and they needed python3-gst-1.0
on Ubuntu.
If that doesn't fix it or you run into other dependency issues, I'd recommend installing with https://github.com/jashandeep-sohi/webcam-filters#nix. There are too many variations in gstreamer dependencies between distros, and I've found Nix to be the best way to ensure everyone's working with the same versions.
I'm having the same issue on an up-to-date arch: gst-python 1.18.5-1 gstreamer 1.18.5-1 Python 3.9.7
Ok the error went away after running
sudo apt install python3-gst-1.0
can be closed, thx
Wait, now I'm seeing this error
Error from /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Could not open device '/dev/video2' for reading and writing.
my video2 device is a virtual one created by v4l2 loopback. Any idea why this is?
Wait, now I'm seeing this error
Error from /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Could not open device '/dev/video2' for reading and writing.
my video2 device is a virtual one created by v4l2 loopback. Any idea why this is?
@jekkos
What are the kernel mod parameters you created this device with?
To rule out if this is a problem with webcam-filters
can you run the following basic gstreamer pipeline:
gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! video/x-raw, format=YUY2 ! v4l2sink device=/dev/video2
I'm having the same issue on an up-to-date arch: gst-python 1.18.5-1 gstreamer 1.18.5-1 Python 3.9.7
@hs-neax Is gst-plugins-base
and gst-plugins-good
also installed?
@jashandeep-sohi: Yes they are. Don't know whats causing it. I created a Dockerfile instead, since I considered that more useful as an alternative to nix than fixing user system specific stuff. Maybe it'd be worth adding that to the repo with an a bit more generalized start.sh.
Dockerfile
FROM ubuntu:impish
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3.9 \
python3-pip \
python3-gi python3-gi-cairo gir1.2-gtk-3.0 \
gstreamer1.0-plugins-good gstreamer1.0-plugins-base-apps gstreamer1.0-x python3-gst-1.0 gstreamer1.0-python3-plugin-loader
RUN pip install --pre webcam-filters
COPY start.sh .
CMD ["/bin/bash","start.sh"]
start.sh
#!/bin/bash
webcam-filters --input-dev /dev/video0 --output-dev /dev/video10 --background-blur 150
$ docker run --device=/dev/video0:/dev/video0 --device=/dev/video10:/dev/video10 webcam-filters
Please add Ubuntu installation instructions to README.md
Apologies for the delayed response.
@hs-neax Happy to discuss any contributions in a PR. My reasoning for using Nix vs Docker was to have as "native" an experience as possible without having to mount any devices into a container run by the docker daemon (as root). It's been flaky for me in the past.
I don't mind adding a Dockerfile if that makes life easier, but I'm not sure I want to maintain a parallel file with dependencies for installing this. If possible, I'd prefer it if the Dockerfile also installed it using Nix or the container was built using Nix. And then CI can just push the image out to a public repository.
@DmitrySandalov Sounds good! I did pin #11, but it's probably a good idea to add that to the README.
@jashandeep-sohi: Sorry for the big delay. I understand your point about maintenance and made PR with a simple Docker container wrapping a Nix installation. I'm using it for a while now and it's working well.
I get the same error on openSUSE Tumbleweed 20221124. All dependencies seem to be installed.
Could you please post a command line equivalent of a pipeline produced by the package?
When running webcam-filters I get the following traceback
I tried different devices but always the same result. Anything else I can check?