views:

7

answers:

0

Hey guys,

I'm trying to allow users to record or choose a video in my iPhone app, limited to 30 seconds. The videos are uploaded to my web-server, then played back in the app using UIWebView.

The app happily plays back recorded videos, but on older iPhones (3G for example) it won't play videos that were chosen from the camera roll. The main difference I can see between them is that videos chosen form the camera roll have a resolution of 1280x720 whereas those recorded are only 480x360.

I hoped that getting the chosen videos down to 640x480 might be low enough, so I used the setVideoQuality method with UIImagePickerControllerQualityType640x480 but this is completely ignored ... the videos still come out at 1280x720, yet if I chosen other video qualities ... low, medium, high etc, they all have an effect on quality (they just don't affect the resolution, even low!).

Can anyone tell me why the code below does not transcode the chosen video to 640x480?

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
[imagePicker setVideoQuality:UIImagePickerControllerQualityType640x480];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
[imagePicker setVideoMaximumDuration:30];
imagePicker.allowsEditing = YES;
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];

I'm using an iPod touch 4 with iOS 4.1

Thanks!

Steven