Giter Club home page Giter Club logo

windows-camera's Introduction

Windows Platform sample applications and tools for using and developing the Camera features

This repo contains sample applications that demonstrate the API usage patterns for using the camera related features on Universal Windows Platform (UWP), Win32 Desktop platform and .NetCore 3.0 for Windows 10. These code samples were created with the project templates available in Visual Studio, and are designed to run on desktop, mobile, and future devices.

Note: If you are unfamiliar with Git and GitHub, you can download the entire collection as a ZIP file, but be sure to unzip everything to access shared dependencies.

Universal Windows Platform (UWP) samples/tools

These samples require Visual Studio 2017 Update 4 or higher and the Windows Software Development Kit (SDK) version 16299 for Windows 10 or higher on a per-sample basis.

Get a free copy of Visual Studio 2017 Community Edition with support for building Universal Windows Platform apps

Additionally, to stay on top of the latest updates to Windows and the development tools, become a Windows Insider by joining the Windows Insider Program.

Become a Windows Insider

Win32 Desktop applications/tools

These samples require Visual Studio 2017 Update 4 or higher and the Windows Software Development Kit (SDK) version 17763 for Windows 10.

.NetCore 3.0 Desktop applications/tools

These samples require .NetCore 3.0 SDK and Visual Studio 2019 preview. (https://visualstudio.microsoft.com/vs/preview/)

Using the samples

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the following link or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in Visual Studio.

Download the samples ZIP

Notes:

  • Before you unzip the archive, right-click it, select Properties, and then select Unblock.
  • Be sure to unzip the entire archive, and not just individual samples. The samples all depend on the SharedContent folder in the archive.
  • In Visual Studio 2017, the platform target defaults to ARM, so be sure to change that to x64 or x86 if you want to test on a non-ARM device.

The samples use Linked files in Visual Studio to reduce duplication of common files, including sample template files and image assets. These common files are stored in the SharedContent folder at the root of the repository, and are referred to in the project files using links.

Reminder: If you unzip individual samples, they will not build due to references to other portions of the ZIP file that were not unzipped. You must unzip the entire archive if you intend to build the samples.

For more info about the programming models, platforms, languages, and APIs demonstrated in these samples, please refer to the guidance, tutorials, and reference topics provided in the Windows 10 documentation available in the Windows Developer Center. These samples are provided as-is in order to indicate or demonstrate the functionality of the programming models and feature APIs for Windows.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Samples

360-degree camera capture/record/preview
Win32 Desktop console application demonstrating use of Windows Media Capture APIs
WinRT applications demonstrating use of custom KS Camera Extended Properties and extraction of frame metadata
Win32 Desktop application and libraries demonstrating use of Windows APIs and Windows Media Foundation APIs for RTP/RTSP streaming from camera
Sample of Virtual Camera mediasource and configuration app
Sample of Companion Settings app to read and save default configurations via IMFCameraConfigurationManager APIs
Sample of Control Monitoring app that listens changes to various camera controls
Sample of a single C# project for a UWP app that looks for a Windows Studio camera and interacts with its effects via generic KS Camera Extended Properties APIs

windows-camera's People

Contributors

dependabot[bot] avatar gerritsmsft avatar j-leungyy avatar kasumman avatar lpbourret avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar naveenthum avatar sudhaushu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

windows-camera's Issues

Debug output from avcore\mf\frameserver

This is easy to reproduce in Sample/WMCConsole_winrtcpp but actually applies to any kernel streaming frameserver client.
Is there a way to turn of make internal debug messages from frameserver?

Thank you.

avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(1) tid(5884) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(2) tid(5884) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(3) tid(5884) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(1734)\MFSENSORGROUP.dll!00007FFC0CF7B606: (caller: 00007FFC0CF4A3C2) ReturnHr(4) tid(5884) C00D36D6 The requested value is not available.avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF449FD) ReturnHr(5) tid(5884) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF44A70) ReturnHr(6) tid(5884) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF44ABC) ReturnHr(7) tid(5884) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(1308)\MFSENSORGROUP.dll!00007FFC0CF7C6DE: (caller: 00007FFC0CF44B05) ReturnHr(8) tid(5884) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(9) tid(5884) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(10) tid(5884) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(11) tid(5884) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(1734)\MFSENSORGROUP.dll!00007FFC0CF7B606: (caller: 00007FFC0CF4A3C2) ReturnHr(12) tid(5884) C00D36D6 The requested value is not available.avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF449FD) ReturnHr(13) tid(5884) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF44A70) ReturnHr(14) tid(5884) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF44ABC) ReturnHr(15) tid(5884) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(1308)\MFSENSORGROUP.dll!00007FFC0CF7C6DE: (caller: 00007FFC0CF44B05) ReturnHr(16) tid(5884) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(17) tid(55e0) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(18) tid(55e0) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(19) tid(55e0) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(1734)\MFSENSORGROUP.dll!00007FFC0CF7B606: (caller: 00007FFC0CF4A3C2) ReturnHr(20) tid(55e0) C00D36D6 The requested value is not available.avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF449FD) ReturnHr(21) tid(55e0) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF44A70) ReturnHr(22) tid(55e0) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF44ABC) ReturnHr(23) tid(55e0) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(1308)\MFSENSORGROUP.dll!00007FFC0CF7C6DE: (caller: 00007FFC0CF44B05) ReturnHr(24) tid(55e0) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(25) tid(55e0) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(26) tid(55e0) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(362)\MFSENSORGROUP.dll!00007FFC0CF7C0DE: (caller: 00007FFC0CF3F41C) ReturnHr(27) tid(55e0) 80070490 Element not found.
avcore\mf\frameserver\fsutils\fsutils.cpp(1734)\MFSENSORGROUP.dll!00007FFC0CF7B606: (caller: 00007FFC0CF4A3C2) ReturnHr(28) tid(55e0) C00D36D6 The requested value is not available.avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF449FD) ReturnHr(29) tid(55e0) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF44A70) ReturnHr(30) tid(55e0) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(639)\MFSENSORGROUP.dll!00007FFC0CF7C26A: (caller: 00007FFC0CF44ABC) ReturnHr(31) tid(55e0) 80070002 The system cannot find the file specified.
avcore\mf\frameserver\fsutils\fsutils.cpp(1308)\MFSENSORGROUP.dll!00007FFC0CF7C6DE: (caller: 00007FFC0CF44B05) ReturnHr(32) tid(55e0) 80070002 The system cannot find the file specified.

