faceit_live3 icon indicating copy to clipboard operation
faceit_live3 copied to clipboard

Add chmod 777 of webcam

Open dlgiant opened this issue 3 years ago • 3 comments

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>

dlgiant avatar Oct 17 '20 18:10 dlgiant

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?

jdtimmerman avatar Oct 26 '20 14:10 jdtimmerman

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

HumanG33k avatar Oct 27 '20 19:10 HumanG33k

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.

dlgiant avatar Oct 27 '20 20:10 dlgiant