Tag: 摄像头

为什么我的audioAVCaptureConnection不能用于最高分辨率格式?

我正在使用AVAssetWriter和AVAssetWriterInput来loggingaudio和video文件的iOS项目。 当video分辨率限制在720×1280时,一切似乎都正常。 我现在正试图利用AVCaptureDeviceFormats获得更高分辨率的iOS设备。 使用设备上可用的任何AVCaptureDeviceFormats,video继续正常工作。 但是,audio不起作用。 我已经跟踪到了我的audioAVCaptureConnection的active属性 ,这是最高分辨率格式的NO ,当我login时看起来像这样: <AVCaptureConnection: 0x16f62130 [type:soun][enabled:1][active:0]> 另外,当audio连接不活动时,我的didOutputSampleBuffer委托callback不会与audio数据一起被调用。 我的问题: 为什么audioAVCaptureConnection对低分辨率格式有效,但对最高分辨率格式不适用? video分辨率设置为最高时是否可以录制audio? 如果是这样,怎么样? 例: iPhone6背面摄像头的最高分辨率AVCaptureFormat: 720×1280,30 FPS(audio连接有效) 720×1280,240 FPS(audio连接有效) 1080×1920,30 FPS(audio连接活动) 1080×1920,60 FPS(audio连接活动) 1936×2592,30 FPS (audio连接无效) 2448×3264,30 FPS (audio连接无效) iPhone6前置摄像头的最高分辨率AVCaptureFormat: 720×1280,60 FPS(audio连接有效) 960×1280,60 FPS (audio连接无效) 以下是我用来设置活动格式的代码: if ([self.camera lockForConfiguration:nil]) { self.camera.activeFormat = format; [self.camera unlockForConfiguration]; }

iOS中的裁剪video在video周围看到奇怪的绿线

嘿,大家,我正在裁剪从iPhone上的相机拍摄的video,然后裁剪它播放像这样。 当我这样做,但我得到一个奇怪的绿色线周围的video的底部和右侧? 不知道为什么会发生这种情况或如何解决这个问题。 这是我如何裁剪。 – (UIImageOrientation)getVideoOrientationFromAsset:(AVAsset *)asset { AVAssetTrack *videoTrack = [[asset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0]; CGSize size = [videoTrack naturalSize]; CGAffineTransform txf = [videoTrack preferredTransform]; if (size.width == txf.tx && size.height == txf.ty) return UIImageOrientationLeft; //return UIInterfaceOrientationLandscapeLeft; else if (txf.tx == 0 && txf.ty == 0) return UIImageOrientationRight; //return UIInterfaceOrientationLandscapeRight; else if (txf.tx == 0 && […]

在iOS 7中,AVCapture捕获帧速率为60fps

我正在开发一个应用程序,需要尽可能多地捕捉framebuffer。 我已经想出了如何强制iPhone以60 fps捕捉,但是 – (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection 方法每秒仅调用15次,这意味着iPhone会将捕捉输出降级到15 fps。 有没有人遇到这样的问题? 有没有可能增加捕捉帧率? 更新我的代码: camera = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; if([camera isTorchModeSupported:AVCaptureTorchModeOn]) { [camera lockForConfiguration:nil]; camera.torchMode=AVCaptureTorchModeOn; [camera unlockForConfiguration]; } [self configureCameraForHighestFrameRate:camera]; // Create a AVCaptureInput with the camera device NSError *error=nil; AVCaptureInput* cameraInput = [[AVCaptureDeviceInput alloc] initWithDevice:camera error:&error]; if (cameraInput == nil) { NSLog(@"Error to create camera […]