Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug WebCamTexture not working when using wrong size

Discussion in 'Linux' started by RBFraphael, Nov 12, 2019.

  1. RBFraphael

    RBFraphael

    Joined:
    Apr 21, 2018
    Posts:
    14
    I'm trying to use my device's webcam with WebCamDevice, so I noticed that not works when the specified resolution is not supported by webcam.

    In Windows, any resolution I use, is correctly and automatic adjusted to match webcam's supported resolutions, but on Linux this needs to be exacly defined. Maybe making WebcamDevice.availableResolutions for all devices (not only iOS and Android) can help with this.

    My code that works fine:
    Code (CSharp):
    1. new WebCamTexture(devices[0].name, 640, 480);
    My code that doesn't work when I use webcam's resolution (in this case, as my game resolution):
    Code (CSharp):
    1. new WebCamTexture(devices[0].name, Screen.width, Screen.height);
    Note: I can check all supported resolutions of my webcam with Cheese app (Ubuntu/Linux Mint).
     
    RobbysonSystem and ROBYER1 like this.