Search Issue Tracker
Fixed in 2020.1.X
Votes
9
Found in
2019.2
2019.2.10f1
2019.3
2020.1
Issue ID
1195027
Regression
No
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
Additional note:
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.
Comments (2)
-
fasteddoict
Sep 30, 2020 18:43
Can also confirm that this is *not* working as of 2020.1.6f1.
Not working in Windows 10 1909. Editor and Standalone 64bit.
-
normus28
Aug 03, 2020 08:04
Still not working on Windows Editor in 2020.1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Draw Additional Lights Shadowmap" calls increase when custom MaterialBlockProperty is used
- Crash on _platform_memmove when importing the "Dragon Crashers - URP 2D Sample Project" to a new 2D project
- "Shader is not supported on this GPU" warnings and and shaders are not loading when building the project for non-Chromium browsers
- [iOS][URP] The screen flickers and the "Execution of the command buffer was aborted due to an error during execution" error is thrown continuously
- Shortcut Manager shows empty conflict filter when resolving runtime conflicts involving different contexts
Resolution Note (fix version 2020.1):
The VideoCapture API implementation was extended to support Windows Editor and Windows Standalone Player in addition to UWP. Documentation has also been updated.
Since this new implementation is actually feature work (not a bug) there's no plan to backport the changes.
IMPORTANT: This API will NOT work on Windows 7.