UIImagePickerController
sourceType を に設定してビデオを録画するために使用していUIImagePickerControllerSourceTypeCamera
ます。
私はallowsEditing
trueに設定しました。
ビデオをキャプチャした後、トリミング インターフェイスを使用してビデオを編集し、[使用] を押します。トリミングされたバージョンではなく、元の録画のみが返されます。私は何を間違っていますか?
iOS5を使用しています。
-(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];
}
そのトリミングされたビデオを、アプリケーションに応じてさらに処理するために使用したいと考えています。
どこが間違っているのですか?
このタスクを達成する他の方法はありますか?