从iPhone相机只获得一帧

时间:2013-02-13 12:41:16

标签: iphone ios objective-c

我想从iPhone相机获取连续帧并将其放到UIImage上。我已经按照this link的代码

我的启动相机代码是

- (IBAction)luanchCamera:(id)sender
{

    UIImagePickerController *controller=[[UIImagePickerController alloc]init];
    controller.sourceType = UIImagePickerControllerSourceTypeCamera;
    controller.mediaTypes =[NSArray arrayWithObject:(NSString *)kUTTypeMovie];
    controller.showsCameraControls = YES;
    imageFrameView=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0,1024,718)];
    [controller.view addSubview:imageFrameView];
    controller.view.backgroundColor=[UIColor clearColor];
    controller.wantsFullScreenLayout=NO;
    controller.cameraViewTransform = CGAffineTransformScale(controller.cameraViewTransform,0.25, 0.25);
    [self setupCaptureSession];
    [self presentViewController:controller animated:YES completion:nil];

}

但我只从视频中获得一帧我也删除了

// Assign session to an ivar.

    [self setSession:session];

来自我的代码。是否有必要启动我用launchCamera方法编写的相机。如何从视频中获取连续帧?

0 个答案:

没有答案