avcapturedevice

Turn on torch/flash on iPhone 4

I know that the only way to turn on the flash and keep it on on iPhone 4 is by turning the video camera on. I'm not too sure of the code though. Here is what I am trying: -(IBAction)turnTorchOn { AVCaptureSession *captureSession = [[AVCaptureSession alloc] init]; AVCaptureDevice *videoCaptureDevice = [AVCaptureDevice defaultDeviceWithMe...

Make a button start the app

So I have made a custom UIButton and added it to the code and made the connections in interfacebuiler. I want the button to work as a on and off switch, how do I do this correctly? I'm a beginner at iphone development and this is for a school project for this class I'm taking during the summer to get a head start for next semester. So ...

Show camera stream while AVCaptureSession's running

Hey guys, I was able to capture video frames from the camera using AVCaptureSession according to http://developer.apple.com/iphone/library/qa/qa2010/qa1702.html. However, it seems that AVCaptureScreen captures frames from the camera without showing the camera stream on the screen. I would like to also show camera stream just like in UII...

AVCaptureSession cancels background audio

Hello, Whenever I start an AVCaptureSession running with the microphone as an input it cancels whatever background music is currently running (iPod music for instance). If I comment out the line adding the audio input, the background audio continues. Does anyone know of a way to record video clips with the microphone while continuing ...

How to calculate focusPointOfInterest for AVCaptureDevice?

How do you calculate the focusPointOfInterest (a CGPoint value between 0,0 and 1,1) for an given AVCaptureDevice? I've been following the code samples from the latest WWDC but I really don't understand how to calculation is being made. Also, my application is sitting in landscape vs. portrait (as in the sample) ... so in addition to no...

Why AVCaptureSession output a wrong orientation?

Hey guys, So, I followed Apple's instructions to capture video session using AVCaptureSession: http://developer.apple.com/iphone/library/qa/qa2010/qa1702.html. One problem I'm facing is that even though the orientation of the camera / iphone device is vertical (and the AVCaptureVideoPreviewLayer shows a vertical camera stream), the outp...