Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

WebCamTexture in UWP results in error

Discussion in 'Windows' started by eemre, May 25, 2018.

  1. eemre

    eemre

    Joined:
    May 8, 2018
    Posts:
    3
    I've a simple scene with a Canvas and a RawImage. Another GameObject with a script, which manages the Webcam:

    Code (CSharp):
    1. public class WebcamManager : MonoBehaviour {
    2.  
    3.     public RawImage webcamImage;
    4.  
    5.     private WebCamTexture webCamTexture;
    6.  
    7.     private IEnumerator Start()
    8.     {
    9.         yield return Application.RequestUserAuthorization(UserAuthorization.WebCam | UserAuthorization.Microphone);
    10.  
    11.         if (Application.HasUserAuthorization(UserAuthorization.WebCam | UserAuthorization.Microphone))
    12.         {
    13.             webCamTexture = new WebCamTexture();
    14.             webcamImage.texture = webCamTexture;
    15.             webcamImage.material.mainTexture = webCamTexture;
    16.            
    17.             webCamTexture.Play();
    18.         }
    19.     }
    20. }
    21.  
    In Player Settings "WebCam" is enabled in Capabilities.

    In the editor the whole scene runs fine and the RawImage displays the Webcam image.
    After compiling it as a UWP program and running it the developlement console shows this error:

    upload_2018-5-25_16-28-32.png

    Translation from German to English:

    Error: Operation has failed with error 0x80028019: Old format or invalid type library.​

    What's up with that? I'v got no idea how to handle this error.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,501
    I pasted this code into an empty project and I don't get errors like you are. Does this only happened on one particular machine? Perhaps it only happens with a specific webcam device? Is there more code than this that you're not showing?
     
  3. eemre

    eemre

    Joined:
    May 8, 2018
    Posts:
    3
    Nope, this is the only code I use. Here's the project on github: https://github.com/eco3/UnityUWP-WebCamTexture/

    I've tried two webcam devices Logitech HD Webcam C270 and Logitech QuickCam Pro 9000. Both with the same result.
     
    Last edited: May 30, 2018
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,501
    Can you report a bug so our QA could try and reproduce this?
     
  5. eemre

    eemre

    Joined:
    May 8, 2018
    Posts:
    3
    Sure. I've wrote a ticket.