How do I access two webcams simultaneously?

I need to access two webcam video feeds at the same time in Unity, preferably via the WebCamTexture interface. WebCamTexture seems to only be able to access one webcam per instance of Unity, although I haven’t found anything that officially confirms or denies this. I can choose between devices, but once one device is active, access to any other device seems to be prevented.

Any ideas?

Add this script to gameobject. Target1 for showing webcam1 feed, target2 for webcam2. You can use (for example) plane or cube as target1 and target2.

javascript codesnippet:

#pragma strict

private var webcamTexture1 : WebCamTexture;
private var webcamTexture2 : WebCamTexture;

var target1 : Transform;
var target2 : Transform;

function Start () {

webcamTexture1 = WebCamTexture();
webcamTexture2 = WebCamTexture();

var devices : WebCamDevice[] = WebCamTexture.devices;
     
    if(devices.length > 1){
        webcamTexture1.deviceName = devices[0].name;
        webcamTexture2.deviceName = devices[1].name;
        
        target1.renderer.material.mainTexture = webcamTexture1;
        target2.renderer.material.mainTexture = webcamTexture2;
        
        webcamTexture1.Play();
        webcamTexture2.Play();
    }
    else
    	print("Make sure you got two cams");
}