Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Divinyx · Feb 20, 2018 at 12:05 AM · unityeditorwebcamtexturewebcam

WebCamTexture ERROR - Could not find specified video device

I'm just trying to setup a simple script so that it uses the native webcam installed on my laptop and display it on a RawImage in Unity 2017.3.1f1

 Webcam: USB2.0 HD UVC WebCam



I've been finding a solution for hours but I kept getting unanswered questions or incomplete comments with Vuforia or DirectShow which I do not need.

I pasted code from Unity Docs directly and followed directions of Unity Videos word for word but I always get the same error:

 ERROR - Could not find specified video device
 UnityEngine.WebCamTexture:Play()



The webcam is listed on Unity's detected devices and can Log the device string properly but it always fails on WebCamTexture.Play();

the only thing that comes into mind right now is that the webcam is unsupported and I have to try a different one.


sample code copied and pasted:

         WebCamDevice[] devices = WebCamTexture.devices;
         Debug.Log("Number of web cams connected: " + devices.Length);
         Renderer rend = this.GetComponentInChildren<Renderer>();
 
         WebCamTexture mycam = new WebCamTexture();
         string camName = devices[0].name;
         Debug.Log("The webcam name is " + camName);
         mycam.deviceName = camName;
         rend.material.mainTexture = mycam;
 
         mycam.Play();



Additional Info: If I restart Unity and run it the very first time, the WebCam light turns on for a second, shuts off, then I get the error.


Edit: Testing using my android phone as a webcam works. So I assume it would have something to do with the camera itself (I have no idea how the software handles different cameras) or the native webcam name's special chars '2.0'. I tried changing the name via registry to 'USB2 HD UVC WebCam' but the string Unity outputs still keeps the 2.0, so I'm not sure how to fully change it.

Edit: After restarting the PC the value didn't change so I would assume Unity uses the bus description instead of the actual name. If you guys have any ideas to test this please feel free to shout out.

Edit: So I'm not sure if this is the right cause but perhaps the camera is run through DirectShow(?) which is unsupported by Unity(?) so I might just have to choose webcams that dont use it.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Stevens-R-Miller · Jun 29, 2018 at 09:28 PM

I had this exact problem. You mentioned DirectShow, so I assume you are running Windows. Solution for me was to go into Windows Settings/Privacy/Camera and set "Allow apps to access your camera" to "on." Worked right away after that.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by unity_007maharshigohel · May 10, 2020 at 06:23 AM

It doesn't show option of Unity in settings.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

79 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Could not connect pins - RenderStream() UnityEngine.WebCamTexture:Play() 0 Answers

Show a WebCamTexture with alpha 1 Answer

WebcamTexture not refreshing 0 Answers

Web Cam Texture on UI Panel 0 Answers

how to track object motion with webcam 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges