Code Monkey home page Code Monkey logo

Comments (4)

LPBourret avatar LPBourret commented on May 16, 2024

Hi,
I guess you are asking 2 questions:

  1. how can you install the virtual camera UWP control app?
    follow the steps 1 to 4 in the readme section related to the app (https://github.com/microsoft/Windows-Camera/tree/master/Samples/VirtualCamera#virtualcameramanager_app). This will allow you to launch the UWP app from which you can create and destroy virtual camera instances using a GUI. In this case though you don't need to run VirtualCamera_Installer which does mostly the same thing as the app but from cmd line.

  2. how to use the same camera from more than 1 app concurrently? VirtualCamera is not meant to be a way to allow concurrent usage of a camera from more than 1 app. VCam is a mechanism to virtually 'plug' a new camera on the system, and have that camera produce frames/expose capabilities in a vast number of ways such as wrapping an existing camera or synthetizing frames on its own. MediaCapture is a client-side API to instantiate a camera handle and use it from an app. That said, this quesitons refers to the 'sharing mode' with which you initialize your camera client (i.e. in WinRT this would be your MediaCapture instance, the way you initialize it using a MediaCaptureInitializationSettings and specifying a MediaCaptureSharingMode)
    if an app initializes a camera client with SharingMode == ExclusiveControl (most if not all apps do), then only it can control the camera (i.e. change MediaType, set controls, etc.). However, a second app can open the same camera using a camera client initialized with SharingMode == SharedReadOnly, which will allow it to receive frames but not to change the MediaType nor set controls. I think this is what you are asking for correct? Your other app needs to open the camera in SharedReadOnly to receive frames despite the other app concurrently running and using the same camera with a client initialized in ExclusiveControl.

from windows-camera.

DavitMob avatar DavitMob commented on May 16, 2024

Thank you very much for the detailed comment @LPBourret . For some reason I was told that in order for the camera to be accessed concurrently, I need to create a virtual camera. So I don't. I will just use WinRT in my app to initialize my camera in SharedReadOnly mode. I assume this will work in any scenario, right? That is, regardless what api the other app is using to initialize the camera (for example, regardless if the other app is a UWP app or not), I can always use the camera in SharedReadOnly mode, right?

from windows-camera.

LPBourret avatar LPBourret commented on May 16, 2024

Hi, yes mostly as there is a caveat sadly:
some USB cameras that started to ship a while ago may block you from reading from them even in shared mode if the other app is using them via DShow (an older API instead of MF or WinRT).
We have been requiring cameras to not do this but we can't prevent 1) older hardware that already shipped and 2) older apps that still use DShow to get you in that situation in your UWP app even when using readonly sharedmode when 1) + 2) are put together. There is however nothing that can be done in that situation to read frames concurrently so your approach is the one to use to cover that experience.

from windows-camera.

DavitMob avatar DavitMob commented on May 16, 2024

Thanks @LPBourret . Closing the issue.

from windows-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.