참조 링크 :ios에서 currentPlaybackRate를 사용하여 비디오를 저장하는 방법은 무엇입니까?
http://www.raywenderlich.com/13418/how-to-play-record-edit-videos-in-ios
내가 비디오 프레임을 선택하고 아래의 대리자를 사용하여 비디오를 저장하고있어 (didFinishPickingMediaWithInfo) 방법,
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
// 1 - Get media type
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
// 2 - Dismiss image picker
[self dismissModalViewControllerAnimated:NO];
// Handle a movie capture
if (CFStringCompare ((__bridge_retained CFStringRef)mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) {
// 3 - Play the video
MPMoviePlayerViewController *theMovie = [[MPMoviePlayerViewController alloc]
initWithContentURL:[info objectForKey:UIImagePickerControllerMediaURL]];
[self presentMoviePlayerViewControllerAnimated:theMovie];
// 4 - Register for the playback finished notification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:)
name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) {
UISaveVideoAtPathToSavedPhotosAlbum (moviePath,self, @selector(video:didFinishSavingWithError:contextInfo:), nil);
}
}
}
나는 비디오 트리밍하는 방법을 알고 싶어요 아래의 경로에서 파일이 저장됩니다. 나는 NSDictionary 미디어 URL에서 그 값들을 얻고있다.
Path ::: {
UIImagePickerControllerMediaType = "public.movie";
UIImagePickerControllerMediaURL = "file://localhost/private/var/mobile/Applications/3175A4BD-F24F-4745-B7AE-FBA4B9EBE90D/tmp//trim.zuyfI0.MOV";
UIImagePickerControllerReferenceURL = "assets-library://asset/asset.MOV?id=740204CB-EE25-4A83-992A-F46115FC5B9F&ext=MOV";
}
비디오를 저장하기 전에 currentPlaybackRate를 변경 하시겠습니까? 아무도 구현할 아이디어를 제공 할 수 있습니까?
당신이 말했듯이, MPMoviePlayerViewController * theMovie = [[MPMoviePlayerViewController alloc] initWithContentURL : [info objectForKey : UIImagePickerControllerMediaURL]]; theMovie.moviePlayer.currentPlaybackRate = 4.0; 하지만 작동하지 않습니다. AVFoundation에서 동일한 구현을위한 참조 링크를 제안 할 수 있습니까? –
AVFoundation을 사용하여 다른 시간 척도로 비디오를 저장하는 방법에 대한 정보를 더 제공 할 수 있습니까? 그것은 나를 위해 정말로 도움이 될 것입니다. . –
동영상을 더 빠르게 재생 하시겠습니까, 아니면 빠르게 동영상을 저장 하시겠습니까? – fumoboy007