How to register the VirtualCameraMediaSource DLL without the MSI?

I'm trying to register the VirtualCameraMediaSource.dll without using the MSI installer.

Using the MSI, the sample worked very well, but I don't want to use this installer.
I tried to call the regsvr32.exe to register the DLL, but it failed.
Also, based on the README, I tried to add the registry entries manually and it didn't work too.

I created a .reg file exporting the registry entries created by the installer and changed the DLL path to a different path and it also didn't work.

This is my .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{7B89B92E-FE71-42D0-8A41-E137D06EA184}]
@="VirtualCameraMediaSource"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{7B89B92E-FE71-42D0-8A41-E137D06EA184}\InProcServer32]
"ThreadingModel"="Both"
@=""C:\\VirtualCamera\\VirtualCameraMediaSource.dll""

After adding these registry entries, the DLL isn't being loaded. I really don't know the difference between adding from the MSI and manually.

Anyone know how to do it without the MSI? Thanks :)

not compatible on WeChat Video chatting

I make a fork on my account,add mft for MPEG to NV12,because none of my notebooks can use this sample。
https://github.com/comor86/Windows-Camera
It works for most apps,but not on WeChat PC version(https://windows.weixin.qq.com/)。
When I using the virtual camera for video chat,I can't switch to the physical camera,and after closing the video chat,the Camera Led still lighting, unless I exit the WeChat app.
I make a small chang on SetStreamState()

        winrt::slim_lock_guard lock(m_Lock);

        RETURN_IF_FAILED(_CheckShutdownRequiresLock());
        DEBUG_MSG("[%d] SetStreamState %d", m_dwStreamId, state);

        wil::com_ptr_nothrow<IMFMediaStream2> spStream2;
        RETURN_IF_FAILED(m_spDevStream->QueryInterface(IID_PPV_ARGS(&spStream2)));
        RETURN_IF_FAILED(spStream2->SetStreamState(state));

        if (state == 0)
        {
            std::thread([&]() {
                std::this_thread::sleep_for(std::chrono::milliseconds(3));
                if (m_parent != NULL)
                {
                    m_parent->Shutdown();
                }
                });
        }

        return S_OK;

And it seems work, but cause other problem.
Wish a better dealing for this, thanks!

Can't get DefaultController when turning on the MEP Automatic Framing

Hi ,
I'm trying to get DefaultController to turn on or off mep features (Blur , Eye Contact , Automatic Framing).
I found a strange issue, that When turning on the Automatic Framing , I will get a exception:

Unspecified error

 

D:\github\Windows-Camera\Samples\CameraSettingsExternalSettingsApp\DefaultControlHelper\DefaultControlHelper.cpp(104)\DefaultControlHelper_WinRT.dll!00007FFA753EFA8C: (caller: 00007FFA753E3049) Exception(1) tid(1350) 8007000D The data is invalid.
    [winrt::DefaultControlHelper::implementation::DefaultController::DefaultController(existingControlDefaults->UnlockControlData())]

Can you double confirm that ?

Thanks

What cameras are windows compliant 360-degree cameras?

How do know what cameras/webcams are windows compliant 360-degree cameras? Is there a list somewhere?
When I tested this on my Dell Alienware R17 laptop it could detect the Integrated Webcam. It also detected the cameras built into the Samsung Odyssey HMD. I also worked with the Logitech C920 external webcam. It did NOT work with my Ricoh Theta V 360 camera. (the only 360 camera I have)

The problem with this camera I found in debugging the program was in the check for:

sourceInfo.SourceKind == MediaFrameSourceKind.Color  // (MainPage.xaml.cs Line#501)

where my Ricoh Theta V was reporting as

MediaFrameSourceKind.Custom

and thus not compliant?

Is this something I can tweak the app to get working with the Ricoh Theta V, or do I need to hope that Ricoh will update the driver?

And is there a list of complaint camera's somewhere?
@Sudhaushu @LPBourret

Can't set default value of MEP Automatic Framing with DefaultController

Hi ,
I get a exception when I try to set default value with the default controller of auto-framing.

 private void DefaultAFToggle_Toggled(object sender, RoutedEventArgs e)
        {
            try
            {
                int flags = (int)((DefaultAFToggle.IsOn == true) ? AutoFramingCapabilityKind.KSCAMERA_EXTENDEDPROP_DIGITALWINDOW_AUTOFACEFRAMING: AutoFramingCapabilityKind.KSCAMERA_EXTENDEDPROP_DIGITALWINDOW_MANUAL);
                m_AFController.DefaultValue = flags;
                PropertyInquiry.SetExtendedControlFlags(m_mediaCapture.VideoDeviceController, ExtendedControlKind.KSPROPERTY_CAMERACONTROL_EXTENDED_DIGITALWINDOW, (uint)flags);
            }
            catch (Exception ex)
            {
                UITextOutput.Text = $"error: {ex.Message}";
            }
        }

The exception is throwed from red bounding of the below picture.

image

I skip this exception and find that the value is set successfully , because the setting is changed when I reopen the setting page.

Other controllers (blur, eye contact) work well with setting default value , and sync quickly with setting page (no need to reopen) .

Is this a problem ?

Class not registered

I am trying to run the VirtualCameraSample on windows 11 I have the windows SDK 10.0.22000.0 installed but yet am getting Class not registered on virtual camera start call
RETURN_IF_FAILED(spVirtualCamera->Start(nullptr));

any hints?

Unable to install Virtual Camera on Windows 10

Is there a way to run this on Windows 10.....I've tried all possible setup instructions none of them are working even after deploying the app.
I was able to build and run this app on Windows 11 but on Windows 10 I'm unable to wrap existing webcam devices

The error code is -2147024769 : The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)

