How do I select a webcam to use in Unity3D?

0 votes
asked Jul 10, 2019 by dctoms (120 points)
edited Aug 6, 2019 by dctoms
Is there a way to select an external, USB based, webcam in Unity, rather than use the inbuilt one.

For example, I am using a Mac that has an inbuilt camera, but I want to use a high quality USB webcam in the Unity3D Editor for testing my project.  Is there a way I can switch between these two cameras?  I tried using the 'External' setting for the ARSession's 'FrameSourceType' but that just gave me the error 'only support mobile phone'.

Any help anyone could give me with this would be much appreciated.  I'm currently moving my workflow to use EasyAR :)

1 Answer

0 votes
answered Jul 12, 2019 by zhangpengar (3,060 points)
You can try change ARSession.cs: 97 from

var openResult = easyarCamera.openWithType(CameraDeviceType.Default);

to

var openResult = easyarCamera.openWithIndex(1);
commented Jul 12, 2019 by dctoms (120 points)
Thanks for the help zhangpengar, I'll give that a shot when I get a chance and get back to you on whether it worked or not :)
commented Jul 14, 2019 by wjrivera (800 points)
this did not work for me =(
commented Aug 6, 2019 by dctoms (120 points)
This did not work for me either.  A dropdown somewhere to select what camera you want to use in the Editor would be preferred really.  Any chance of adding one it?  Also, have you got any more ideas?
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...