简体   繁体   中英

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 :)

As per my knowledge, there is no other way to do it..

[[MPMusicPlayerController applicationMusicPlayer] setVolume:0];

                          or

        [myMPMoviePlayerController setVolume:0];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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