以编程方式修剪iphone相机拍摄的视频?

时间:2012-09-06 07:53:32

标签: iphone user-interface camera avfoundation

我需要使用iphone捕捉视频5分钟,然后修剪捕获的视频并以二进制数据格式保存。如果有任何身体做过,请帮助我这样做。

就像那张图片http://www.askdavetaylor.com/3-blog-pics/apple-iphone-video-editing-4.png

- (BOOL) startCameraControllerFromViewController: (UIViewController*) controller
usingDelegate: (id <UIImagePickerControllerDelegate, UINavigationControllerDelegate>)                     delegate {

    NSLog(@"Camera Working");


    if (([UIImagePickerController isSourceTypeAvailable:

      UIImagePickerControllerSourceTypeCamera] == NO)

    || (delegate == nil)

    || (controller == nil))

    return NO;

    cameraUI            = [[UIImagePickerController alloc] init];
    cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
    cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera;

    // Displays a control that allows the user to choose picture or

    // movie capture, if both are available: video and image capturing

    //cameraUI.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];


    // Hides the controls for moving & scaling pictures, or for

    // trimming movies. To instead show the controls, use YES.
    cameraUI.videoMaximumDuration = 300; // 5x60 sec 
    cameraUI.allowsEditing = YES;
    cameraUI.delegate = delegate;

    [controller presentModalViewController: cameraUI animated: YES];

    return YES;

}

0 个答案:

没有答案