Questions tagged [avcapturesession]

iPhone - To perform a real-time or offline capture, you instantiate an AVCaptureSession object and add appropriate inputs (such as AVCaptureDeviceInput), and outputs (such as AVCaptureMovieFileOutput).

You use an AVCaptureSession object to coordinate the flow of data from AV input devices to outputs.

To perform a real-time or offline capture, you instantiate an AVCaptureSession object and add appropriate inputs (such as AVCaptureDeviceInput), and outputs (such as AVCaptureMovieFileOutput).

The AVFoundation Programming Guide explains how to use AVCapureSession.

1246 questions
24
votes
5 answers

Cropping AVCaptureVideoPreviewLayer output to a square

I am having issues with my AVCaptureVideoPreviewLayer method when grabbing a cropped UIImage of the viewable screen. Currently it is working but not outputting the correct crop that I require. I am trying to output a square but it (by the looks of…
memyselfandmyiphone
  • 1,080
  • 4
  • 21
  • 43
24
votes
4 answers

AVCaptureVideoPreviewLayer not filling screen

I read about one million threads about how to make a VideoPreviewLayer filling the complete screen of an iPhone but nothing works ... maybe you can help me because I'm really stuck. This is my Preview layer init: if (UI_USER_INTERFACE_IDIOM() ==…
user2135074
  • 263
  • 1
  • 2
  • 7
23
votes
1 answer

AVCaptureSession with multiple Outputs?

I'm currently developing an iOS app that applies CoreImage to the camera feed in order to take photos and videos, and I've run into a bit of snag. Up till now I've been using AVCaptureVideoDataOutput to obtain the sample buffers and manipulate them…
Grinneh
  • 871
  • 1
  • 8
  • 14
23
votes
3 answers

AVCaptureSession Record Video With Audio

I have my app set up to record video from the camera using an AVCaptureSession, however, there is no audio with it. What do I need to do to record audio and then add it to the videoOutput for the file? Here is my code for recording the…
21
votes
5 answers

Method to find device's camera resolution iOS

Whats the best method to find the image resolution going to be captured using setting AVCaptureSessionPresetPhoto. I am trying to find the resolution before capturing the image.
thar_bun
  • 820
  • 1
  • 5
  • 20
20
votes
8 answers

iOS tap to focus

I used this code to achieve Tap-to-Focus in iOS custom camera App, but it isn't working. Here's the code override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { let touchPer = touches.anyObject() as UITouch let screenSize =…
Krishna
  • 673
  • 3
  • 6
  • 21
20
votes
3 answers

AVCapture capturing and getting framebuffer at 60 fps in iOS 7

I'm developping an app which requires capturing framebuffer at as much fps as possible. I've already figured out how to force iphone to capture at 60 fps but - (void)captureOutput:(AVCaptureOutput *)captureOutput…
20
votes
9 answers

AVCaptureDevice Camera Zoom

I have a simple AVCaptureSession running to get a camera feed in my app and take photos. How can I implement the 'pinch to zoom' functionality using a UIGestureRecognizer for the camera?
The Kraken
  • 3,158
  • 5
  • 30
  • 67
19
votes
5 answers

How to set camera view to fill it's parent view

I don't know if this problem is something about auto layout or I am doing something wrong. I have a UIViewController and one UIView inside of it. And I am using AVCaptureSession to put camera view inside of it. Problem is that when I camera view…
1110
  • 7,829
  • 55
  • 176
  • 334
18
votes
6 answers

AVCaptureVideoPreviewLayer (camera preview) freezes/stuck after moving to background and back

Cant figure this one out. Everything works fine when the app is active, and than sometimes when i move the app to the background(pressing the home button) and than going back, the previewlayer freezes/stuck. Im using viewWillAppear and…
Roi Mulia
  • 5,626
  • 11
  • 54
  • 105
18
votes
4 answers

AVCaptureMovieFileOutput - no active/enabled connections

I am trying to record video in my iPhone app using AVFoundation. But whenever I click the Record button app crashes with this message -[AVCaptureMovieFileOutput startRecordingToOutputFileURL:recordingDelegate:] - no active/enabled connections. I…
user1842872
18
votes
7 answers

AVcapture session slow launch after session restart

I have a main view controller and that segues to a second view controller that has an avcapturesession. The first time I segue from the main view controller to the capture session controller, it takes about 50ms (checked using 'instruments'). Then…
cph2117
  • 2,651
  • 1
  • 28
  • 41
18
votes
4 answers

iOS AVCaptureSession - How to get/set the number of frames per second recorded?

I'm new to AVCaptureSession and wish to better understand how to work with it. So I managed capturing the video stream as separated CIImages and convert them to UIImages. Now I wish to be able to get the number of Frames Per Second captured and…
Ohad Regev
  • 5,641
  • 12
  • 60
  • 84
18
votes
1 answer

Run multiple AVCaptureSessions or add multiple inputs

I want to display the stream of the front and the back facing camera of an iPad2 in two UIViews next to each other. To stream the image of one device I use the following code AVCaptureDeviceInput *captureInputFront = [AVCaptureDeviceInput…
18
votes
3 answers

AVCaptureSession is not giving a good photo quality and good resolution

I'm working with AVCaptureSession for capturing the image. Its working fine but not giving a good resolution. I compared it with the image captured by iPhone Camera and I found that the iPhone Camera Image is much better than AVCaptureSession…
TheTiger
  • 13,264
  • 3
  • 57
  • 82
1
2
3
83 84