I have the following problem - I am trying to create an app that records video, then save it to the camera roll and after that I am uploading that video to the web. The problem is that the only supported format is "mp4", but my videos are "mov".
So my question is how to save video from camera in "mp4" format, or save it in "mov" and then convert it to "mp4".
Here's my code:
this is how I open the camera:
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];
this is how I save the video:
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); } } [nextScreenButton setTitle:@"ПРОДЪЛЖИ" forState:UIControlStateNormal]; [self dismissViewControllerAnimated:YES completion:nil];
Thanks in advance!