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

Translate CGRect from CALayer to UIImage

I have a camera app which shows a video preview in a AVCaptureVideoPreviewLayer instance, which includes a CGRect (for example a frame around the user). This layer has the same size as the UIView which contains the layer (for instance 667x375). How…
Vinod Vishwanath
  • 5,821
  • 2
  • 26
  • 40
0
votes
1 answer

AVCaptureDevice.requestAccess presents unexpected behavior with a UINavigationController

Working with Xcode 10.1 and Swift 4.2 I have a complex app that uses a UINavigationController implemented in the AppDelegate. The rootViewController of the navigationController is a DashboardController() class (subclass of UIViewController) The…
eharo2
  • 2,553
  • 1
  • 29
  • 39
0
votes
0 answers

Swift barcode scanning only works in the dark

I'm building a barcode scanning app and it works great most of the time. One problem I'm having is one item will refuse to scan under normal most lighter lighting conditions but will scan when slightly dark. My question is, how can I get the camera…
Blue
  • 1,408
  • 4
  • 17
  • 36
0
votes
0 answers

Scene background from camera - FPS

I can use AVCaptureDevice as background.contents of SCNScene. And it works, but there is one problem with it. I would like to use video format that has resolution 1920x1080, and 60 FPS. But I can clearly see, that different format is used, it is 30…
Damian Dudycz
  • 2,622
  • 19
  • 38
0
votes
1 answer

Swift 4, Is there a way to capture photo with good quality without using capturePhoto?

I know that AvcaptureSession.Preset.Photo has a size of video output of 750/1000 and has a size of photo output of 3024 / 4034 Is there a way to capture the photo output without using capturePhoto? I tried to capture from "didoutput" but this is a…
0
votes
1 answer

Crash - AVCaptureSessionPresentMedium in the iPhone XS

I have tried to capture a video after successfully capture images and my application crash. if (iSRecordVideo) { DLog(@"iSRecordVideo"); //ADD AUDIO INPUT AVCaptureDevice *audioCaptureDevice = [AVCaptureDevice…
Ilesh P
  • 3,940
  • 1
  • 24
  • 49
0
votes
0 answers

iOS - How to marge audio record on my Camera Session?

I'm trying to add record audio when I record video Session. I want to helping me how to make syntax or where to add my audio device and where to combine the files. func setupCameraSession() { // setup video device input let…
Amro Jaber
  • 185
  • 1
  • 17
0
votes
1 answer

Front Camera Crash when turning flash for custom camera?

I tried to set up flash on/off for camera in the custom camera app , I am trying to make but the camera keeps crashing on switching on flash in front camera mode in iPhone 6. Any help is appreciated. Thanks. if ((currentCamera?.hasFlash)!) { do…
SwiftNinja95
  • 157
  • 2
  • 16
0
votes
1 answer

USB webcam not acknowledged as AVMediaTypeVideo - XCode/Mac

I am using XCode version 9.4 and writing an application to run on a Mac. I have a Logitech C525 USB webcam and am trying to capture video from it and place into a view. I am having a problem early-on trying to get a handle to my device. When the…
BitHead
  • 11
  • 2
0
votes
1 answer

AVCaptureDevice list doesn't refresh after USB camera connected/disconnected

I have a simple C or Objective-C program that prints all connected video devices on MacOS using AVFoundation framework. When I disconnect or connect new video capture device list doesn't get refreshed until I stop program and run it again. My code…
Jan Kuri
  • 927
  • 12
  • 17
0
votes
1 answer

Display camera feed in UIView in iOS

I have an iOS app with a simple UIView placed in the view controller. I am trying to show the camera feed of the front facing camera, in the UIView. I am not trying to take a picture or record a video, I simply want to show the live feed in a…
0
votes
2 answers

Swift 4 Capture Photo, photoOutput returns nil

Currently I have two different view controllers and a button that switches between them. On each of them I want to be able to snap a photo of the device input. I currently am able to snap a Photo of the back camera for processing and that works…
Rolthar
  • 151
  • 2
  • 23
0
votes
0 answers

Camera app freezes during phone call

I have a bug in my camera app. If you open the app while on a phone call, the entire app freezes. I've tried using AVCaptureSessionWasInterrupted and AVCaptureSessionInterruptionEnded notifications to handle the audio input management during a phone…
Jake
  • 13,097
  • 9
  • 44
  • 73
0
votes
0 answers

Front facing camera on iPhone preview mirrored

I am using working with swift on xcode 9.2 to code up a quick preview app for my ios 11. My issue is that when I deploy the following code snippet to start a video preview using my front camera the preview is mirrored. Is there a way to avoid this…
Veejay
  • 515
  • 3
  • 7
  • 20
0
votes
1 answer

Error when instantiating AVCaptureDeviceInput

I'm building an app with a bottom bar that has different views. An RSS feed view opened by the bottom left corner button and a custom camera from the bottom right corner button. By compiling the app and running it in the simulator, when I tap on the…