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
7
votes
3 answers

AVCaptureSession cancels background audio

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…
Edmond
  • 71
  • 1
  • 3
7
votes
3 answers

Audio Not Recording in AVCaptureSession

I have an app that when a view is loaded up, begins capturing video and audio, and upon completion, records it to both the documents folder of the app, along with the Camera Roll of the iPad that it is running on. I have made sure and added in the…
user717452
  • 33
  • 14
  • 73
  • 149
7
votes
1 answer

How to get 240fps on iPhone 6 with low resolution

I am trying to do real time image processing with an iPhone 6 at 240fps. The problem is when I capture video at that speed, I can't process the image fast enough since I need to sample each pixel to get an average. Reducing the image resolution…
lehn0058
  • 19,977
  • 15
  • 69
  • 109
7
votes
0 answers

Live filter on AVCaptureVideoPreviewLayer

How can i add filters to AVCaptureVideoPreviewLayer? Ive tried making a CIFilter and settings AVCaptureVideoPreviewLayer.filters property to an array with the filter, but it did nothing.
Maximilian Litteral
  • 3,059
  • 2
  • 31
  • 41
7
votes
1 answer

Locking exposureMode with key value observer causes crash

I am doing some motion detection on an area of screen. Before starting the detection I want to set focus and exposure and lock them so they don't trigger a false motion. I am therefore sending a AVCaptureFocusModeAutoFocus and…
Sten
  • 3,624
  • 1
  • 27
  • 26
6
votes
0 answers

Audio Recording Mac app with Visualizations unable to select input device with AudioKit

Hey I wonder if someone can point me in the right direction. I am building a Mac Audio App that I need to perform the following actions Select audio input device Show a live audio graph of device input (think GarageBand/ Logic) capture the audio…
6
votes
2 answers

macOS: Accessing a virtual Cameras (OBS) as AVFoundation CaptureDevice

On macOS, is it possible to see a virtual Camera, such as OBS, as a CaptureDevice? I see that, for example, Google Chrome or Zoom can use this camera, but using AVCaptureDevice.DiscoverySession I am unable to see it. Am I doing wrong? var…
below
  • 929
  • 6
  • 26
6
votes
1 answer

Swift: autoFocus/Expose and continuousAutoFocus/Exposure at the same time?

Right now in my camera app I let the user touch anywhere to set the focus and exposure, but how can I get the best of both worlds just like Apple's Camera app? For instance, the user may want to touch to focus on something that is in the…
Chewie The Chorkie
  • 4,896
  • 9
  • 46
  • 90
6
votes
0 answers

How to manually control exposure duration with AVFoundation in OSX?

I'm using AVFoundation to capture images from a connected camera. I need to be able to control the exposure manually, instead of it being automatic. I've found AVCaptureDevice.exposureMode…
6
votes
2 answers

Haptic feedback not playing nice with AVFoundation? (UIImpactFeedbackGenerator, etc)

I'm trying to have a video/camera view in the background while I also allow for haptic feedback in my app for various actions, but it seems that AVFoundation is not playing nice with any of the calls I am making that involve the haptic calls: if…
JasonAddFour
  • 153
  • 1
  • 1
  • 10
6
votes
3 answers

Why my iOS app does not ask user permission to access camera?

I develop iOS app and it uses camera. AVCaptureDeviceInput is used to interface to camera. I checked Authorisation status as - (void)checkDeviceAuthorizationStatus { NSString *mediaType = AVMediaTypeVideo; [AVCaptureDevice…
batuman
  • 7,066
  • 26
  • 107
  • 229
6
votes
4 answers

Preventing AVCaptureVideoPreviewLayer from rotating, but allow UI layer to rotate with orientation

I have two view controllers. One is the root VC and contains the UI interface such as the record button. On this view controller, I also display the view of another VC at index 0. This view contains a AVCaptureVideoPreviewLayer. I would like my…
yamski
  • 471
  • 4
  • 14
6
votes
3 answers

iOS: captureOutput:didOutputSampleBuffer:fromConnection is NOT called

I want to pull frames from the live-feed of AVCaptureSession and I am using Apple's AVCam as a test case. Here is the link to AVCam: https://developer.apple.com/library/ios/samplecode/AVCam/Introduction/Intro.html I found that that…
Paul A.
  • 577
  • 2
  • 11
  • 24
5
votes
1 answer

iPhone 13 Pro / swift / AVFoundation builtInTripleCamera : how to enable automatic switching between cameras?

I am currently making a custom camera app for iOS with swiftUI AVFoundation. I also just bought iPhone 13 Pro. On the native Camera App, cameras automatically switch depending on FOCUS (ultrawide for macro / wideangle for intermediate distance /…
Mourad
  • 51
  • 3
5
votes
1 answer

Capturing a video with 240 fps in Swift with AVCaptureVideo

I want to see a video preview on my iPhone's display with 240 fps. My Code (simplyfied) is like this (following): A session is made, the camera is activated and the actual video preview is shown on the display. var session: AVCaptureSession? var…
Korne127
  • 168
  • 14
1 2
3
23 24