After testing my app on an iPhone 6S+, I noticed the videos it produced were only 1080p, despite the fact that it should be capable of recording in 4K. My UIImagePickerController is set up like so:
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.delegate = self;
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePickerController.mediaTypes = #[(NSString *)kUTTypeMovie];
imagePickerController.videoMaximumDuration = 3600.f;
imagePickerController.videoQuality = UIImagePickerControllerQualityTypeHigh;
[self presentViewController:imagePickerController animated:YES completion:nil];
I thought that perhaps there would be a new UIImagePickerControllerQualityType key for selecting 'very high' quality, but 'high' still seems to be the best quality available. Is there a way to enable 4K recording using UIImagePickerController, or do I have to roll my own solution using AVFoundation?
In some iOS version this was solved and now, doing
picker.videoQuality = .typeHigh
my iPhone is taking 4k videos.
Related
I've been unable to get the trim controls to appear when capturing an iOS movie.
Here's my code:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = #[(__bridge NSString *)kUTTypeMovie, (__bridge NSString *)kUTTypeImage];
imagePicker.allowsEditing = YES;
imagePicker.delegate = self;
[self presentViewController:imagePicker animated:YES completion:nil];
Additionally, I'm capturing the reply with imagePickerController:didFinishPickingMediaWithInfo:.
From searching StackOverflow I'm aware that I need to actually trim the video myself. That doesn't seem too difficult, but while I get the image picker and can capture a video I can't get the trim controls to appear! What am I missing?
My mistake was just in using video samples that were too short. They need to be over a certain length before the trimming tools will appear.
I want to upload multiple video to server using ASIHttDataFormRequest.For selecting video ,I am using ImagePickerViewController But it doesn't give the option to select multiple video.
Bellow is the code, which is used to open imagePicker and but unable to select multiple video.
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentViewController:imagePicker animated:YES completion:nil];
Please help me by giving some clue or code. Thanks in Advance
Use this sample
https://github.com/B-Sides/ELCImagePickerController
For video multiple selection refer
Use ELCImagePickerController to pick video
Hope it helps you..
Here is the library to take a photo or select from library: https://github.com/fulldecent/FDTake
This works great so far for photos. Video is in progress.
I tried this twice with two different apps and I get the same thing. I have a set up a UIImagePIckerController instance as follows:
- (IBAction)addImage:(UIBarButtonItem *)sender {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
NSArray *mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera];
if ([mediaTypes containsObject:(NSString *)kUTTypeImage]) {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeImage];
picker.allowsEditing = NO;
picker.showsCameraControls = NO;
[self presentViewController: picker animated:YES completion:NULL];
}
[..]
}
This was the second. In the first I set up a custom overlay to run the shutter and other functions. Everything runs fine but I keep getting an error on the console:
<Error>: CGAffineTransformInvert: singular matrix.
When I run the app, every time I rotate (or move about which signals a rotate) the device while the camera is up {something happens here}. I tried it on both my iPhone 4 and iPad Mini with the same results. After a lot of digging I found this only happen in the case where
picker.showsCameraControls = NO;
If I put
picker.showsCameraControls = YES;
Then I get no message (though my custom overlay is hidden too). Making sure it wasn't the custom overlay itself I tried leaving that out, and it still gives the error message.
Anybody got any ideas of what I should do about this?
I believe it to be largely benign as Apple's own PhotoPicker sample code generates this warning. Rotation has to do with matrices and while I'm not sure which matrix in particular is getting rotated, it is considered a mathematical violation to perform operations on matrices with a determinant of zero (similar to dividing by zero). Such a matrix is not invertible or 'singular':
http://en.wikipedia.org/wiki/Rotation_matrix
http://en.wikipedia.org/wiki/Determinant
http://en.wikipedia.org/wiki/Singular_matrix#singular
I know that this question been asked before, but I'm getting an error while I'm running this code for picking video.
-(void)video
{
UIImagePickerController *imagePicker =
[[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType =
UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie,nil];
[self presentModalViewController:imagePicker animated:YES];
}
This code taking me to a window where video should appear. But the window is blank. The message showing is "No Videos you can sync photos and videos onto your iPod.............albums and videos" . I know that this message shows when there is no videos in video library. But I import lot of videos and still showing this error.
You should take a look at this "HowTo" : http://www.raywenderlich.com/13418/how-to-play-record-edit-videos-in-ios. It helped me a lot.
You will only need the first part.
I would like to load a video from the Videos app. However, videos are stored in a different location than photos, correct? Is it possible to retrieve videos? If so, how?
It isn't possible through the MPMedia* classes, which I wasn't aware of. Here is how to select videos from the camera roll:
IImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
imagePicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
imagePicker.allowsEditing = NO;
Unfortunately that only works for videos that have been recorded by you. It seems that anything else is unsupported.