-
Notifications
You must be signed in to change notification settings - Fork 2
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
fcntl.ioctl() Invalid argument #5
Comments
Getting same error here
using fedora |
I also just stuck with the same:
using Ubuntu 18.04 LTS |
I managed to fix it. Try selecting different device - for me |
actually I has already done that. I have 3 devices (1, 2 virtual): I have tried all of them and got the same error. |
No, it still not work. But here has good news for you guys: nowadays nobody uses a built-in pc camera anymore. Everybody uses they phone to record videos. |
Does |
@MinerChAI Hi there, I think the problem here is that you are using a different OS than us. I'm personally using ubuntu 19.10. What's yours? (This is maybe the key to solve this problem since the author of this package disappeared) |
I need it to "fake" the camera of my pc. I can't fake the camera of my
android device.
Il Mer 8 Apr 2020, 17:01 yingshaoxo <notifications@github.com> ha scritto:
… No, it still not work.
But here has good news for you guys: nowadays nobody uses a built-in pc
camera anymore. Everybody uses they phone to record videos.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFFQR4ZNLRB6CEXFZQMMFPLRLSGVFANCNFSM4KPIEMFQ>
.
|
Mine is Manjaro but I don't think that's the problem |
Yes, for my webcam it works fine (base) racks@ubuntu:~$ ffplay /dev/video2 |
Did you run the modprobe thing? |
of course: root@ubuntu:/home/racks# modprobe v4l2loopback devices=2 Dummy video device (0x0001) (platform:v4l2loopback-001): Droidcam (platform:v4l2loopback_dc-000): |
And what about |
it sees only the real webcam
|
Then seems like modprobe didn't create the devices |
@MinerChAI Thank you for your help. Now I know how to make it work. Step 1:install pyfakewebcam by Step 2:install v4l2 by Step 3:set v4l2 by Step 4:check the right virtual cam by Step 5:run python script:
Step 6:check the result by In the endBig thanks to the author @jremmons |
Is it possible to install v4l2loopback-utils
*On fedora?*
Il Gio 9 Apr 2020, 12:06 yingshaoxo <notifications@github.com> ha scritto:
… @MinerChAI <https://github.com/MinerChAI> Thank you for your help.
Now I know how to make it work.
Step 1:
install pyfakewebcam by sudo pip3 install pyfakewebcam
Step 2:
install v4l2 by sudo apt install v4l2loopback-utils
Step 3:
set v4l2 by modprobe v4l2loopback devices=1
Step 4:
check the right virtual cam by ls /dev | grep -P '^video\d+$'. use the
last one, for example, /dev/video3
Step 5:
run python script:
import time
import pyfakewebcam
import numpy as np
blue = np.zeros((480,640,3), dtype=np.uint8)
blue[:,:,2] = 255
red = np.zeros((480,640,3), dtype=np.uint8)
red[:,:,0] = 255
camera = pyfakewebcam.FakeWebcam('/dev/video3', 640, 480)
while True:
camera.schedule_frame(red)
time.sleep(1/30.0)
camera.schedule_frame(blue)
time.sleep(1/30.0)
Step 6:
check the result by ffplay /dev/video3
In the end
Big thanks to the author @jremmons <https://github.com/jremmons>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFFQR46HD25H4KOUYFFPYZ3RLWM2FANCNFSM4KPIEMFQ>
.
|
FWIW I have read in another tutorial that after running |
actually I have done just like you have written and still have just this:
|
If you have v4l-utils installed, you can run |
Same issue here:
Update and fixI fixed it with some more research. An v4l2 loopback issue suggested there are problems with some newer kernel version. Proposed solution was to install the kernel module from github instead of using the officially distributed v4l2-loopback package from Ubuntu 18.04. Hence, downloaded and installed, and now the red/blue example is working. |
After running the example, I get this error:
So I printed out the
self._video_device, _v4l2.VIDIOC_S_FMT, self._settings
:I don't know where goes wrong there. Can you have a look? Please.
The text was updated successfully, but these errors were encountered: