iOS UIImagePickerController & Camera Stabilization - ios

I'm trying to ascertain whether camera stabilization will be used in a UIImagePickerController video record session. I've seen code for this in AVCaptureSession, but nothing shows up in the same way for UIImagePickerController.
If my device has camera stabilization capability (iPad Air 2, for example), will it be applied by default if I use the UIImagePickerController to record video? And if not, is there a way I can specify that it does? I don't want to have to switch to AVCaptureSession and lose the image picker, just to enable the stabilization.
Thanks

Related

CMSampleBufferRef have always same video resolution?

I' trying to capture video by AVAssetWriter and AVCaptureOutput
You can find sample project here.
The video should be in portrait mode with any resolution. The main problem that it should be in portrait mode.
I'm trying to set different setting, but in the end, video is rotated and scaled to size (1920x1080) on iPhone SE.
Is it possible to control this resolution? Or at least orientation?
Video resolution is determined by the AVCaptureSession sessionPreset. You're setting that to medium, so you're getting the resolution that comes with that. If you want a different resolution, pass a different session preset, or use AVCaptureDevice to set a specific capture format. (For a good overview of capture session presets vs device formats, go back to this WWDC13 video.)
Per this Apple Developer Q&A, you need to set an orientation on the capture connection after you start the capture session in order to get "physically" rotated frame buffers (at a capture performance cost), or set the transform property on your asset writer (so that buffers are recorded in the sensor's native orientation, but clients display it in your intended orientation).

What is the default video pixel resolution for the IPhone 5?

I am using UIImagePickerController to load the video camera but I would like the resolution to match the default camera app resolution on the IPhone.
I know the default for the 4S is
UIImagePickerControllerQualityTypeIFrame1280x720
Does anyone have the info for the other models?
Thanks

Retrieve iOS videocamera resolution

I need to retrieve the resolution in pixels of a movie captured by iOS camera of the iPhone...
Is there a library like UIDevice that check which type of device I'm using, also for the camera information?
Everything depends in which mode you'll start capturing video.
According to this link: https://developer.apple.com/library/mac/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW30
You can try to capture video with AVCaptureSessionPresetHigh preset, and than check what's the size of captured image.
This should give you highest video resolution in recording mode.

iOS thumbnail issue with saved video to camera roll

We have an issue where video generated by our application and saved to camera roll (from user action) will show as black thumbnail on the iOS Photo Gallery instead of a thumbnail of a frame. Once you select the video it will play without any issues on the iOS device or any other device (export to your mac or pc...).
The issue does not occur on the iPhone simulator, only on iOS devices..
We generate the video using AVFoundation (very similiar to this How do I export UIImage array as a movie?)
We then combine the video with an mp3 file using AVMutableVideoComposition. If I extract all frame of video, first frame is not black.
The thumbnail in the Photo Gallery will show as a black square, no time span (on iOS4) shown on the thumbnail. We save the video to camera roll using UISaveVideoAtPathToSavedPhotosAlbum ...
We have changed the video compression type and settings multiple times with no luck. The output is a H264 QuickTimeMovie.
Any ideas ?
Thank you.

iOS AVFoundation Video Capture Orientation Options

I have an app that I would like to have video capture for the front-facing camera only. That's no problem. But I would like the video capture to always be in landscape, even when the phone is being held in portrait.
I have a working implementation based on the AVCamDemo code that Apple published. And borrowing from the information in this tech note, I am able to specify the orientation. There's just one trick: while the video frame is oriented correctly, the contents still appear as though shot in portrait:
I'm wondering if I'm just getting boned by the physical constraints of the hardware: is the image sensor just oriented this way? The referenced tech note above makes this note:
Important: Setting the orientation on a still image output and movie
file output doesn't physically rotate the buffers. For the movie file
output, it applies a track transform (matrix) to the video track so
that the movie is rotated on playback, and for the still image output
it inserts exif metadata that image viewers use to rotate the image
properly when viewing later.
But my playback of that video suggests otherwise. Any insight or suggestions would be appreciated!
Thanks,
Aaron.
To answer your question, yes, the image sensor is just oriented that way. The video camera is an approx 1-megapixel "1080p" camera that has a fixed orientation. The 5MP (or 8MP for 4S, etc) still camera also has a fixed orientation. The lenses themselves don't rotate nor do any of the other camera bits, and hence the feed itself has a fixed orientation.
"But wait!", you say, "pictures I take with the camera app (or API) get rotated correctly. Why is that?" That's cuz iOS takes a look at the orientation of the phone when a picture is taken and stores that information with the picture (as an Exif attachment). Yet video isn't so flagged -- and each frame would have to be individually flagged, and then there's issues about what to do when the user rotates the phone during video....
So, no, you can't ask a video stream or a still image what orientation the phone was in when the video was captured. You can, however, directly ask the phone what orientation it is in now:
UIDeviceOrientation currentOrientation = [UIDevice currentDevice].orientation;
If you do that at the start of video capture (or when you grab a still image from a video feed) you can then use that information to do your own rotation of playback.

Resources