Giter VIP home page Giter VIP logo

Comments (13)

hs-neax avatar hs-neax commented on May 22, 2024 2

@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

from webcam-filters.

jashandeep-sohi avatar jashandeep-sohi commented on May 22, 2024 1

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.

from webcam-filters.

jashandeep-sohi avatar jashandeep-sohi commented on May 22, 2024

What happens when you do a webcam-filters --list-dev-caps /dev/video0 (or whichever /dev/videoX is your actual webcam)?

from webcam-filters.

jekkos avatar jekkos commented on May 22, 2024

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

from webcam-filters.

jashandeep-sohi avatar jashandeep-sohi commented on May 22, 2024

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.

from webcam-filters.

hs-neax avatar hs-neax commented on May 22, 2024

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

from webcam-filters.

jekkos avatar jekkos commented on May 22, 2024

Ok the error went away after running

sudo apt install python3-gst-1.0

can be closed, thx

from webcam-filters.

jekkos avatar jekkos commented on May 22, 2024

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?

from webcam-filters.

jashandeep-sohi avatar jashandeep-sohi commented on May 22, 2024

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

from webcam-filters.

jashandeep-sohi avatar jashandeep-sohi commented on May 22, 2024

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?

from webcam-filters.

DmitrySandalov avatar DmitrySandalov commented on May 22, 2024

Please add Ubuntu installation instructions to README.md

from webcam-filters.

hs-neax avatar hs-neax commented on May 22, 2024

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

from webcam-filters.

sboehringer avatar sboehringer commented on May 22, 2024

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?

from webcam-filters.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.