iPhone UIImagePickerController video mode - iphone

When using the UIImagePickerController, is there a way to specify the resolution of the captured video, or to restrict the length of the video (based on size). I would love to be able to have the video capture at a standard lower res mode rather than 720P.

For iOS 3.1 or later, you can use the videoQuality property of UIImagePickerController. The values are an in the enumeration
UIImagePickerControllerQualityType which defines UIImagePickerControllerQualityType{Low|Medium|High}. The default is UIImagePickerControllerQualityTypeMedium. 4.0 and later have additional resolution options.
As for duration, the property videoMaximumDuration allows you to specify the maximum time in seconds.

Related

How change the resolution without reload the whole Video?

When using Vimeo's unity sdk there is a parameter that defines the resolution of the video currently playing.
To change that, I need to set the desired resolution and call the method LoadVideo() on Vimeo sdk to take effect.
But, when I call load video just for the sake of changing the Resolution,the video starts playing from the beginning and not from the current time.

Avoid Video compression while picking video using uiimagepickercontroller

I'm using UIImagePickerController to allow my user to select a video .
When the user selects the "Choose" button on the second screen, the view displays a progress bar and a "Compressing Video..." message.
Is there some way I can avoid this compression operation?
Try to set the videoQuality property of UIImagePickerController
The video quality setting specified by this property is used during video recording. It is also used whenever picking a recorded movie. Specifically, if the video quality setting is lower than the video quality of an existing movie, displaying that movie in the picker results in transcoding the movie to the lower quality. UIImagePickerController Reference
Available quality values are:
UIImagePickerControllerQualityTypeHigh
UIImagePickerControllerQualityTypeMedium
UIImagePickerControllerQualityTypeLow
UIImagePickerControllerQualityType640x480
UIImagePickerControllerQualityTypeIFrame1280x720
UIImagePickerControllerQualityTypeIFrame960x540
Please see UIImagePickerController Reference for detail.

AVCaptureVideoOutput and compression

As of iOS 4.x, is AVCaptureVideoDataOutput configurable to return you compressed frames?
The documentation for AVCaptureVideoDataOutput says:
AVCaptureVideoDataOutput is a concrete
sub-class of AVCaptureOutput you use,
via its delegate, to process
uncompressed frames from the video
being captured, or to access
compressed frames.
One of the properties is 'videoSettings' which according to the SDK, is the compression settings for the output and it says the compression setting keys can be found in AVVideoSettings.h. But it also says that only CVPixelBufferPixelFormatTypeKey is supported.
Based on this, can I assume that all of the frames returned by AVCaptureVideoDataOutput to the sampleBufferDelegate method is uncompressed? Is there a way to get to the compressed frames?
The current version of the SDK only returns uncompressed frames from the camera. Maybe it'll change in the future, but it's like this right now. Therefore, the only way to get compressed images is to do it yourself. How to do it depends on your needs.
If you need to write them on disk, it will be long and ineffective (a movie would be better). If you need to send compressed images OTA, it's doable with a jpeg or png library for example.

Camera differences between UIImagePickerController and AVCaptureSession on iPhone

I'm trying to build a replacement for UIImagePickerController, using AVCaptureSession with AVCaptureDeviceInput and AVCaptureStillImageOutput, as input/output respectively.
To preview the camera stream I'm using AVCaptureVideoPreviewLayer.
It's now working correctly for capturing and storing photos just like the default camera.
However, I found 3 problems I was unable to solve:
photos captured don't get the same quality the default camera provides
the viewing/capture angle is shortened, just like using the video capture on the default camera
no way to control camera specific options like flash
Is there any way to get to the level of UIImagePickerController using a more customizable approach (i.e. AVFoundation or any other)?
Check out "Session 409 - Using the Camera with AV Foundation" in the WWDC 2010 videos. Based on the video, it looks like you can resolve all three of your issues with AVFoundation.
Hope this helps!

How to set iPhone video output image size

I'm trying to do some image processing on iPhone.
I'm using http://developer.apple.com/library/ios/#qa/qa2010/qa1702.html to capture the camera frames.
I saw that I can set AVCaptureVideoDataOutput image format using setVideoSettings, but is it possible to get the images in lower resolution?
If not, is the an efficient way to downscale the resulted image?
Thanks,
Asaf.
This is how we can get a lower resolution output so we get a higher FPS when manipulating the image:
// sessionPreset governs the quality of the capture. we don't need high-resolution images,
// so we'll set the session preset to low quality.
self.captureSession.sessionPreset = AVCaptureSessionPresetLow;
Asaf Pinhassi.