UIImagePicker控制器与相机源允许编辑是:视频修剪不起作用



我正在使用UIImagePickerController录制源类型设置为UIImagePickerControllerSourceTypeCamera的视频。

我已将allowsEditing设置为真。

捕获视频后,我使用修剪

界面编辑视频并按"使用",我只取回原始录音而不是修剪后的版本。我做错了什么?

我正在使用 iOS 5。

-(void)shootvideo {
    imagePicker = [[UIImagePickerController alloc] init];
    [imagePicker.view addSubview:test];
    [imagePicker.view addSubview:test2];
    imagePicker.delegate = self;
    imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;
    imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];
    imagePicker.showsCameraControls = YES;
    imagePicker.navigationBarHidden = NO;
    imagePicker.toolbarHidden = NO;
    imagePicker.wantsFullScreenLayout = YES;
    imagePicker.allowsEditing=YES;
    [self presentModalViewController:imagePicker animated:YES];
}

-(void) imagePickerController: (UIImagePickerController *) picker
didFinishPickingMediaWithInfo: (NSDictionary *) info 
{
    NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];

    if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeMovie, 0)
        == kCFCompareEqualTo) 
    {
        NSString *moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
        //NSLog(@"%@",moviePath);
        if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) {
            UISaveVideoAtPathToSavedPhotosAlbum (moviePath, nil, nil, nil);
        }
    }
    [self dismissModalViewControllerAnimated:YES];  
}

我想根据我的应用程序使用该修剪后的视频进行进一步处理。

我哪里出错了?

还有其他方法可以完成这项任务吗?

allowsEditing :一个布尔值,指示是否允许用户编辑选定的静止图像或动画。

@property(非原子(布尔值允许编辑

讨论如果您允许用户编辑静止图像或动画,则代理可能会收到一个字典,其中包含有关所做编辑的信息。委托的协议在 UIImagePickerControllerDelegate Protocol Reference 中描述。

我认为这会有所帮助。

你需要从

- (void(imagePickerController:(UIImagePickerController *(picker didFinishPickingMediaWithInfo:(NSDictionary *(info

我相信。

最新更新