Search Issue Tracker
Fixed in 2020.1.X
OnVideoCaptureResourceCreatedCallback does not get called when passing it as a VideoCapture.CreateAsync() parameter
How to reproduce:
1. Connect the webcam to a computer
2. Open the "SampleScene" in the attached "case_1192027_repro" project
3. Enter Play mode
Expected results: A callback is called; "Created VideoCapture Instance!" message is printed to the console
Actual results: A callback is not called and no message from the callback body is printed
Reproducible with: 2019.2.0a7, 2019.2.12f1, 2019.3.0b10, 2020.1.0a12
A project on Unity version 2019.2.0a7 and earlier could not be tested due to missing Windows.WebCam class
The code used in a script is copied from Unity docs about VideoCapture: https://docs.unity3d.com/2019.2/Documentation/ScriptReference/Windows.WebCam.VideoCapture.html
UPDATE: This is "By Design" as the VideoCapture APIs were added specifically for HoloLens support and can only be used in UWP (WSA) apps. See "HoloLens Video Capture" example in the 2017.4 Documentation: https://docs.unity3d.com/2017.4/Documentation/Manual/windowsholographic-videocapture.html. In addition to this being an XR specific scenario, the VideoCapture is implemented (on Windows) using the WinRT IMediaCapture API in addition to several MixedReality interfaces, which are not available on Windows 7.
Before, these APIs were contained in the "UnityEngine.XR.WSA.WebCam" namespace making it clear they were UWP only. However, last year the APIs were refactored into "UnityEngine.Windows.WebCam" namespace, making this distinction unclear as the Docs haven't been updated. So, this is largely a Documentation Bug.
However, after reviewing the implementation I don't see any reason why the basic VideoCapture scenario cannot work on WindowsStandalone (hologram recording is another matter). The main work involves re-implementing IMediaCapture APIs from C++/CX to COM/WRL.
NOTE: Even if this API is implemented for WindowsStandalone it *will not" work on Windows 7 as the IMediaCapture interface is only available on Windows 8 and later.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Mouse inputs cannot be inputted when searching the Shortcuts Menu by type "Shortcut"
- "Debug Assertion Failed!" error when launching Windows Dedicated Server Player with Script Debugging enabled
- [Cinematic Studio][3D HDRP] Shader warnings thrown in the Console window when creating a new project with Cinematic Studio template
- Autoplay is triggered on Audio Assets when changing Asset Bundle tags
- Inspector Asset Bundle section has no indication for Variants, AssetBundle is written without a space, and Variant dropdown menu is available without setting the Asset Bundle first