Questions tagged [avcapture]

iOS video capture API for both Swift and Objective-C

Some common high-level objects used with this API:

  • AVCaptureDevice
  • AVCaptureSession
  • AVCaptureVideoPreviewLayer

related tags:

223 questions
0
votes
0 answers

Torch is not turning off instantly, after called device.torchMode = .off and getting dim images after torch too in iOS Swift AVCapture

What we want is, we wanna capture image, after torched for few seconds. It's working fine from lowest to iPhoneX. Start from iPhone 11 to latest the torch is not turning off instantly, when the function called the torched off. It's turning off after…
0
votes
1 answer

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 flipping it just goes to a black screen as I'm…
krish
  • 37
  • 2
  • 10
0
votes
1 answer

Instance member 'fileDataRepresentation' cannot be used on type 'AVCapturePhoto'; did you mean to use a value of this type instead?

Swift gives the error that a fileDataRepresentation cannot be created for AVCapturePhoto. Printing "photo", returns the photo's metadata. How can I convert the image to file bytes and eventually base64? I have tried many methods so far, but all rely…
0
votes
1 answer

AVCapturePhotoOutput to Base64

I am using swift to develop an app that communicates with my server which runs flask. I would like to be able to take a picture and upload it in a base64 format. Currently the base64 encoding I am using is producing a corrupt and unusable image. As…
Python 123
  • 59
  • 1
  • 13
0
votes
0 answers

display both front and back views of camera in the same class

I want to display both the front and the back camera views on a single view at the same time (2 separate views in the same single UIView view controller). Right now only the back view is being displayed. I have tried a couple of things but the I…
Sam Burns
  • 65
  • 1
  • 10
0
votes
1 answer

AVCaptureAudioDataOutput Is Not Calling AVCaptureAudioDataOutputSampleBufferDelegate.captureOutput

When I run AVCaptureSession with AVCaptureAudioDataOutput, the delegate is not being called. What step am I missing? I appreciate your help! import Cocoa import AVFoundation class ViewController: NSViewController,…
jl303
  • 1,461
  • 15
  • 27
0
votes
1 answer

how to get focal length of camera of iPhone using AVFoundation

how can I find focal length of iPhone camera lens. I already find out lens aperture value by this:- let aperture = currentcamera?.lensAperture print("Aperture of camera is:-",aperture!)
Saurav_Sharma
  • 130
  • 1
  • 10
0
votes
2 answers

camera roll image is bigger than the camera preview

I am creating a camera app. I can take a image and the image is passing back to a view controller to show the image. It also saved to the camera roll. If I compare the image with the camera preview to the saved image, it seems like that the camera…
adri567
  • 533
  • 5
  • 20
0
votes
2 answers

Preview layer not being constrained to UIView

My Swift code below is trying to constrain the previewLayer to the bounds of the UIView which is named camera view. However that is not happening. The previewLayer is much bigger than the constraint cameraView UIView. The cameraView is constrained…
user12655184
0
votes
1 answer

Programatic Screenshot with Camera View

I am using the below code to take a screenshot of the screen, but it replaces the camera view with all black (though all other UI elements are fine-- I need the Camera View as well as UI elements). All answers to similar questions that I've found…
Branch
  • 387
  • 5
  • 16
0
votes
0 answers

AVCaptureDevice configuration taking unpredictable time to propagate to connected AVCapturePhotoOutput

I am trying to modify the exposure duration of photos taken. Within the loop: for (customDuration, customISO) in zip(exposureDurations, exposureISOs) { // exposureDurations and exposureISOs are just arrays of exposures // code here } I set the…
0
votes
1 answer

DIsplaying Asynchronous stillImageOutput from AVVideoCapture Session using AVFoundation

I am capturing video in preview mode and would like to display a still image captured by the camera. I currently save the image and capture output to ivars defined in the interface as: UIImage *snapshot AVCaptureStillImageOutput*…
user1904273
  • 4,562
  • 11
  • 45
  • 96
0
votes
1 answer

iOS: Is it possible to scan multiple QR Codes, detect them, and pick up one?

I would like to know if there is a library, or a Github with the capability to detect several qrcodes and choose one of them. For example if I scan that listing, I would see something that detect the surface (with the red square), and put them in…
ΩlostA
  • 2,501
  • 5
  • 27
  • 63
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

Manually set exposure for iOS camera in Swift 4

How can I set Aperture and how it will effect in image? I have managed ISO and shutter speed.but I am not able to set Aperture value.
Rohan Mali
  • 61
  • 1
  • 7