iPad 内に小さなプレビュー エリアを持つカスタム カメラを作成していますが、そのプレビューのストリームは時計回りに回転します。
Apple の AVCam デモと SquareCam デモの両方を見ましたが、どちらにも解決策がありません。StackOverflow のすべての AVFoundation オリエンテーション スレッドは、特に入力方向ではなく、出力方向について話しています。
私が使用しているセッションコードは次のとおりです。
AVCaptureDevice *frontalCamera = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
_session = [[AVCaptureSession alloc] init];
[_session beginConfiguration];
NSError *error;
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:frontalCamera error:&error];
[_session addInput:input];
_output = [[AVCaptureStillImageOutput alloc] init];
[_output setOutputSettings:[[NSDictionary alloc] initWithObjectsAndKeys:AVVideoCodecJPEG,AVVideoCodecKey,nil]];
[_session addOutput:_output];
AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:_session];
previewLayer.frame = self.imageViewCamera.bounds;
previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
[self.imageViewCamera.layer addSublayer:previewLayer];
_session.sessionPreset = AVCaptureSessionPreset640x480;
[_session commitConfiguration];
[_session startRunning];
どんな助けでも大歓迎です!