Edit video using UIVideoEditorController

4.9k Views Asked by At

I want to trim video so i am using UIVideoEditorController but when i check can edit file then it return false for all the files, mp4,mov,m4v. So any one will please guide me what is the problem.

  1. Will you please give me the link of any tutorial of using UIVIdeoEditorcontroller
2

There are 2 best solutions below

1
SreeHarsha On

UIVideoEditorController does not work on simulator so it always returns false, it will work fine on device.

0
Sivasagar Palakurthy On

You can find editing of video by path through 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