Search Issue Tracker
Fixed in 2020.1
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.
- [Hub] Project "Remove from list" option is behind notifications when selecting the most bottom project in the list
- [Android][Vulkan] Black Screen renders on devices with Adreno 640 and Mali GPU's
- A Parser Failure error is thrown after importing a specific Animation file to a Unity project
- Editor crashes on GenerateSharedVerticesIndexList when importing .3ds file
- Profiler Calls view's "Call To" and "Call From" tables are cleared when the Play Mode is entered