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 Jeric-Miana · Oct 15, 2015 at 09:12 AM · camerawebcamusb

USB Camera to Android

Hi there! I got a problem connecting my USB Camera to my tablet(ASUS K10A) The device reads only the front and back camera I'm searching for answers but still no luck, I need help. Thanks in advance!

I put this line in my AndroidManifest to use an external camera device if one is connected.

   <uses-permission android:name="android.permission.CAMERA" />
   <uses-feature android:name="android.hardware.camera.external" android:required="true"/>

My working code:

   #pragma strict
     private var devices : WebCamDevice[];
     public var deviceName : String;
     private var wct : WebCamTexture;
     private var resultString : String;
      
      
     function Start() {
         yield Application.RequestUserAuthorization (UserAuthorization.WebCam);
      
         if (Application.HasUserAuthorization(UserAuthorization.WebCam)) {
            devices = WebCamTexture.devices;
            deviceName = devices[0].name;
            wct = new WebCamTexture(deviceName, 640, 480, 30);
            renderer.material.mainTexture = wct;
            wct.Play();
            resultString = "no problems";
         } else {
            resultString = "no permission!";
         }
     }
      
     function OnGUI() {
         for (var i = 0; i < devices.length; i++) {
            GUI.Box(Rect(100, 100+(i*25), 300, 25),devices[i].name);
         }
         GUI.Box(Rect(100, 100+(i*25), 400, 25),resultString);
     }
 
 
Comment
Add comment · Show 4
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 jackson31 · Dec 16, 2015 at 05:48 AM 0
Share

I am also looking for a way to get external USB cameras into the webcamtexture on android, have you found a solution yet?

avatar image Jeric-Miana jackson31 · Dec 28, 2015 at 07:30 AM 0
Share

Try this one bro -> https://droidperception.wordpress.com/simplewebcam-app/

avatar image l7oc jackson31 · Apr 20, 2016 at 11:50 AM 0
Share

Did you ever get this working?

Thanks!

avatar image l7oc · Feb 12, 2016 at 10:47 AM 0
Share

@jericmiana Were you able to figure this out?

Not sure how you were able to integrate the SImpleWebCam into Unity. I'd love to be able to get some help with this.

Thanks!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by philc · Sep 21, 2016 at 02:17 PM

It seems that from Camera module 2.4 androids support external camera. See https://source.android.com/devices/camera/versioning.html#module_version

External camera (e.g. USB hot-plug camera) support. The API updates specify the camera static info is available only when camera is connected and ready to use for external hot-plug cameras. Calls to get static info will be invalid calls when camera status is not CAMERA_DEVICE_STATUS_PRESENT. The framework counts solely on device status change callbacks to manage the available external camera list.

I just have no idea what devices comes with such a camera module version...

Philippe ,Seems that Android introduced with Camera module version 2.4 support for external camera. See https://source.android.com/devices/camera/versioning.html#module_version that writes:

External camera (e.g. USB hot-plug camera) support. The API updates specify the camera static info is available only when camera is connected and ready to use for external hot-plug cameras. Calls to get static info will be invalid calls when camera status is not CAMERA_DEVICE_STATUS_PRESENT. The framework counts solely on device status change callbacks to manage the available external camera list.

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

36 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

Related Questions

Activating multiple external programs via Unity 1 Answer

WebCamTexture.devices.Length returning 0 in Unity 2020.3.8f1 0 Answers

Accessing camera torch/flash issues - Torch works but can't access while streaming webcamtexture 0 Answers

WebCamTexture and VSync (iPhone 4) 3 Answers

Switching to two different cameras with Vuforia ARCamera 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