I am newbie and trying to create an app that records video or select video from library, than I am uploading that video to the web. But this files are not playing in some android device. So i want to convert it to mp4 format.
Hence i want to ask that how to convert saved mov
to mp4
in objective-C
?
FYI i have researched alot but not found any helpful information.
Here's my code:
- (void)openCamera {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.delegate = self;
picker.showsCameraControls = YES;
picker.allowsEditing = YES;
picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
[self presentViewController:picker animated:YES completion:nil];
}
- (void) imagePickerController: (UIImagePickerController *) picker didFinishPickingMediaWithInfo: (NSDictionary *) info {
NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
if (CFStringCompare ((__bridge_retained CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo)
{
NSString *moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
videoURL = info[UIImagePickerControllerMediaURL];
if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(moviePath))
{
UISaveVideoAtPathToSavedPhotosAlbum(moviePath, self, nil, nil);
}
}
[self dismissViewControllerAnimated:YES completion:nil];
}