iPad2の前面と背面のカメラのストリームを2つのUIViewに並べて表示します。私はどちらかのカメラのために正常に動作し、次のコード複数のAVCaptureSessionsを実行するか複数の入力を追加する
AVCaptureDeviceInput *captureInputFront = [AVCaptureDeviceInput deviceInputWithDevice:[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] error:nil];
AVCaptureSession *session = [[AVCaptureSession alloc] init];
session addInput:captureInputFront];
session setSessionPreset:AVCaptureSessionPresetMedium];
session startRunning];
AVCaptureVideoPreviewLayer *prevLayer = [AVCaptureVideoPreviewLayer layerWithSession:session];
prevLayer.frame = self.view.frame;
[self.view.layer addSublayer:prevLayer];
を使用する一つのデバイスの画像をストリームに 。 ストリームを並行して表示するには別のセッションを作成しようとしましたが、2番目のセッションが確立されるとすぐに最初のセッションがフリーズします。
次に、2つのAVCaptureDeviceInputをセッションに追加しようとしましたが、現時点で最大1つの入力がサポートされているようです。
両方のカメラからストリーミングする方法を教えてください。
[セッションを再作成せずに2番目のAVCaptureSessionでオートフォーカスを動作させるにはどうすればよいですか?](http://stackoverflow.com/questions/5427561/how-can-i-get-autofocus-to-work -in-a-second-avcapturesession-without-recreating) –