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

Add chmod 777 of webcam #18

Open
dlgiant opened this issue Oct 17, 2020 · 3 comments
Open

Add chmod 777 of webcam #18

dlgiant opened this issue Oct 17, 2020 · 3 comments

Comments

@dlgiant
Copy link

dlgiant commented Oct 17, 2020

System: Ubuntu 20.04.1

Command:

python faceit_live.py --system linux --webcam_id 1

Error:

Linux version, importing FakeWebCam
CUDA is available:  True
Device Name: GeForce RTX 2080 Ti
Device Count: 1
CUDA:  10.1
cuDNN 7603
Device 0
Scanning /media folder for images to use...
./media/oliver.jpg
./media/oliver2.jpg
Traceback (most recent call last):
  File "faceit_live.py", line 285, in <module>
    main()
  File "faceit_live.py", line 87, in main
    camera = pyfakewebcam.FakeWebcam(f'/dev/video{stream_id}', webcam_width, webcam_height)
  File "/home/rick/anaconda3/envs/faceit_live3/lib/python3.8/site-packages/pyfakewebcam/pyfakewebcam.py", line 54, in __init__
    fcntl.ioctl(self._video_device, _v4l2.VIDIOC_S_FMT, self._settings)
OSError: [Errno 22] Invalid argument

Suggestion:

add line below to the README.md:
chmod 777 /dev/video<x>

@jdtimmerman
Copy link

This was not neccesary for me (on Manjaro). These resources have a group owner video

$ ls -la /dev/video*
crw-rw----+ 1 root video 81, 0 26 okt 09:15 /dev/video0
crw-rw----+ 1 root video 81, 1 26 okt 09:15 /dev/video1
crw-rw----+ 1 root video 81, 2 26 okt 09:15 /dev/video2
crw-rw----+ 1 root video 81, 3 26 okt 09:15 /dev/video3
crw-rw----+ 1 root video 81, 4 26 okt 12:12 /dev/video4

Are you in this group?

@HumanG33k
Copy link

NEVER NEVER do a chmod 777.

In 99.9999999999% case a security issue.

Same here on debian so on ubuntu

$ ls -la /dev/video*
crw-rw----+ 1 root video 81, 0 26 oct.  19:01 /dev/video0
crw-rw----+ 1 root video 81, 1 26 oct.  19:01 /dev/video1
crw-rw----+ 1 root video 81, 2 27 oct.  18:16 /dev/video2

@dlgiant
Copy link
Author

dlgiant commented Oct 27, 2020

I was getting the error shown up to the moment I performed the chmod. My suggestion was just for the case another user find themselves getting OSError: [Errno 22] Invalid argument.

But I agree with @HumanG33k, a chmod 777 is a horrible idea in a production environment, it can leave a lot resources vulnerable.

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

3 participants