intermezzio / weffe

Add effects to a webcam in Linux for Zoom, Webex, or other calls, or stream a video to a webcam, including blurred background
https://intermezzio.me/weffe/
MIT License
125 stars 8 forks source link

Error when starting weffe for the second time #14

Closed Glecun closed 1 year ago

Glecun commented 2 years ago

Hi ! I've got an error when I restart weffe (great job btw).

Example:

weffe -a
weffe -r

works perfectly fine But when I close the terminal and re-open an other and redo this:

weffe -a
weffe -r

I've got an error

...
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x55fd0908e440] ioctl(VIDIOC_G_FMT): Invalid argument
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 
Conversion failed!
intermezzio commented 2 years ago

Is the first process still running? e.g. if you run ps aux | grep weffe does it show a task running? Alternatively, this may be because the input webcam stream is already being used by another application.

Glecun commented 2 years ago

if you run ps aux | grep weffe does it show a task running?

Unfortunately no :disappointed:

I think there is an error when re-creating a blank virtual webcam. If I retry weffe -a, it doesn't print any errors but I can't see/select the virtual webcam in chrome (for example)

entropax commented 1 year ago

Same problem.. :(

intermezzio commented 1 year ago

weffe -a is supposed to create the virtual webcam by loading v4l2loopback, a kernel module. Right now there's no wrapper command to remove this kernel module although running sudo modprobe -r v4l2loopback would undo that (I can add this soon). Can you tell me if that works? If so, I may make weffe -a automatically remove an existing v4l2loopback module before reactivating it.

As a side note, was Chrome opened before weffe -a was run? Sometimes the kernel module has to be activated and the virtual webcam has to be streaming when a program is opened for that software to recognize it.

Glecun commented 1 year ago

Can you tell me if that works? If so, I may make weffe -a automatically remove an existing v4l2loopback module before reactivating it.

I can confirm that running sudo modprobe -r v4l2loopback before weffe -a definitively works ! :tada:

intermezzio commented 1 year ago

I've just merged this change so you can rerun weffe -a without the modprobe commnad. Hope this helps!