RPC failed error with the code 0x800706BE when calling IMFVirtualCamera::Start

Hello - I've been banging my head against the wall these past couple of weeks because I have no idea what I'm doing wrong. For some reason I get an RPC failed error with the code 0x800706BE when I try to start my Virtual Camera. My Virtual Camera is exactly the same as the SimpleMediaSource example from this repo, execpt it's in Rust.
There are two strange things to note:
1. It used to work on pre-Windows 11 22H2 and stopped working after the update
2. The c++ example works just fine.

Below are the logs callstack and some execptions that occur (from debugging with Windbg):

Callstack:
00 0000005951afe288 00007ffbc7b61bca RPCRT4!NdrSendReceive+0x5
01 0000005951afe290 00007ffbc7b6104b RPCRT4!NdrpClientCall3+0x6aa
02 0000005951afe5b0 00007ffb5c74a82c RPCRT4!NdrClientCall3+0xeb
03 0000005951afe940 00007ffb5c70365d FrameServerClient!FsClientImpl::AddDeviceToClient+0x5ec
04 0000005951afebb0 00007ffb5c702bc1 FrameServerClient!FsProxy::CreateStreamsForDevice+0x16d
05 0000005951afee70 00007ffb5c703ecc FrameServerClient!FsProxy::CreateStreamsForAllDevices+0x2e1
06 0000005951aff140 00007ffb5c701bd7 FrameServerClient!FsProxy::Initialize+0x6ac
07 0000005951aff210 00007ffb5c7411db FrameServerClient!FsProxy::CreateInstance+0x83
08 0000005951aff250 00007ffb5c7410ce FrameServerClient!FSClientFactory::CreateInstanceByService+0xab
09 0000005951aff2b0 00007ffbbae2f094 FrameServerClient!FSClientFactory::CreateInstance+0x8e
0a 0000005951aff2f0 00007ffb5c7b4ecf MFCORE!MFCreateDeviceSource+0x574
0b 0000005951aff410 00007ffb5c7b88e5 FrameServerMonitorClient!FSMSessionVirtualCamera::InternalEnableCamera+0x71f
0c 0000005951aff590 00007ff6c1f34540 FrameServerMonitorClient!FSMSessionVirtualCamera::Start+0x45
0d 0000005951aff5c0 00007ff6c1f32928 vcam!windows::Windows::Win32::Media::MediaFoundation::IMFVirtualCamera::Start<enum$<core::option::Option<ref$windows::Windows::Win32::Media::MediaFoundation::IMFAsyncCallback >, 1, 18446744073709551615, Some> >+0xb0 [C:\Users\Brian.cargo\registry\src\github.com-1ecc6299db9ec823\windows-0.39.0\src\Windows\Win32\Media\MediaFoundation\mod.rs @ 46663]
0e 0000005951aff680 00007ff6c1f320ab vcam!vcam::main+0x3d8 [C:\Users\Brian\Documents\source\vcam\vcam\src\main.rs @ 45]
0f 0000005951affaa0 00007ff6c1f352bb vcam!core::ops::function::FnOnce::call_once<void ()(),tuple$<> >+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e\library\core\src\ops\function.rs @ 227]
10 0000005951affae0 00007ff6c1f34fd1 vcam!std::sys_common::backtrace::__rust_begin_short_backtrace<void (
)(),tuple$<> >+0x1b [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e\library\std\src\sys_common\backtrace.rs @ 125]
11 0000005951affb20 00007ff6c1f4150e vcam!std::rt::lang_start::closure$0<tuple$<> >+0x11 [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e\library\std\src\rt.rs @ 145]
12 (Inline Function) ---------------- vcam!core::ops::function::impls::impl$2::call_once+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e\library\core\src\ops\function.rs @ 259] 13 (Inline Function) ---------------- vcam!std::panicking::try::do_call+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library\std\src\panicking.rs @ 492]
14 (Inline Function) ---------------- vcam!std::panicking::try+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e\/library\std\src\panicking.rs @ 456] 15 (Inline Function) ---------------- vcam!std::panic::catch_unwind+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library\std\src\panic.rs @ 137]
16 (Inline Function) ---------------- vcam!std::rt::lang_start_internal::closure$2+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e\/library\std\src\rt.rs @ 128] 17 (Inline Function) ---------------- vcam!std::panicking::try::do_call+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library\std\src\panicking.rs @ 492]
18 (Inline Function) ---------------- vcam!std::panicking::try+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e\/library\std\src\panicking.rs @ 456] 19 (Inline Function) ---------------- vcam!std::panic::catch_unwind+0xb [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library\std\src\panic.rs @ 137]
1a 0000005951affb60 00007ff6c1f34f9f vcam!std::rt::lang_start_internal+0x13e [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library\std\src\rt.rs @ 128]
1b 0000005951affc50 00007ff6c1f32bd6 vcam!std::rt::lang_start<tuple$<> >+0x2f [/rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e\library\std\src\rt.rs @ 144]
1c 0000005951affcb0 00007ff6c1f5abbc vcam!main+0x16
1d (Inline Function) ---------------- vcam!invoke_main+0x22 [d:\a01\_work\20\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 78] 1e 0000005951affce0 00007ffbc660244d vcam!__scrt_common_main_seh+0x10c [d:\a01\_work\20\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288] 1f 0000005951affd20 00007ffbc848df78 KERNEL32!BaseThreadInitThunk+0x1d 20 0000005951affd50 00000000`00000000 ntdll!RtlUserThreadStart+0x28

RPC exceptions:
(39ac.2488): Unknown exception - code 000006be (first chance)
(39ac.2488): Unknown exception - code 000006bf (first chance)
(39ac.2488): Unknown exception - code 000006bf (first chance)

Logs:
successfully created camera!
Called: <vcam_media_source::vcam_media_source_activate_factory::VCamMediaSourceActivateFactory as windows::Windows::Win32::System::Com::IClassFactory_Impl>::CreateInstance
Called: vcam_media_source::vcam_media_source_activate::VCamMediaSourceActivate::new
Called: <vcam_media_source::vcam_media_source_activate::VCamMediaSourceActivate as windows::Windows::Win32::Media::MediaFoundation::IMFAttributes_Impl>::GetItemType
Called: <vcam_media_source::vcam_media_source_activate::VCamMediaSourceActivate as windows::Windows::Win32::Media::MediaFoundation::IMFAttributes_Impl>::SetItem
Called: <vcam_media_source::vcam_media_source_activate::VCamMediaSourceActivate as windows::Windows::Win32::Media::MediaFoundation::IMFAttributes_Impl>::GetUINT32
Called: <vcam_media_source::vcam_media_source_activate::VCamMediaSourceActivate as windows::Windows::Win32::Media::MediaFoundation::IMFActivate_Impl>::ActivateObject
Called: vcam_media_source::vcam_media_source::VCamMediaSource::new
Called: vcam_media_source::vcam_media_source::VCamMediaSource::create_attributes
Called: vcam_media_source::vcam_media_stream::VCamMediaStream::new
Called: vcam_media_source::vcam_media_stream::VCamMediaStream::set_stream_attributes
Called: vcam_media_source::vcam_media_stream::VCamMediaStream::set_stream_attributes
Called: vcam_media_source::vcam_media_stream::VCamMediaStream::init_mft
Called: <vcam_media_source::vcam_media_stream::VCamMediaStream as windows::Windows::Win32::Media::MediaFoundation::IMFMediaStream_Impl>::GetStreamDescriptor
Called: vcam_media_source::vcam_media_stream::VCamMediaStream::check_shutdown
Called: <vcam_media_source::vcam_media_source::VCamMediaSource as windows::Windows::Win32::Media::MediaFoundation::IMFMediaSourceEx_Impl>::GetSourceAttributes
Called: vcam_media_source::vcam_media_source::VCamMediaSource::check_shutdown
Called: <vcam_media_source::vcam_media_source::VCamMediaSource as windows::Windows::Win32::Media::MediaFoundation::IMFGetService_Impl>::GetService
Called: vcam_media_source::vcam_media_source::VCamMediaSource::check_shutdown
Called: <vcam_media_source::vcam_media_source::VCamMediaSource as windows::Windows::Win32::Media::MediaFoundation::IMFMediaSource_Impl>::CreatePresentationDescriptor
Called: vcam_media_source::vcam_media_source::VCamMediaSource::check_shutdown
Called: <vcam_media_source::vcam_media_source::VCamMediaSource as windows::Windows::Win32::Media::MediaFoundation::IMFMediaSourceEx_Impl>::GetStreamAttributes
Called: vcam_media_source::vcam_media_source::VCamMediaSource::check_shutdown
Called: vcam_media_source::vcam_media_source::VCamMediaSource::get_media_stream_by_id
Called: vcam_media_source::vcam_media_stream::VCamMediaStream::get_id
Called: vcam_media_source::vcam_media_stream::VCamMediaStream::get_attributes
Called: <vcam_media_source::vcam_media_source::VCamMediaSource as windows::Windows::Win32::Media::MediaFoundation::IMFMediaSourceEx_Impl>::GetSourceAttributes
Called: vcam_media_source::vcam_media_source::VCamMediaSource::check_shutdown
Called: <vcam_media_source::vcam_media_source::VCamMediaSource as windows::Windows::Win32::Media::MediaFoundation::IMFMediaSourceEx_Impl>::GetSourceAttributes
Called: vcam_media_source::vcam_media_source::VCamMediaSource::check_shutdown
Called: <vcam_media_source::vcam_media_source::VCamMediaSource as windows::Windows::Win32::Media::MediaFoundation::IMFMediaSource_Impl>::Shutdown
Called: vcam_media_source::vcam_media_stream::VCamMediaStream::shutdown
thread 'main' panicked at 'failed to start camera: Error { code: 0x800706BE, message: The remote procedure call failed. }', vcam\src\main.rs:45:36

Question about virtual camera image orientation

Hi developers,

I have noticed that the images generated by a virtual camera are opposite to those of a physical camera. I would like to inquire whether there are specific properties that need to be set to ensure that the images generated by the virtual camera match the orientation of a physical camera. Alternatively, is there a particular API that needs to be used to achieve this?

Thank you very much for your time and assistance!

Can the virtual camera be accessed from multiple applications simultaneously?

In readme Getting Started's 5th step says Install VirtualCamera_UWP, this one I am not sure what I should do. I have seen in other issues people were able to install uwp camera manager app, but I am not sure how do I do this. Any comment about this would be appreciated. What I was able to do was the following:

  1. Built all the projects successfully
  2. Installed VirtualCamera_MSI
  3. Ran VirtualCamera_Installer and was able to install VCam-SimpleMediaSource and VCam-HWMediaSource. When choosing VCam-AugmentedMediaSource, the installer crashes.

VCam-SimpleMediaSource and VCam-HWMediaSource I registered were visible in ms teams (for example). However, it was not possible for me to use the same virtual camera from another app (e.g. slack) simultaneously while ms teams was using the virtual cam. Maybe I am missing smth or doing smth wrong. If not, is there a way to modify/extend this project so the virtual camera is consumed from multiple applications simultaneously? Or any way to use MediaSource to build a virtual camera that will be consumed by multiple applications simultaneously.

Virtual Camera Sample Returns E_ACCESSDENIED in IMFVirtualCamera->Start

Hi there,

I am experimenting with the Virtual Camera example in the repository. After building the example and registering the activator object for the media source in the registry, I am getting 0x80070005 (which translates apparently to E_ACCESSDENIED) when starting the virtual camera through the installer executable.

Register virtual camera...
 device string: {7B89B92E-FE71-42D0-8A41-E137D06EA184}
 friendly name: SWVCamMediaSource
 Lifetime: 1
 Access: 0
 Succeeded (000002699010CC70)!
 (null)(0):(null), hr=0x80073D57, msg=
 not running in app package
 Start camera
 C:\Users\Marcus\Git\Windows-Camera\Samples\VirtualCamera\VirtualCameraTest\VCamUtils.cpp(196):VCamUtils::RegisterVirtualCamera, hr=0x80070005, msg=
 C:\Users\Marcus\Git\Windows-Camera\Samples\VirtualCamera\VirtualCameraTest\SimpleMediaSourceUT.cpp(194):VirtualCameraTest::impl::SimpleMediaSourceUT::CreateVirtualCamera, hr=0x80070005, msg=
 C:\Users\Marcus\Git\Windows-Camera\Samples\VirtualCamera\VirtualCamera_Installer\main.cpp(227):SelectRegisterVirtualCamera, hr=0x80070005, msg=
 C:\Users\Marcus\Git\Windows-Camera\Samples\VirtualCamera\VirtualCamera_Installer\main.cpp(286):VCamApp, hr=0x80070005, msg=Register Virtual Camera failed
 C:\Users\Marcus\Git\Windows-Camera\Samples\VirtualCamera\VirtualCamera_Installer\main.cpp(390):wmain, hr=0x80070005, msg=

I have been trying to find the issue by instrumenting the code, but I think that the root cause is somewhere in the frame server client and my knowledge of COM and Windows programming as well as Media Foundation is quite limited.

From the mftrace below and my instrumentation, I can see that the media source gets created and initializes just fine. Then it is apparently queried by the framework for its attributes and some attributes appear to be missing. However, I am unable to find their documentation. I've tried looking at the media foundation doumentation and I have grep-ed through the windows kit headers, but they seem to be internal.

I would greatly appreciate any hint on what I might be doing wrong. After spending several nights on this, I am running out of ideas. Thank you.

Regards,

Marcus

           __M_F_T_R_A_C_E___LOG__

PID, TID    Time (UTC)    TraceMessage
--------- --------------  ------------
35004,6240 17:59:38.79881 TraceOSVersion @ OS version (BuildLabEx): 22621.1.amd64fre.ni_release.220506-1250
35004,6240 17:59:38.79881 TraceMFDetoursVersion @ MFDetours version 1.1.0.1
35004,6240 17:59:38.79883 TraceEnabledKeywords @ Keywords and levels: Default 4, Detours 4, MFDebugHlp 4, Kernel32Export 4, MFExport 4, MFPlatExport 4, MFPlayExport 4, MFReadWriteExport 4, Ole32Export 4, wmvCoreExport 4, MFPublic 4, IMFActivate 4, IMFAsyncCallback 4, IMFAttributes 4, IMFClock 4, IMFClockStateSink 4, IMFMediaEventGenerator 4, IMFMediaSession 4, IMFMediaSink 4, IMFMediaSource 4, IMFMediaStream 4, IMFPMediaPlayer 4, IMFPMediaItem 4
35004,6240 17:59:38.79887 TraceEnabledKeywords @ Keywords and levels: IMFPMediaPlayerCallback 4, IMFPresentationClock 4, IMFQualityAdvise 4, IMFQualityAdvise2 4, IMFQualityManager 4, IMFRateControl 4, IMFSample 4, IMFSinkWriter 4, IMFSourceReader 4, IMFSourceReaderCallback 4, IMFSourceResolver 4, IMFStreamSink 4, IMFTopology 4, IMFTopologyNode 4, IMFTopoLoader 4, IMFTransform 4, IMediaObject 4, IMFSchemeHandler 4, IMFByteStream 4, IMFByteStreamHandler 4
35004,6240 17:59:38.79888 TraceEnabledKeywords @ Keywords and levels: IMFReadWriteClassFactory 4, IFilterGraph 4, IGraphBuilder 4, IMediaControl 4, IMemInputPin 4, IWMReader 4, IWMReaderCallback 4
35004,6240 17:59:38.80017 CMFMediaSessionDetours::Attach @00000269900EEA00 Presentation clock @00000269900F4E90
35004,6240 17:59:38.80019 CMFMediaSessionDetours::Attach @00000269900EEA00 Rate control @00000269900EEA10
35004,6240 17:59:38.80648 CMFPlatExportDetours::MFStartup @ Version=0x00020070, dwFlags=0x00000000
35004,6240 17:59:53.09648 COle32ExportDetours::CoCreateInstance @ Created {3F698CF8-1288-459A-AECE-D32BCE8DBACC} FrameServerMonitorClientFactory (C:\Windows\System32\FrameServerMonitorClient.dll) @00000269901028D0 - traced interfaces: 
35004,6240 17:59:53.11018 COle32ExportDetours::CoCreateInstance @ Created {7B89B92E-FE71-42D0-8A41-E137D06EA184} Virtual Camera Source (C:\Users\Marcus\Git\Windows-Camera\Samples\VirtualCamera\x64\Debug\VirtualCameraMediaSource.dll) @00000269900F9E00 - traced interfaces: 
35004,6240 17:59:53.13117 CMFAttributesDetours::GetItemType @000002699010ACD0 attribute not found guidKey = MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME
35004,6240 17:59:53.13182 CMFAttributesDetours::GetUINT32 @000002699010ACD0 attribute not found guidKey = {C7F7C57B-DF30-41D0-AFFC-15201CDF920D}
35004,6240 17:59:53.13185 CMFAttributesDetours::GetUnknown @000002699010ACD0 attribute not found guidKey = {1BB79E7C-5D83-438C-94D8-E5F0DF6D3279}
35004,6240 17:59:53.13186 CMFAttributesDetours::GetAllocatedString @000002699010ACD0 attribute not found guidKey = {3C31A5F8-2795-4FB9-A0A1-C733A65C0CE8}
35004,6240 17:59:53.13283 CMFAttributesDetours::GetAllocatedString @000002699010AA30 attribute not found guidKey = {658ABE51-8044-462E-97EA-E676FD72055F}
35004,6240 17:59:53.13299 CMFAttributesDetours::GetUINT32 @000002699010A610 attribute not found guidKey = {F402567B-4D91-4179-96D1-74C8480C2034}
35004,6240 17:59:53.13299 CMFAttributesDetours::GetUINT32 @000002699010A610 attribute not found guidKey = {E816FAC2-4AD6-413F-BE84-FB004C504035}
35004,6240 17:59:53.13300 CMFAttributesDetours::GetUINT32 @000002699010A610 attribute not found guidKey = {262F1D2F-EEF4-48C5-B0ED-BB9AE15B063D}
35004,6240 17:59:53.13301 CMFAttributesDetours::GetBlobSize @000002699010A610 attribute not found guidKey = {E7BE497B-C849-469B-B68F-D5C2113144EC}
35004,6240 17:59:53.13303 CMFAttributesDetours::GetUINT32 @000002699010A610 attribute not found guidKey = {F402567B-4D91-4179-96D1-74C8480C2034}
35004,6240 17:59:53.13303 CMFAttributesDetours::GetUINT32 @000002699010A610 attribute not found guidKey = {E816FAC2-4AD6-413F-BE84-FB004C504035}
35004,6240 17:59:53.16054 CMFAttributesDetours::GetGUID @000002699010A550 attribute not found guidKey = {2ACF1917-3743-41DF-A564-E727A80EA33D}
35004,6240 17:59:53.16177 COle32ExportDetours::CoCreateInstance @ Created {366F6FDF-839D-4ED5-BFC6-7301A42A2F20} FSClientFactory (C:\Windows\System32\FrameServerClient.dll) @0000026990102BD0 - traced interfaces: 
35004,6240 17:59:53.16181 CMFPlatExportDetours::MFStartup @ Version=0x00020070, dwFlags=0x00000000
35004,6240 17:59:53.16406 CMFAttributesDetours::GetUnknown @000002699010A550 attribute not found guidKey = {76E25E7B-D595-4283-962C-C594AFD78DDF}
35004,6240 17:59:53.16407 CMFAttributesDetours::GetUnknown @000002699010A550 attribute not found guidKey = {7E3D0B9D-C643-483B-9607-1B5969814C7F}
35004,6240 17:59:53.18491 CMFAttributesDetours::GetUINT32 @000002699010ABB0 attribute not found guidKey = {646B2774-D245-4BDB-90E9-2CED310E37B2}
35004,6240 17:59:53.18524 CMFAttributesDetours::GetUnknown @000002699010A550 attribute not found guidKey = {F938EF75-7234-49FE-838C-D0148FF4C5FE}
35004,6240 17:59:53.18749 CMFPlatExportDetours::MFShutdown @ Shutting down Media Foundation
           __M_F_T_R_A_C_E___LOG__

[ExternalCameraSettingsAppSample][DefaultControlHelper] set DefaultValue error with Access is denied

Hi ,

I try to change default value of brightness , but get a exception:

CameraSettingsExternalSettingsApp\DefaultControlHelper\DefaultControlHelper.cpp(128)\DefaultControlHelper_WinRT.dll!00007FFB0DD10FAC: (caller: 00007FFB0DD19FF4) Exception(1) tid(2f9c) 80070005 Access is denied.
    [winrt::DefaultControlHelper::implementation::DefaultController::DefaultValue(strongManager->Save())]



  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

Before I get the exception , I modified the program flow of "ExternalCameraSettingsAppSample" for standalone launching instead of launching from the settings page.

Does "ExternalCameraSettingsAppSample" lost permissions when it doesn't launch from the setting page ?

Thanks.

Any question about VirtualCameraSimple project

When I use VirtualCameraSimple project, I compile according to README.md, but I am prompted that I can't open the included file:“mfvirtualcamera.h”: No such file or directory. How do I get the mfvirtualcamera. h file?

The link of install visual studio MSI project extension in Windows-Camera-master/Samples/VirtualCamera/README.md document is invalid.

Looking forward to your reply.

AugmentedMediaSource not work

The simpleMediaSource and HWMediaSource work well on my computer. But with AugmentedMediaSource, I have tried many times, like using UWP, using Installer, changing some codes, and virtual camera can be created,but no image shown in preview or CameraApp. When I select the AugmentedMediaSource option, the Installer will crash and UWP reports an unspecified error. the CameraApp also reports an error.

image

image

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.