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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
6 views

With iPadOS 17, can you lock the focus on an external USB camera?

As of iPadOS 17, Apple's platform now allows us to make use of external USB video inputs by supporting the USB Video Device Class (UVC). This is great, but... Does anyone know how to specify "...
VTPete's user avatar
  • 361
0 votes
0 answers
27 views

Strange phenomenon when recording video with AVCaptureVideoDataOutput during the first video recording

I use AVCaptureVideoDataOutput to capture video with setSampleBufferDelegate function: isRecoding = true videoOutput.setSampleBufferDelegate(videoCaptureAssign, queue: videoQueue) audioOutput....
Tú Trần's user avatar
0 votes
0 answers
17 views

AVCaptureDevice exception in setting WhiteBalance

I have the following code adapted from AVCamManual sample code to set white balance. I still see crash reports in analytics where exception is raised in setting WB. It is not clear how things are ...
Deepak Sharma's user avatar
0 votes
0 answers
42 views

How to prevent camera from adjusting brightness in manual mode?

In case when I have locked white balance and custom exposure, on black background when I introduce new object in view, both objects become brighter. How to turn off this feature or compensate for that ...
ttyghost's user avatar
0 votes
0 answers
25 views

How to relate intrinsics and distortion from AVDepthData to the current video stream?

I am writing a small test app in the context of Computer Vision. The final application will require using the camera calibration, so for now my test app creates a capture session, enables the delivery ...
sansuiso's user avatar
  • 9,309
0 votes
0 answers
24 views

How to know if AVCaptureDevice.SystemUserInterface.videoEffects are supported for the current device?

Calling AVCaptureDevice.showSystemUserInterface(.videoEffects) on an unsupported device or without an active video feed can result in a faulty screen. How to programatically determinate if the current ...
Laszlo's user avatar
  • 2,804
0 votes
0 answers
55 views

How to set AE/AF options in an iOS camera app?

Hello Stack Overflow community, I am currently working on developing a camera app for iOS using AVfoundation. I am facing challenges in implementing the AE/AF (Auto-Exposure / Auto-Focus) options in ...
ManojkumarS's user avatar
2 votes
1 answer
91 views

Shadow moving across camera after setting activeFormat of AVCaptureDevice

So I have a function that essentially walks through the formats of a device, finds the one I want with high resolution and frame rate, then sets that after the camera device inputs have been ...
nickcoding2's user avatar
0 votes
0 answers
14 views

Swift - Optimizing Camera Switching in Custom Camera Feature

I'm currently developing a custom camera feature in my Swift app where users can choose from available cameras on their phones, such as front, back, dual wide, etc. The problem is that when the user ...
Cem Nisan's user avatar
0 votes
1 answer
53 views

How to scan a barcode with all available back cameras of an iphone at the same time?

What I want: I want to scan for barcodes with all available back cameras of an iPhone at the same time. So the user don't have to care about the distance of the barcode so much. What I tried: I ...
tuvok's user avatar
  • 185
1 vote
0 answers
72 views

Can we control optical zoom value manually for iOS camera?

I want to add an optical zoom level to the custom value for the ios camera, Can we achieve this for all iPhone devices depending on their camera type? I have tried this but I am not sure about this is ...
Akash S's user avatar
  • 17
0 votes
0 answers
92 views

Anyone have experienced a bug in setting up AVCaptureDevice.activeColorSpace set to .sRGB?

Hi I would like to ask if anyone has experienced this when using AVCaptureDevice activeColorSpace? (Please see the screenshot below) I am creating a custom camera app using Metal. I am also exploring ...
Ryan Enguero's user avatar
1 vote
0 answers
70 views

iPhone camera angle difference between iOS15 and iOS16

Hi i'm working on develop iOS custom camera app. Recently I discovered that my camera app works differently on iOS 15 and iOS 16. On iOS 15, the video was recorded without any cropped images, and on ...
chamcham's user avatar
0 votes
0 answers
152 views

How to fix capture QR Code data in specific area AVCaptureVideoPreviewLayer using Swift?

I'm doing a QR Code scan in the cornerFrame area but the scan doesn't return any results. I currently have cornerRect with corners green as an example of where I will want the user to scan the QR ...
Charon116's user avatar
6 votes
0 answers
135 views

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 ...
user499846's user avatar
1 vote
0 answers
75 views

How can set Zoom In AVCaptureDevice in Mac OS

I want to add Zoom factor in AVcaptureDevice. But for mac OS i didn't get any solution. in iOS we can use videoZoomFactor this property. but for macOS nothing any property for set zoom. can you please ...
Hiren Dhamecha's user avatar
0 votes
1 answer
60 views

How to get WhiteBalance (Kelvin) from captureOutput

