Artem Svystun
Artem Svystun

Reputation: 179

iPhone Video compression on/off

I have implemented video capturing by:

IImagePickerController *imagePicker = [[UIImagePickerController alloc] init];    
imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;  
NSArray *sourceTypes = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
if ([sourceTypes containsObject:(NSString *)kUTTypeMovie ]){
    imagePicker.mediaTypes =  sourceTypes;
}           
imagePicker.delegate = self;
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];

I can record video and send it to YouTube using YouTube API, but if the video length is more then about 5 minutes, and I click USE - the application is closed. But no problem appear if I select even 10 minutes video from library (i see "Compressing video" progress), video is saved to my view and uploaded to YouTube.

Can anybody tell me what the problem could be?

Upvotes: 0

Views: 2432

Answers (1)

alok chauve
alok chauve

Reputation: 582

You used QualityTypeHigh with high resolution 1280x720. so it take so much memory.

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;

[imagePicker setVideoQuality:UIImagePickerControllerQualityQualityTypeMedium];

imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;

imagePicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];

[imagePicker setVideoMaximumDuration:30];

imagePicker.allowsEditing = YES;

[self presentModalViewController:imagePicker animated:YES];

[imagePicker release];

Upvotes: 1

Related Questions