# Virtual green screen



## OBS--user (Mar 18, 2021)

Hello,
where to start.........

I have also installed OBS on windows. And a test version of x-split-green screen. Works. And within skype both options, xsplit and OBS show up in skype as option to choose.

OBS is also installed on Ubuntu 16.04 and deepbacksub-0.2.0 which is a virtual green screen project from the internet. deepbacksub not perfect yet but should be possible to work with.
OBS has the following command:
options v4l2loopback devices=1 video_nr=13 card_label='OBS Virtual Camera'exclusive_caps=1
Beside video0 video13 is also present under /dev.

I start deepbacksub with
./deepseg -d -d -c /dev/video0 -v /dev/video13 -b images/green-screen.jpg
and a so called output.png starts with the camera picture and the green screen. I modified deepbacksub to 1280x720 instead of pre-programmed 640x480

With OBS I catch  output.png with windows capture and filter chroma key. The green screen is exchanged by an image an shows up perfectly with the captured output.png. But when I switch the button "start virtual camera" there is always a flicker within skype. Shortly the green screen is visible. Why that?

Beside what I also observed......
options v4l2loopback devices=2 video_nr=5,13 max_buffers=2 exclusive_caps=1,1 card_label="VirtualCam","OBS Virtual Camera"
generates video5 & video13.
With 
./deepseg -d -d -c /dev/video0 -v /dev/video5 -b images/green-screen.jpg
virtual picture shows up in skype.
With
./deepseg -d -d -c /dev/video0 -v /dev/video13 -b images/green-screen.jpg
nothing happens when using "start virtual camera".
Seems like that OBS takes only the first virtual video device?

Mostly I am interested in this flicker resp. how to avoid. Any ideas? Do I have to use other commands?


----------



## OBS--user (Mar 21, 2021)

Hm, looks like it is more difficult than I thought. Something happens with switching the "Start virtual camera" that the virtual green screen from deepbacksub starts to flicker.


----------



## OBS--user (Mar 21, 2021)

Just got an idea and now it works. No flicker anymore at Skype.

I just used the following command:

options v4l2loopback devices=2 video_nr=13,14 max_buffers=2 exclusive_caps=1,1 card_label="OBS Virtual Camera","VirtualCam"

Seems like that the video_nr.s are important? Now both devices are shown under Skype. When using the virtual cam it shows only myself and the green screen and by choosing "OBS Virtual Camera" it shows me with the background from OBS and no flicker anymore :-)


----------



## OBS--user (Mar 26, 2021)

I`ve made some trial-video-skype-calls with a friend and it definitly seems that more hadrware is necessary like for example a nvidia card which I am using now. The point is that there is a latency between Virtual camera 14 and Virtual camera 13. Virtual camera 14 with green screen which comes from deepbacksub is o.k.. But after OBS by video13 there is latency at the other side of skype call. Any possibility by adjustment to avoid this latency?

Other question: I also would like to try another linux software but that one doesn`t give out the camera picture by this so called output.png at deepbacksub-software which I am currently capturing by Window capture within OBS. How is it possible to capture for example /dev/video14 by OBS? Video 13 comes from OBS but currently cannot show anything at Skype via virtual camera 13 because I don`t know how to capture /dev/video14.


----------



## OBS--user (Mar 28, 2021)

Seems like that I am in my personal echo chamber.........giving my own answers. Well, if it is helpfull for others as well....

As above mentioned I also try another software which is called virtual-webcam





						Virtual Webcam
					

A program to replace the background in your webcam image



					www.virtual-webcam.com
				




That one has the advantage that a config-file can be used and for me it seems that not that sensitive in terms of lightning.
But without Nvidia graka at least for me no chance.

Unfortunatly as above mentioned no output.png as offered for deepbacksub. I found another methode but seems draggy at the end of the chain. But it is possible to open a second Skype instance (skypeforlinux --secondary). And as already mentioned virtualcam and OBS(video13 & 14) show up in Skype. From one Skype instance it is possible to capture the virtual cam(video 14) which is the camera picture and green-screen, and the other Skype instance is the output of OBS, without any flicker.


----------

