【问题标题】:Edit video using UIVideoEditorController使用 UIVideoEditorController 编辑视频
【发布时间】:2011-07-11 12:17:01
【问题描述】:

我想修剪视频,所以我正在使用 UIVideoEditorController,但是当我检查可以编辑文件时,它会为所有文件(mp4、mov、m4v)返回 false。所以任何人都会请指导我这是什么问题。

  1. 能否给我任何使用 UIVIdeoEditorcontroller 的教程的链接

【问题讨论】:

    标签: iphone cocoa-touch uivideoeditorcontroller


    【解决方案1】:

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

    【讨论】:

    • 花了整夜才找到这件事。
    【解决方案2】:

    您可以通过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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-16
      • 1970-01-01
      • 2020-06-28
      相关资源
      最近更新 更多