UIImagePickerController
を使用して、sourceTypeをUIImagePickerControllerSourceTypeCamera
に設定してビデオを録画しています。UIImagePickerController with camera source with editはい:ビデオトリミングが機能しません
allowsEditing
をtrueに設定しました。
ビデオをキャプチャした後、トリミングインターフェイスを使用してビデオを編集し、「使用」を押すと、トリミングされたバージョンではなく元のレコーディングに戻ります。私は間違って何をしていますか?私は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];
}
を使用しています
は、私は自分のアプリケーションに応じて更なる処理のためにビデオをトリミング使用したいです。
どこが間違っていますか?
このタスクを達成する他の方法はありますか?