私はこの問題がフレームレートに関連しているとは思わない。だから私は、あなたのアプリのパフォーマンスを向上させるためのヒントを提案します:
1)AVCaptureVideoPreviewLayerそれはカメラの出力を表示するCALayerのサブクラスなので、そのフレームレートを制限することはできません。
2)適切な場所にアニメーションを配置しているかどうか、CALayerの場合はアニメーションレイヤーがメインキャンバスビューレイヤーのサブレイヤーである必要があります(AVCaptureVideoPreviewLayerではなく、 )、それがUIViewの場合は、メインキャンバスビューのサブビューでなければなりません。
3)あなたは、セッションのプリセットを設定することで、あなたのアプリケーションのパフォーマンスを向上させることができます
[captureSession setSessionPreset:AVCaptureSessionPresetLow];
デフォルトでは、それがハイに設定されている、あなたが必要なものは何でも、それを設定することができ、それだけでビデオの品質とあればあります高性能では理想的ではありませんでした。
4)私は自分のテストアプリを作った。ランダムアニメーションはビデオプレビューレイヤーにオーバーレイされているが(私のメインビューのサブビュー!!!)、古いiPodでもすべてがスムーズになった。キャプチャセッションの初期化のために:
// Create a capture session
self.captureSession = [AVCaptureSession new];
if([captureSession canSetSessionPreset:AVCaptureSessionPresetHigh]){
[captureSession setSessionPreset:AVCaptureSessionPresetHigh];
}
else{
// HANDLE ERROR
}
// Find a suitable capture device
AVCaptureDevice *cameraDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
// Create and add a device input
NSError *error = nil;
AVCaptureDeviceInput *videoInput = [AVCaptureDeviceInput deviceInputWithDevice:cameraDevice error:&error];
if([captureSession canAddInput:videoInput]){
[captureSession addInput:videoInput];
}
else{
// HANDLE ERROR
}
// Create and add a device still image output
AVCaptureStillImageOutput *stillImageOutput = [AVCaptureStillImageOutput new];
[stillImageOutput addObserver:self forKeyPath:@"capturingStillImage" options:NSKeyValueObservingOptionNew context:AVCaptureStillImageIsCapturingStillImageContext];
if([captureSession canAddOutput:stillImageOutput]){
[captureSession addOutput:stillImageOutput];
}
else{
// HANDLE ERROR
}
// Setting up the preview layer for the camera
AVCaptureVideoPreviewLayer *previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:captureSession];
previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
previewLayer.frame = self.view.bounds;
// ADDING FINAL VIEW layer TO THE CAMERA CANVAS VIEW sublayer
[self.view.layer addSublayer:previewLayer];
// start the session
[captureSession startRunning];
5)そして最後に、iOS5をして、あなたが最小と最大のビデオフレームレートを設定することができ、また、どのようにアプリのパフォーマンスを向上させることができ、私はそれはあなたが尋ねたものですね。
http://developer.apple.com/library/mac/#releasenotes/AudioVideo/RN-AVFoundation/_index.html
希望私の答えは明確だったこと:(最小と最大のビデオフレームレートを設定する)、このリンクをチェックしてください。
幸運を祈り、
アルテム
あなたの答えのための多くのおかげで、これは古い質問ですが、iOSの5への追加のニュースは非常に有用です。 – joerick