使用UIVideoEditorController编辑视频

时间:2011-07-11 12:17:02

标签: iphone cocoa-touch uivideoeditorcontroller

我想修剪视频,所以我使用的是UIVideoEditorController,但是当我检查可以编辑文件时,它会返回所有文件的假,mp4,mov,m4v。所以任何人都会指导我问题是什么。

  1. 请您给我任何使用UIVIdeoEditorcontroller教程的链接

2 个答案:

答案 0 :(得分:3)

UIVideoEditorController在模拟器上不起作用,所以它总是返回false,它可以在设备上正常工作。

答案 1 :(得分:1)

您可以通过UIVideoEditorController路径找到视频编辑。

UIVideoEditorController* videoEditor = [[UIVideoEditorController alloc] init];
videoEditor.delegate=self;

NSString* videoPath = [[NSBundle mainBundle] pathForResource:@"video" ofType:@"MOV"];
if ( [UIVideoEditorController canEditVideoAtPath:videoPath] )
{
    videoEditor.videoPath = videoPath;
    videoEditor.videoMaximumDuration = 10.0;

    //[self.customAvPlayerView addSubview:videoEditor.view];

    [self presentViewController:videoEditor animated:YES completion:nil];
} 
else
{
    NSLog( @"can't edit video at %@", videoPath );
}

http://www.raywenderlich.com/forums/viewtopic.php?t=11571&p=60182

相关问题