0

参考链接:

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 媒体网址中获取这些值。

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 吗?任何人都可以提供一些想法来实施吗?

4

1 回答 1

1

theMovie.currentPlaybackRate = /* your value */;如果您只想在播放期间更改时间刻度,您可以这样做。如果您想实际保存具有不同时间尺度的视频,那么您必须深入了解AV Foundation

于 2013-07-03T04:42:08.287 回答