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.
- All models become suddenly stuck in weird poses and Animations are messed up when previewing any character animation in the Editor and looking around in the Scene View
- Files are not included in the “Assembly-CSharp.csproj” file when they are in the Editor folder
- [URP] Specular Color behavior does not match Legacy or HDRP
- [Linux] Array Element doesn't duplicate/delete when clicking "Duplicate/Delete Array Element" on an Array Element in a Prefab GameObject
- [ShaderGraph] Skewed guidelines are drawn from the top left corner of the Node when it is moved