Can we open rear and front camera together. I checked App in iTunes it is taking pic front camera and rear camera together. I have r&D but I have no proper solutions regarding this features. It is possible we can take pic from front and rear camera together.
No you can't open both cameras at a time. The only option you have it to toggle between the front and back cam.
Even if you do this by using NSTimer and toggle at the rate of 0.1 seconds to create an impression that you running both cams at a time, it will effect the camera performance, you will not get clear camera view.
You need to rely on AVFoundation to perform this operation if you want to have more control on the camera/video session.
Unfortunately AVCaptureSession startRunning method runs on serial queue, which doesnt allow parallel camera sessions to run.
Related
I want to detect the main direction of the sound recorded from iPhone. For example, I want to detect if the sound comes from "front" or "rear" camera.
https://developer.apple.com/documentation/avfoundation/avaudiosessiondatasourcedescription
This link describes how to set, but not how to detect in real time.
UPDATE:
Example use:
I start recording with front and back camera at the same time. I want to detect if audio comes from front o rear to change camera automaticatlly.
Is there any way?
Thanks!
You can iterate over AVAudioSession.inputDataSources, to check out available sources and obtain the one you want, and then set it to AVAudioSession.setPreferredInput(). If You don't need to set the input but just check it, use AVAudioSession.currentRoute.inputs
I need to take one picture from rear camera and another from back camera. I read that it wouldn´t possible at same time, but, you know if it is possible to switch between cameras in thi minimum time and try to take one fron and one back picture?
EDIT:
As I said before, I want to capture from both cameras at the same time. I know that it is not possible on Iphone devices but i tried to switch cameras very quickly. Iphone waste a lot of time switching between cameras. The ideal is to show in preview back camera and record frames from it, and record frames in front camera at the same time without previewing it and do not lose the front preview.
Thanks in advance.
I found some answers regarding both front and back camera usage at the same time regarding AUDIO/VIDEO recording, which is impossible.
In detail here:
Can the iPhone4 record from both front and rear-facing camera at the same time?
However, is it possible to use both cameras at the same time to take pictures for iOS?
No this is definitely not possible I'm afraid.
Only one camera session can be used at a time when using AVCaptureSession (the lower level API for camera interaction on iOS).
If you try to invoke multiple sessions (from each camera) as soon as one session begins, the other will stop.
You could quickly alternate between sessions, but the images will not be taken in synchronicity.
I have to have a video play-back in a loop, until I detect some motion (activity) with the front camera of iPad.
The video does not need to be recorder or played later, and I do not have to show the current video on the iPad.
Currently they have to tap the screen to stop the video but the customer wants a 'cool' video detection. I am not interested in face detection, just motion.
There are some examples about it ?
thanks,
EDIT
Well, currently the only workaround that I've found is detecting luminance... Just make an image of every frame (or n frame) and check the luminosity of the image, check another image from another frame and check again, if the variance is enough, something has changed :-)
Just find a good threshold variance and ready to go ...
Of course I would prefere a more robust workaround...
I want to make something like they have at US dmv's where you sit down and it takes your picture, maybe like photobooth.
I want to connect a high end camera via usb, fire the camera and get the picture.
There's the Picture Transfer Protocol http://en.wikipedia.org/wiki/Picture_Transfer_Protocol a nastly little thing. All the cameras I held in my hands so far, claiming they had proper PTP support failed it somewhere. But in theory one can use PTP to remote control a camera, i.e. trigger the shutter, retrieve the picture and so on.
Rater than reimplementing the whole thing I recommend you get some readily usable PTP library. There are some open source ones listed on http://ptp.sourceforge.net
The easiest method is probably to use OpenCV: http://opencv.willowgarage.com/wiki/
If you need a high end camera - most digital SLRs have a tethered mode where you can control the camera, fire the shutter and retrieve the image data. Each camera maker has a proprietary (but normally free) sdk.
For a webcam type camera - these normally run in video mode, you simply grab an image out f the video stream - as PaulR says - use openCV