당신은 할 수 없습니다,하지만 당신이 할 수있는 당신의 해상도에 가까운 일을 찾는 모든 AVCaptureDeviceFormat
의 반복이다. 사용 가능한 모든 형식의 전체 목록을 보려면 -formats
속성을 사용하여 캡처 장치에 쿼리하십시오. 내가 아는 한 사용자 지정 해상도로 캡처 할 수있는 방법이 없습니다
- (void)configureCameraForHighestFrameRate:(AVCaptureDevice *)device
{
AVCaptureDeviceFormat *bestFormat = nil;
AVFrameRateRange *bestFrameRateRange = nil;
for (AVCaptureDeviceFormat *format in [device formats]) {
for (AVFrameRateRange *range in format.videoSupportedFrameRateRanges) {
if (range.maxFrameRate > bestFrameRateRange.maxFrameRate) {
bestFormat = format;
bestFrameRateRange = range;
}
}
}
if (bestFormat) {
if ([device lockForConfiguration:NULL] == YES) {
device.activeFormat = bestFormat;
device.activeVideoMinFrameDuration = bestFrameRateRange.minFrameDuration;
device.activeVideoMaxFrameDuration = bestFrameRateRange.minFrameDuration;
[device unlockForConfiguration];
}
}
}
:
애플이 예는 최적의 프레임 속도를 선택하는 방법을 보여줍니다. 직접 크기를 조정 한 다음 대상 형식으로 인코딩해야합니다. –