brunoherbelin / vimix

Live Video Mixer
GNU General Public License v3.0
259 stars 25 forks source link

Only first virtual webcam shows up? #98

Closed RKelln closed 10 months ago

RKelln commented 1 year ago

I was testing for my upcoming concert and need 2 virtual webcams at one point (using v4l2loopback), but I only get the first showing up in the Connected, select stream drop down?

$ sudo modprobe v4l2loopback devices=2 exclusive_caps=1 video_nr=2 card_label="Virtual Camera","Virtual Camera 2"

$ v4l2-ctl --list-devices

Virtual Camera (platform:v4l2loopback-000):
    /dev/video2

Virtual Camera 2 (platform:v4l2loopback-001):
    /dev/video3

Laptop Camera: Laptop Camera (usb-0000:00:14.0-7):
    /dev/video0
    /dev/video1
    /dev/media0

In the drop down there is only "Virtual Camera" if I use gsstreamer to send two different windows to the different /dev/videoN, e.g.:

$ gst-launch-1.0 ximagesrc xname=WindowNameHere use-damage=0 show-pointer=0 ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! v4l2sink device=/dev/video2

Works but:

gst-launch-1.0 ximagesrc xname=WindowNameHere use-damage=0 show-pointer=0 ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! v4l2sink device=/dev/video3

Does not show up in the list.

Any chance you could take at look at this asap?

RKelln commented 1 year ago

The other option would be adding window sharing instead of just screen sharing, but that seems like a much larger fix?

brunoherbelin commented 1 year ago

I will investigate your issue report, but for a quick solution, try creating a 'Generated' source with a 'Custom' generator. For the generator, put the start of the pipeline source:

ximagesrc xid=0x4800002 use-damage=0 show-pointer=0 ! video/x-raw,framerate=30/1

This is a solution to create manually a single window capture source under linux :

image

I didn't have time to implement this with a 'clic window to capture' simplified user interface, and also it is not robust to saving the session (windows id change). What do you use as window name? It is also different everytime, no ?

(NB: I'm not even mentioning that I don't have the solution for OSX, which would also be good to implement for vimix)

RKelln commented 1 year ago

Ah thanks, that's sweet, will give it a try. The window names are always the same (for the performance) so I can use xname which hopefully will allow saved sessions to work (since I'm hoping to switch between them during a song). Appreciate the quick reply!

RKelln commented 1 year ago

Yes this is working for me. For whatever reason windows xname with multiple word titles doesn't work, but fortunately the window I need to reuse is my own software so set to a single word title, and the web browser I can stick into a single mix so I only have to set it once (for every time that window is opened).

brunoherbelin commented 10 months ago

Update on latest Beta 9ff5b90605662ab163ee4eb4c19fe70e63685bd8 ; Now the selection of window is possible in GUI:

image

RKelln commented 10 months ago

Nice! That will make things much easier for everyone, thanks!