Tôi muốn hiển thị luồng của mặt trước và mặt sau của máy ảnh iPad2 trong hai UIViews cạnh nhau. Để dòng hình ảnh của một thiết bị tôi sử dụng đoạn mã sauChạy nhiều AVCaptureSessions hoặc thêm nhiều đầu vào
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];
mà hoạt động tốt cho cả hai camera. Để hiển thị luồng song song, tôi đã cố gắng tạo một phiên khác, nhưng ngay khi phiên thứ 2 được thiết lập thì đóng băng đầu tiên.
Sau đó, tôi đã cố gắng thêm hai AVCaptureDeviceInput vào phiên nhưng có vẻ như nhiều nhất một đầu vào được hỗ trợ tại thời điểm này.
Bất kỳ ý tưởng hữu ích nào về cách phát trực tiếp từ cả hai máy ảnh?
bản sao có thể có của [Làm thế nào tôi có thể lấy nét tự động để làm việc trong AVCaptureSession thứ hai mà không cần tạo lại các phiên?] (Http://stackoverflow.com/questions/5427561/how-can-i-get-autofocus-to-work -in-a-giây-avcapturesession-without-tái tạo) –