简体   繁体   English

从视频中删除音频

[英]Remove audio from video

I pick a movie with the image picker . 我用图像选择器选择电影。 The problem is that i don't know how to remove the audio from the asset . 问题是我不知道如何从资产中删除音频。 Any idea? 任何想法? This is the code that i am using to retrieve the movie : 这是我用来检索电影的代码:

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    NSURL *url =  [info objectForKey:UIImagePickerControllerMediaURL];
    if ([[NSFileManager defaultManager]fileExistsAtPath:movie.id]) {
        [[NSFileManager defaultManager]removeItemAtPath:movie.id error:nil];
        [[NSFileManager defaultManager]removeItemAtPath:movie.convertedID error:nil];
    }
    movie.convertedID=nil;

    [self dismissModalViewControllerAnimated:YES];
    dispatch_async(dispatch_get_main_queue(), ^{
        [self saveNewMovieAt:url];
    });

}

better way to Mute MPMoviePlayerController while playing instaed of trying to remove the audio from the asset :) 在播放试图从资产中删除音频的方法时,使MPMoviePlayerController静音的更好方法:)

As per my knowledge, there is no other way to do it.. 据我所知,没有其他方法可以做到。

[[MPMusicPlayerController applicationMusicPlayer] setVolume:0];

                          or

        [myMPMoviePlayerController setVolume:0];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM