Default camera device to show screen instead of physical camera

18

on many websites etc. it asks permission to use your camera, which points to your defualt camera in windows. I was wondering if there was a way to setup that default camera to show your actual windows screen, instead of the picture from the webcam.

So for example if you were allow access to your camera on a website, it would show your screeen, or a region thereof, instead of your webcam picture.

Is this posssible? windows 10

bluejayke

Posted 2019-08-19T06:51:04.753

Reputation: 283

3

This seems to be an xy problem. If you don't want to show your camera picture, why would you want to share your screen?

– Máté Juhász – 2019-08-19T07:09:21.777

10@MátéJuhász its not at all an xy problem... I don't want to show my camera picture; instead, I want to show what's on my screen. Digital image instead of physical, real life image. I don't seee any contradiction? – bluejayke – 2019-08-19T09:46:09.407

14@bluejayke The reason they think it's an xy problem is because you're asking us about your solution to your problem rather than the problem itself. In other words, why do you want your camera to show what's on your screen? It's possible that another solution that you haven't thought of makes more sense. – MiniRagnarok – 2019-08-19T17:00:35.887

Well, point the camera towards the screen (or use a suitably convex mirror in front of the top-bezel of the lid to point to the camera and horizontally flip the feed. ;) – Vaibhav Garg – 2019-08-20T03:40:18.853

@VaibhavGarg Two mirrors. – wizzwizz4 – 2019-08-20T16:34:59.703

@wizzwizz4 that will surely do!! – Vaibhav Garg – 2019-08-21T05:14:14.913

Answers

26

Making the browser itself pretend there's a "desktop" camera would be technically possible, but since it would only work with that single browser, it doesn't look like anyone has done this yet. (At least I couldn't find any work for Chrome or Firefox – even though they have 'screen sharing' as a WebRTC feature, nobody seems to have linked it to webcam API yet.)

However, there are products which install a custom device driver that creates a virtual "webcam" device, which is then usable by any program. Your web browser will think you have two webcams; you still need to approve camera requests, and it's still up to you to choose the "preferred" camera.

I googled "virtual camera device" and found several products which can stream the desktop, for example Webcamoid (appears to be multi-platform and open-source), VCam (commercial), OBS VirtualCam (a plugin for OBS).

(For Linux there are two 'generic' drivers, akvcam or the older v4l2loopback, but they still need a program that would provide the actual video data. For Windows and macOS each product most likely uses its own custom drivers.)

user1686

Posted 2019-08-19T06:51:04.753

Reputation: 283 655

9"but they still need a program that would provide the actual video data" -- ffmpeg can be used to provide the desktop as a video feed: ffmpeg -f x11grab -video_size "$(xrandr | grep -Po '(?<=primary )\d+x\d+')" -i "$DISPLAY" -c:v ffvhuff -f matroska - | mpv - – JoL – 2019-08-19T15:37:15.673

@JoL Note that the command in the comment above is for Linux only. It won't work on Windows, which this question is about. – Andrew Savinykh – 2019-08-19T19:37:52.833

@AndrewSavinykh Yep, but the part I quoted was about Linux. – JoL – 2019-08-19T19:41:39.110

1

This is not possible, since access to the camera means camera only, as the browser's security and permissions model is pretty tight nowadays.

That is, unless your camera software does screen-sharing (but I haven't yet encountered such software).

If you would like to do screen-streaming, your best tool is VLC.
See this answer of mine for instructions.

harrymc

Posted 2019-08-19T06:51:04.753

Reputation: 306 093

7Surely there are programs which create a virtual camera device? Linux has akvcam and v4l2loopback. – user1686 – 2019-08-19T07:19:18.530

1@grawity: Yes, but they have to be installed as programs, not via a website in the browser. Add-ons have more liberty, but they will still need to use unpatched vulnerabilities to escape the browser's sandbox. – harrymc – 2019-08-19T08:26:17.990

3Can't see where OP asked for it to be done through the website itself... – user1686 – 2019-08-19T09:06:56.933

@grawity: Understanding differs. – harrymc – 2019-08-19T09:08:23.677

1@harrymc indeed the question didn't ask for it to be done through the website, the question is a windows 10 question; what software can I install, on my windows 10, to create a "virtual camera"? – bluejayke – 2019-08-19T09:47:23.940

@grawity you were right:) – bluejayke – 2019-08-19T09:48:33.700

1

I'm a bit lost. Do you mean you are looking for screen-sharing through the browser? This is not connected to the camera and Chrome can do that (Chrome Remote Desktop). Or programs like Team Viewer.

– harrymc – 2019-08-19T09:55:18.810

@harrymc You are indeed lost. There is a website, which uses browser features to access the computer's camera. This OP wishes to send, instead, a video feed of their desktop, to said website using this "camera" interface. Remote Desktop and Team Viewer are not at all relevant. – Lightness Races with Monica – 2019-08-20T16:11:38.967