Questions tagged [avcapturedevice]

AVCaptureDevice represents a physical capture device and the properties associated with that device. You use a capture device to configure the properties of the underlying hardware.

A capture device also provides input data (such as audio or video) to an AVCaptureSession object.

API reference

347 questions
5
votes
1 answer

Fatal Error when trying to capture photo from front-facing camera using AVFoundation

I try to implement code which will allow to capture images from front-facing camera and then share them. However, each time I try to "take a photo", my app crashes with following console warning: Terminating app due to uncaught exception…
phbelov
  • 2,329
  • 3
  • 18
  • 15
5
votes
0 answers

Camera's exposure was auto changed when I set custom mode - ios, objective-c

I'm using AVCaptureDevice to capture video frame to do some image process and would like to control the exposure duration, ISO by using setExposureModeCustomWithDuration:(CMTime)duration ISO:(float)ISO completionHandler:(void (^)(CMTime…
5
votes
1 answer

AVAudioSession setCategory not working

I have a video capturing app and I want to be able to play background music while recording audio+video. I can accomplish this if I set the AVAudioSession category to PlayAndRecord in didFinishLaunchingWithOptions. However, this causes a glitch in…
Cbas
  • 6,003
  • 11
  • 56
  • 87
5
votes
2 answers

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…
wgpubs
  • 8,131
  • 15
  • 62
  • 109
5
votes
3 answers

Unable to get devices using AVCaptureDevice

I've managed to find some code that would give me access to the devices of a phone (such as the camera). The issue is that when I compile the code (and I'm printing the different devices) using Xcode, I get an empty array. Here is what I…
Tricks
  • 51
  • 1
  • 4
5
votes
2 answers

Objective-C AVCaptureDevice Front Camera

I have followed a tutorial that guided through a way to make a custom but simple camera app, almost exactly to the needs of the use I would like it. I actually have two issues that I need changing but I will focus on this first one for now. The…
Noodleme
  • 55
  • 1
  • 3
5
votes
2 answers

Touch ID freezes AVCaptureDevice

I have an AVCaptureDevice to display a live camera preview on screen. When a Touch ID view is overlaid on the camera preview (using CAContext's evaluatePolicy), the camera preview freezes. When the Touch ID view is dismissed, the camera preview…
Randomblue
  • 112,777
  • 145
  • 353
  • 547
5
votes
4 answers

show record timer while making video

I had implemented the concept of AVCaptureSession for recording video. -(void)startRecordingWithOrientation:(AVCaptureVideoOrientation)videoOrientation { AVCaptureConnection *videoConnection = [AVCamUtilities …
Sudha Tiwari
  • 2,499
  • 26
  • 50
5
votes
2 answers

Set a custom AVFrameRateRange for an AVCaptureSession

I'm trying to take 5 pictures every second with AVCaptureSession and I'm not sure I understand what AVFrameRange means. Currently I have some code that sets up the device: AVCaptureDevice *device = [AVCaptureDevice…
steve
  • 3,878
  • 7
  • 34
  • 49
5
votes
1 answer

Setting White balance and Exposure mode for iphone camera + enum default

I am using the back camera of an iphone4 and doing the standard and lengthy process of creating an AVCaptureSession and adding to it an AVCaptureDevice. Before attaching the AvCaptureDeviceInput of that camera to the session, I am testing my…
Khaled Barazi
  • 8,681
  • 6
  • 42
  • 62
4
votes
6 answers

How can I determine whether my iOS device has a torch light?

In my application I have the option for a torch light. Howevver, only iPhone 4 and iPhone 4S have torch lights. Other devices do not have the torch light. How can I find the current device model? Please help me. Thanks in advance.
Yuvaraj.M
  • 9,741
  • 16
  • 71
  • 100
4
votes
2 answers

iOS 5 - AVCaptureDevice setting focus point and focus mode freezes the live camera picture

I'm using the following method to set point of focus since iOS 4: - (void) focusAtPoint:(CGPoint)point { AVCaptureDevice *device = [[self captureInput] device]; NSError *error; if ([device…
user1016934
  • 53
  • 1
  • 1
  • 5
4
votes
1 answer

How to record video to screen on a landscape app?

This is doing my head in. I am working from this sample project: https://github.com/jj0b/AROverlayExample This works perfectly. only problem is it is a portrait app. So when I rotate the device to landscape, the video still displays as wanted,…
P i
  • 29,020
  • 36
  • 159
  • 267
4
votes
1 answer

setExposureModeCustom: Duration/ISO values in EXIF data do not match

I'm working on an app that uses various advanced iOS camera controls, e.g. custom exposure settings (duration and ISO). The exposure is locked at custom values using: device.setExposureModeCustom(duration: duration, iso: iso) { …
robert
  • 3,484
  • 3
  • 29
  • 38
4
votes
0 answers

Swift observe(_:options:changeHandler:) newValue always nil

I have this setup to observe value changes for AVCaptureDevice deviceWhiteBalanceGains: @objc dynamic var videoDevice:AVCaptureDevice? private var deviceWBGainsObservation: NSKeyValueObservation? And then in the code, deviceWBGainsObservation =…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131