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
10
votes
1 answer

Show camera stream while AVCaptureSession's running

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…
Peter
  • 663
  • 1
  • 6
  • 7
10
votes
2 answers

How to specify the exposure, focus and white balance to the video recording?

I have a program to take a video with default parameters, and the Exposure, Focus and White Balance will be adjusted automatically when I move the camera. I want to add 2 buttons in the program: LOCK and PRESET. When the LOCK button is pressed, the…
Yang
  • 151
  • 1
  • 5
9
votes
1 answer

AVCaptureDeviceFormat 1080p 60 fps Autofocus issue

I noticed that AVCaptureDeviceFormat 1080p 60 fps on iPhone 6s does not supports focus pixels, so in low light conditions the camera continues to autofocus when moved. This creates an issue with video recording as focus hunting is an issue. However…
Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131
9
votes
1 answer

iOS Swift - AVCaptureSession - Capture frames respecting frame rate

I'm trying to build an app which will capture frames from the camera and process them with OpenCV before saving those files to the device, but at a specific frame rate. What I'm stuck on at the moment is the fact that…
Richard Poole
  • 591
  • 1
  • 5
  • 21
9
votes
1 answer

How to find the highest resolution AVCaptureDeviceFormat suitable for recording to a file?

I'm using AVFoundation to record from the device's camera to a movie file, using AVCaptureMovieFileOutput. I want to allow the user to switch between high frame rate and high resolution modes before recording begins, but I can't work out how you're…
Robert
  • 5,735
  • 3
  • 40
  • 53
8
votes
1 answer

zoom in and zoom out camera on pinch gesture swift

I am using front camera in my app. I want that while taking photos user can zoom in and out camera I tried this code let device = AVCaptureDevice.default(for: .video) print(sender.scale) let vZoomFactor = sender.scale * prevZoomFactor if…
Naqeeb
  • 1,121
  • 8
  • 25
8
votes
0 answers

AVCaptureVideoPreviewLayer and ARKit: is it possible to use them together?

I've found that using an AVCaptureVideoPreviewLayer camera overlay, the quality of the camera image shown is quite better than when using an ARSKView. I need to use ARKit and display some SKNodes according to the camera ouput, so I guess that using…
AppsDev
  • 12,319
  • 23
  • 93
  • 186
8
votes
1 answer

In Swift 2.1, how do you get the NSError that was thrown?

I'm initializing an AVCaptureDeviceInput. In Swift 2 rather than getting an NSError variable you catch an error with a do-try-catch sandwich. However I don't see how to get the NSError inside the catch part. The recommendation given on Apple's…
CommaToast
  • 11,370
  • 7
  • 54
  • 69
8
votes
4 answers

How to access Mac default camera using swift xcode

Today i am coding for Mac first time. What I am trying to do is access the default camera and show a preview. 2nd step i will record or take a snap if i need. For the 1st step i have written the following code import Cocoa import AVFoundation class…
KD.
  • 2,015
  • 3
  • 28
  • 59
8
votes
1 answer

How to add an audio input to a AVCaptureSession and allow other apps to play music in the background

I'm trying to add an audio input to my AVCaptureSession() and it works great. However I would also like to support users who wish to play music in the background from other apps such as Spotify and maintain this audioInput for my recording. How is…
JZ.
  • 21,147
  • 32
  • 115
  • 192
8
votes
1 answer

AVCaptureDevice adjustingExposure is False but captured image is dark

The Mac OS X app I'm coding is taking a photo capture using the macbook built-in facetime camera. On MacBookAir3,2, MacBookPro8,2 and MacBookPro10,2 it works fine but on new macbooks it takes "dark" photos. I understand it's because of auto exposure…
grzaks
  • 1,404
  • 2
  • 18
  • 31
7
votes
3 answers

Why does AVCaptureVideoOrientation landscape modes result in upside down still images?

I am using AVFoundation classes to implement a custom camera in my app. I am only capturing still images, not video. I have everything working but am stumped by something. I take into account the device orientation when a still image is captured and…
XJones
  • 21,959
  • 10
  • 67
  • 82
7
votes
2 answers

iPhone 4 AVFoundation : Capture from front and rear cameras simultaneously

I was wondering if it was possible to capture from both cameras simultaneously using AVFoundation framework. Specifically, my question is whether both front and rear AVCaptureDevices can be active at the same time or not. Currently I know that an…
Abai
  • 760
  • 1
  • 8
  • 16
7
votes
3 answers

AVCaptureDevice is always null on simulator

I am trying to capture live microphone audio data. I took the following from the apple example for AVCaptureSession. AVCaptureSession *captureSession = [[AVCaptureSession alloc] init]; AVCaptureDevice *audioCaptureDevice = [AVCaptureDevice…
zyeek
  • 1,277
  • 12
  • 27
7
votes
2 answers

AVCaptureSession bug persists between installs

I have a app that opens straight to a camera that is based on this WWDC sample: https://developer.apple.com/library/ios/samplecode/AVCam/Introduction/Intro.html A few users have been experiencing a bug where the camera does not turn on and does not…
Cbas
  • 6,003
  • 11
  • 56
  • 87
1
2
3
23 24