Determining if front or rear camera was used to capture video - ios

Is there a way to determine whether the front or rear camera was used to record a video that is selected from the camera roll?

I'm not aware of any meta-data or property associated with video's that Apple requires to be present for video's in your camera roll that could tell you this. And since you can't control where the clips on the camera roll came from, you have to rely on the absolute minimum amount of meta-data required for that file format.
Case in point, there is no guarantee whatsoever that a clip was even taken from a camera at all. If someone texted you a video file that they created from software, and you saved it to your camera roll, the concept of "Front or rear" camera would make no sense at all.
You could certainly keep track of clips that your app takes by storing them in a folder within your app and associating a camera position with each unique clip name, ([[NSProcessInfo processInfo] globallyUniqueString] is great for this)

Related

How to capture a photo automatically in iPhone and iPad

How to capture photo automatically in android phone? is about how to take a picture automatically without people's interaction. This feature is needed in many applications. For example, when you are going to take a picture of a document, you expect that the camera can take it automatically when the full document is insider the picture (or four corners of the document). So my question is how about doing it in iPhone or iPad?
Recently, I am working on Cordova, and does someone know that there are some plugins that have already existed for this kind of camera operations? Thanks
EDIT:
This operation will be done in an APP that will be given the full access of the camera, and the task is how to develop such an APP.
Instead of capturing photo, you should capture video frames. When the captured frame satisfies your requirements, stop capturing the video and proceed.

Prevent recording vertical videos in app

I am creating an iOS app that allows users to take photos and record videos. I would like to block recording "vertical" videos - video recording in portrait orientations. I couldn't find any software libraries that implement this functionality so I guess I will have to implement it myself.
I am using UIImagePickerController and I tried to achieve that using cameraOverlayView, but I don't believe it can be done that way.
So is there any way to solve this?
Thanks
Actually the videos are always recorded in landscape-right regardless of the device orientation b/c that's how the sensor is oriented in the hardware (although you can request rotated buffers in AVFoundation). However there's a flag stored as video metadata that describes the device's orientation during recording and this is used during playback to rotate the content. See AVAssetTrack preferredTransform.
If you don't want your video to be rotated, just discard this information during playback.

Olympus Camera Kit: Need to acquire captured image in the original size after shooting

I am trying to make capture program with Olympus Camera Kit (ver. 1.1.0) for iOS. I'd like to get captured image as soon as possible in the original size after shooting.
I know the original image can be transferred in playback mode, but it may take time to change the run mode from recording mode to playback mode. How can I get the image in original size while the camera runs in recording mode?
There are two possible means to acquire captured image in the original size, but none of these work in recording mode. Only for playback mode. Only if the camera property RECVIEW is ON, XGA-size image is transferred in recording mode.
Change destination to store captured image
You can directly transfer captured image to your mobile device when the camera property DESTINATION_FILE is set to DESTINATION_FILE_WIFI.
Note that the captured image is NOT SAVED to the microSD card in the camera.
onReceiveCapturedImage method is called back the camera finishes shooting.
Continuous shooting is invalid and movie is stored in microSD card.
Check update of file list
Check the update of file list before and after shooting with downloadContentList, then detect the difference.
The original image can be downloaded with downloadImage(IMAGE_RESIZE_NONE) method.
You can check if the camera is in memory access with isMediaBusy property.
Stop live view transfer calling stopLiveView to efficiently download the image. Call startLiveView to resume live view transfer.

how to capture a video in specific part rather than full screen in iOS

I am capturing a video in my IOS app using AVFoundation. i am able to record the video and able to playback also.
But my problem is that i am showing the capturing video in a view which is around 200 points height.so i expected the video would be recorded in the same dimensions.but when i playback the video its showing that the whole screen has been recorded.
so i want to know is there any way to record the camera preview which was visible to user only.And any help should be appreciated.
the screenshots:
()
()
You cannot think of video resolution in terms of UIView dimensions (or even screen size, for that matter). The camera is going to record at a certain resolution depending on how you set up the AVCaptureSession. For instance, you can change the video quality by setting the session preset via:
[self.captureSession setSessionPreset:AVCaptureSessionPreset640x480]
(It is already set by default to the highest setting.)
Now, when you play the video back, you do have a bit of control over how it is presented. For instance, if you want to play it in a smaller view (who's layer is of type AVPlayerLayer), you can set the video gravity via:
AVCaptureVideoPreviewLayer *previewLayer = (AVCaptureVideoPreviewLayer*)self.previewView.layer;
[previewLayer setVideoGravity:AVLayerVideoGravityResizeAspect];
And depending on what you pass for the gravity parameter, you will get different results.
Hopefully this helps. Your question is a little unclear as it seems like you want the camera to only record a certain amount of it's input, but you'd have to put your hand over part of the lens to accomplish that ;)

Change iPhone Camera Shutter Sound in App

How can I change the sound that plays when an image is captured with an iPhone? I am using AVCapture and I want to capture still images (rather than grabbing frames from video) for image quality sake.
Thanks in advance!
After researching it appears that the standard camera shutter sound is next to impossible to change via SDK.
This answer supports that. You can replace your own sound, but not in an app.
As for AVCapture, it also appears that you can't change the shutter sound as capturing images covertly is against the App Store policy. See this answer.
The only way to take a silent picture is to use a video screen grab, which you said you don't want to do for image quality reasons.
So AFAIK, there is no way to change the shutter sound not using video screen grabs.

Resources