Apple has various ways to change and view the Kelvin of using AVCaptureDevice https://developer.apple.com/documentation/avfoundation/avcapturedevice/white_balance Example: guard let videoDevice = ...
Paul S.'s user avatar
  • 1,342
0 votes
1 answer
118 views

AVCaptureDevice isTorchActive does not work for React Native

I've tried to write my own module to detect is torch turned on/off. According to documentation I've tried to run KVC as below - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object ...
Jaroslaw K.'s user avatar
  • 5,264
0 votes
0 answers
56 views

The issue with Pylance expecting an expression or "." or "(" not being closed is likely due to syntax errors in my code, but where?

Someone suggested this but it DOESN'T work either. In the line AVCaptureDevice.requestAccess (for: .video), the parenthesis around for: .video should be removed as it is not a valid syntax in Python. ...
DSamuelHodge's user avatar
2 votes
1 answer
513 views

Detect when builtInTripleCamera changes lenses?

Background: I'm working on an app that uses videoZoomFactor to zoom in on the camera view by a specific, user-specified amount. I'd like to incorporate using the telephoto and ultra wide lenses. I ...
zakray's user avatar
  • 155
2 votes
0 answers
146 views

iPad Pro M2 model ProRes video recording

I have the following code to determine ProRes and HDR support on iOS devices: extension AVCaptureDevice.Format { var supports10bitHDR:Bool { let mediaType = CMFormatDescriptionGetMediaType(...
Deepak Sharma's user avatar
1 vote
1 answer
63 views

Requesting access with AVCaptureDevice causes a switch in selected tab in tab view

I am trying to add a QR scanner to my app that has a Tab View at the root. It sort of works except for one thing; When the dialog appears to ask the user for permission to use the camera, it also ...
annakodarpa's user avatar
0 votes
1 answer
450 views

Camera zoom level

Is it possible to get the camera zoom level on various device models in iPhone like in built in camera programmatically example 0.5x, 1x, 2x etc? I am unable to find the solution. Anyone can you ...
Ajay K's user avatar
  • 3
1 vote
0 answers
34 views

AVFoundation crash when setting isEnabled on AVCaptureAudioChannel

For some AVCaptureDevices, trying to set isEnabled on an AVCaptureAudioChannel results in a crash: Assertion failed: (pSrcASBD->mChannelsPerFrame == [_internal->audioChannels count]), function -[...
DanM's user avatar
  • 121
0 votes
1 answer
229 views

Why is AVCaptureDevice.maxAvailableVideoZoomFactor so large?

On my iPad with a digital zoom of 5x, the reported captureDevice.maxAvailableVideoZoomFactor for the camera device is 153. Shouldn't it be 5? Am I using the right property to get the max zoom factor?
Denis's user avatar
  • 53
1 vote
0 answers
56 views

AVCapturePhotoOutput with 60 fps and flash on causes image to be over brightened

When using AVCapturePhotoOutput with flashMode On and AVCaptureDevice with minimum frame rate set to 60 fps results in an image that is very over brightened. Using the same configuration with 30 fps ...
Jacob Zyla's user avatar
1 vote
0 answers
39 views

How to detect iPhone device flattened usig camera

I am trying to detect the device flattened to the surface to take pictures like the native camera. Like below Screenshot I tried using CMMotionManager, let motioManager = CMMotionManager() ...
sudheer's user avatar
  • 428
0 votes
1 answer
997 views

How to modify FPS, Bit rate and resolution for the video programmatically in iOS?

I am implementing the functionality for to record the video in my iOS application, Also, i am using ReplayKit to record a full screen instead of the camera's default capturing In that there is a ...
Keval Gajjar's user avatar
0 votes
1 answer
250 views

Optimal handling of AVCaptureSession through app's lifecycle

After reading a lot of Camera App related Apple examples/internet tutorials/random articles I am left with one uncertainty: What is the optimal way of handling your Session setup, while taking into ...
Thirsty4K's user avatar
2 votes
0 answers
129 views

AVFoundation crash in fetching averagePowerLevel from audio connection

I have the following code to update power level meters from AVAudioConnection periodically. func updateMeters() { var channelCount = 0 var decibels:[Float] = [] let audioConnection =...
Deepak Sharma's user avatar
0 votes
1 answer
377 views

Having trouble with flipping camera in swiftui / avfoundation / AVCaptureDeviceInput

I am coding a camera with swiftui using avfoundation and was able to get the setup to work as intended. However, as I'm implementing a flip camera functionality I'm running into an error where after ...
krish's user avatar
  • 37
1 vote
0 answers
445 views

is the zoom factor for builtInTripleCamera's .5 zoom 1.0?

I'm working on a camera app and I currently don't have a device with a triple camera (so I cannot test). When an app initially configures a camera, I want the camera setting with no zoom in and out ...
Yuuu's user avatar
  • 765
1 vote
1 answer
1k views

Difference between builtInDualCamera and builtInDualWideCamera

I know only a little about iPhone's camera, and I'm bit confused with the differences between builtInDualCamera and builtInDualWideCamera. (so as builtInWideAngleCamera and builtInUltraWideCamera) ...
Yuuu's user avatar
  • 765
1 vote
0 answers
245 views

How to handle a video overexposure in Swift

I'm working on a camera app, and I think the behavior of my app and the iPhone default camera app against overexposure is very different. Like the image below, the default camera app adjusts the ...
Yuuu's user avatar
  • 765
0 votes
1 answer
88 views

Duplicate names detected for capture devices

I am using some capture devices for my application, which keep getting detected with the same name by my code which I have written following the link : https://learn.microsoft.com/en-us/windows/win32/...
s_om's user avatar
  • 661
0 votes
1 answer
106 views

AVCaptureDeviceSubjectAreaDidChange when this notification is post in swift

I'm working on a camera app and I'm trying to center the focus of the camera to the center using this notification, AVCaptureDeviceSubjectAreaDidChange. NotificationCenter.default.addObserver(self, ...
Yuuu's user avatar
  • 765
5 votes
1 answer
2k views

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 ...
Mourad's user avatar
  • 51
1 vote
1 answer
980 views

Set resolution for camera in IOS for AI

I am working on a project where I start the camera and then capture images live to image processing. This project has guided me TensorFlow - Image Classification. One thing I can't figure out despite ...
El_Loco's user avatar
  • 1,798
1 vote
1 answer
371 views

AVCaptureDevice's exposurePointOfInterest does not work

I'm trying to change the exposure in my camera app according to certain point of the image. I'm using the following code that is triggered when the user taps on screen. For now I simply try to expose ...
meaning-matters's user avatar
0 votes
0 answers
488 views

How to fix AVCapturevideopreviewlayer being smaller than actual camera view

I'm working on an app that periodically takes pictures as part of a research job but I'm new to OOP and swift and am a little confused on what can cause this issue. I think it's because the UIView's ...
DanielVides's user avatar
6 votes
2 answers
710 views

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 ...
below's user avatar
  • 929
0 votes
1 answer
465 views

iOS capturePhoto() not taking highest resolution photos only on iPad 11" 3rd gen front camera

The goal is to take the highest resolution photo the camera is capable of. The camera selected is the iPad 11" 3rd gen (w/M1) front camera: the new 12MP TrueDepth camera. Although this code does ...
xaphod's user avatar
  • 6,616
2 votes
1 answer
1k views

Set AVCaptureDevice format range

I am able to query and find formats for slo-mo at 240FPS. There are two, with 420v and 420f each, at Full HD (correct me if I'm wrong that they only differ in the pixel value range). I was wondering ...
jackxujh's user avatar
  • 1,003
1 vote
0 answers
266 views

Why scan 1D Barcode only get result in middle of view by Swift?

I have a question about scan 1D barcode. Why I set the yellow border about scanning region view, only I put it in the middle of the region and get the result successfully? It works fine when I put my ...
JimmyLee's user avatar
  • 527
0 votes
0 answers
72 views

How do I keep my flash light code running while the app is put into background?

Button(action: { DispatchQueue.global(qos: .userInteractive).async { self.lightOn.toggle() let cam = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position:...
Ernest Tan's user avatar
0 votes
1 answer
64 views

IOS catalyst avcapturedevice can't realize the function of scanning QR code. It happened in Catalina

IOS catalyst avcapturedevice can't realize the function of scanning QR code. It happened in Catalina. How to realize the function of uiimagepickercontroller scanning QR code This is Catalina's error ...
xiyangxixia720's user avatar
1 vote
0 answers
310 views

Swift. macOS. Record sound from speakers

I want to make the macOS-app for recording the audio from system and other apps (music, video, etc). Not microphone. How can I make that? I see only options the recording from microphone. Thanks in ...
The Tronuo's user avatar
0 votes
1 answer
485 views

iOS barcode scanner App crashes with no crash log

I am trying to make a barcode scanner app. As soon as the camera session begins, the app crashes within a few seconds. I am unable to find the reason behind this. and, how to fix this one. I have ...
Akaanksha's user avatar
  • 171
2 votes
1 answer
927 views

iOS camera output rotated 90 degrees left

I am following this tutorial to build a simple deep learning app for traffic sign recognition. link I made an own model, and I also tried it with the model in this repository: link When I run the app ...
Dániel Anderle's user avatar
0 votes
3 answers
897 views

iOS 14 AVCaptureSession capturing stereo audio with video recording

I was wondering is there's a way to capture stereo audio using an AVCaptureSession. iOS 14 adds support for stereo audio for AVAudioRecorder, but so far I have been unsuccessful is capturing stereo ...
user1752054's user avatar

1
2 3 4 5
7