Avoid Video compression while picking video using uiimagepickercontroller - iphone

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.

Related

How do I pause video at the exact moment I capture a photo?

I am using AVFoundation to display a Video in my UIView via an AVCaptureVideoPreviewOverlay.
I then use AVStillImageOutput's -captureStillImageAsynchronouslyFromConnection: to capture a still Image from the Video with the AVCaptureSessionPresetPhoto preset.
I am freezing the video using AVCaptureSession's -stopRunning in the -captureStillImageAsynchronouslyFromConnection completion block mentioned earlier. However, it's too late and the video has continued running while the still image is taken, so the freeze is a second or two later. When I display the image there is a jump.
How can I freeze the video at the exact moment the photo is taken?
Almost a year later...Your approach is all wrong. Instead of trying to pause the video at the precise moment that the image is captured why don't you pause the video and then capture that paused image. To a user it makes no difference, to a developer you don't have to worry about exact precision.
To reiterate my idea, if you pause a video and flash white visual and play a click the user will think you have just captured that frame regardless if you are or not. Actually, you could consider pausing video the same as capturing an image without saving it.

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!

Is MPMoviePlayerController capable of playing a small movie really without any kind of overlay?

I need to play a movie without any overlay from the player. No play/stop buttons, no time line, no start/end time, no progress bar, nothing. Just the plain naked movie in a subview. The movie may then be covered by my own graphics. The documentation does say it's possible to disable controls. However, something like "remaining time" or a progress bar is not neccessarily a "control". Who knows?
Set the controlStyle property of the MPMoviePlayerController to MPMovieControlStyleNone and nothing will be displayed except the video.

Enable UIImagePickerController video compression

Is there a way to enable video compression on video files recorded with UIImagePickerController?
When videos are selected from cameraroll with UIImagePickerController they are automatically compressed.
Are there any other way of compress a video? I've got access to the file with a NSURL.
I'm not aware of a way to change the compression as it's being recorded.
You can set the videoQuality property of the UIImagePickerController to get a copy at a different bitrate.
For example "High" is: UIImagePickerControllerQualityTypeHigh = 0
http://developer.apple.com/iphone/library/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/doc/c_ref/UIImagePickerControllerQualityType

Snapshot from a MPMoviePlayerController video

Is there a way I can take a snapshot of a movie or clip being played in iPhone's MPMoviePlayerController programmatically?
You are probably looking for this, available on iOS 4.x+
To facilitate the creation of video
bookmarks or chapter links for a long
movie, the MPMoviePlayerController
class defines methods for generating
thumbnail images at specific times
within a movie. You can request a
single thumbnail image using the
thumbnailImageAtTime:timeOption:
method or request multiple thumbnail
images using the
requestThumbnailImagesAtTimes:timeOption:
method.
More at: http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.htmlmethod.