Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何添加B&;等视觉效果;W、 ios中的复古到普通视频_Ios_Objective C_Xcode5_Mpmediaplayercontroller - Fatal编程技术网

如何添加B&;等视觉效果;W、 ios中的复古到普通视频

如何添加B&;等视觉效果;W、 ios中的复古到普通视频,ios,objective-c,xcode5,mpmediaplayercontroller,Ios,Objective C,Xcode5,Mpmediaplayercontroller,这部电影在MPMoviePlayerController中播放得很好。但当我按下按钮时,视频必须改变黑白或复古效果 - (IBAction)videoCameraRoll:(id)sender { UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImag

这部电影在MPMoviePlayerController中播放得很好。但当我按下按钮时,视频必须改变黑白或复古效果

- (IBAction)videoCameraRoll:(id)sender
{
    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.delegate = self;
    imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie,      nil];
    [self presentViewController:imagePicker animated:YES completion:NULL];

}

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    NSURL *movieURL;
    NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
    if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo)
    {
        movieURL=(NSURL*)[info objectForKey:UIImagePickerControllerMediaURL];
    }
    movieController =  [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
    movieController.view.frame = CGRectMake(0, 56, 320, 200);
    movieController.controlStyle = MPMovieControlStyleEmbedded;
    movieController.shouldAutoplay = YES;
    movieController.scalingMode=MPMovieScalingModeFill;
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(moviePlayBackDidFinish:)
                                                 name:MPMoviePlayerPlaybackDidFinishNotification
                                               object:self.movieController];

    [self.view addSubview:movieController.view];
    [movieController prepareToPlay];
    [movieController setFullscreen:NO animated:NO];


    [picker dismissViewControllerAnimated:YES completion:NULL];
}

- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
    [picker dismissViewControllerAnimated:YES completion:NULL];
}

// Video Play Back Did Finish
- (void)moviePlayBackDidFinish:(NSNotification *)notification {

    [[NSNotificationCenter defaultCenter]removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
    [self.movieController stop];
    [self.movieController.view removeFromSuperview];
    self.movieController = nil;
}

要将视频转换为黑白或复古,您需要使用过滤器,著名的过滤器是GPUImage()@savana-谢谢您的评论。请回答此问题的评论。我必须对这些答案投赞成票。因为它对我很有用。