Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 Pyroka · Sep 14, 2017 at 10:33 PM · webcamtexturewebcam

Webcam with no name

I'm currently experiencing an issue attempting to support multiple webcams.

When I call WebCamTexture.devices I get a list of 2 devices (one for each webcam I have plugged in) but one of the names is blank (as in, string.Empty).

This causes an issue because when I create a new WebCamTexture with a blank name it doesn't seem to grab the webcam that Unity thinks has no name, and instead fails (it might be attempting to grab the other webcam which is already in use).

This is not a problem if I only have one webcam plugged in (even if it's the one with the blank name) in this case, creating the WebCamTexture with a blank name is successful and starts recording from the camera.

Has anyone else encountered this? I'm not sure why Unity thinks the camera has no name, Windows/Device Manager think it has one!

Comment
Add comment · Show 1
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 jeremynelson · Aug 12, 2021 at 05:43 PM 0
Share

3 years later, I have the same issue. Anyone find a workaround?

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Aeregon · Oct 02, 2017 at 07:26 AM

@Pyroka I have the same problem. I believe this happens when the full name of the device has a special character in it. The device page on windows only shows the short name. Example: devices show Kinect. full name is Kinect Microsoft(r).

the (r) is actually the copyright symbol which is unknown to the compiler and thuss shows an empty string.

The problem is, that you cannot replace the symbols to somethign that is readable, because when you do that you first have to load the name in a string, which will be empty. I've had to problem for a long time and I try to work around it. The best thing is to just use a webcam that has a valid name.

Trust webcams dont have special symbols and are usable by device name. So you might want to avoid every microsoft webcam at all costs.

Please let me know if you found another way around this problem. I will ofcourse also update you when I found a better solution.

Comment
Add comment · Show 1 · 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 Aeregon · Oct 02, 2017 at 07:48 AM 0
Share

@Pyroka I found that if you request the device names, and wait a second they are not empty. IEnumerator Init() { yield return new WaitForSeconds(1f);

         WebCamDevice[] devices = WebCamTexture.devices;
 
         yield return new WaitForSeconds(1f);
 
         if (devices.Length > 0)
         {
             foreach (WebCamDevice wcd in devices)
             {
                 Debug.Log(wcd.name);
              }
         }
     }

I am not sure about the special character though.

avatar image
0

Answer by kartikeya · Mar 24, 2018 at 11:54 AM

I tried that with wait for a Second, but still no luck to get names, Top of that only front cam is accessible (which has name "1"). Rear cam has no name and doesn't even accessible.

Do you have any other solution?

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 SimRuJ · Jul 23, 2018 at 10:11 AM

@Pyroka I'm experiencing the same problem. The webcam is a new Microsoft LifeCam HD-3000 I bought just for Unity (didn't know about this problem :/) and it's the only camera connected to the PC. The "camera" app in Win 10 shows the image just fine but Unity won't get a name.

I can't use the above code (using C# 6), so I just created a button that sets the "devices" array and then check the name in "Update" ("if(devices!=null)") but there's no name, even after a couple of seconds.

Has anyone found a solution for this yet?

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

73 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

Related Questions

WebCameTexture.Play() Could not connect pins - RenderStream() 5 Answers

Take photo from webcam (not grab frame from video stream) 0 Answers

WebCam Texture scaling on iPhoneX 1 Answer

WebCamTexture ERROR - Could not find specified video device 2 Answers

WebCamTexture.device on the Kindle Fire returning a camera 1 Answer


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