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

AVCaptureVideoDataOutputSampleBufferDelegate with SceneKit and AVDeviceCapture background

I'm trying to grab the CVPixelBuffer while using the camera video feed as a background to SceneKit. Please note I cannot use ARKit for my project as I need the front + back camera and no world tracking overhead. Even attempting the most basic…
hartw
  • 356
  • 3
  • 17
0
votes
1 answer

Flash is Not Working in iPhone 6S with iOS 11.2.2

When I'm running the app in iPhone 6S with iOS 11.2.2. The Flash is not working. Toggle button is working fine i.e., On/Off. But, Flash is not coming when the toggle is On. - (void)toggleFlash{ NSArray *devices = [AVCaptureDevice devices]; …
0
votes
1 answer

AVCapturePhotoOutput not returning proper image

My requirement in the app is to capture an image without previewing the UIImagePickerController So I have used following code to capture an image without presenting the same. - (void)clickImage { AVCaptureDevice *rearCamera = [self…
Bhargav Soni
  • 1,067
  • 1
  • 9
  • 22
0
votes
3 answers

iPhone flashlight app crashes when button is tapped fast

I got my flashligh app working perfectly. For some reason tho, everytime i tap on the flashlight button really fast, the app just freezes and doesnt do anything. It seems that its freezing when i call the AVCaptureSession stopRunning. Heres the code…
zaid
  • 223
  • 5
  • 8
0
votes
1 answer

Prevent view dismissing after the request access to the AVCaptureDevice

How can we prevent the view from going to the previous view after user clicks OK button on camera access prompt? Here is our code: func RequestCameraAccess() { AVCaptureDevice.requestAccess(forMediaType: AVMediaTypeVideo, completionHandler: {…
0
votes
1 answer

Camera Freezes on starting emotion detector

Hey I am using Affectiva Affdex ios SDK. Now I have 2 views. UIView -> Where i run a camera stream. Code for the same is here: func allConfig(withCamView cams:UIView) { let captureDevice = AVCaptureDeviceDiscoverySession(deviceTypes:…
Aakash Dave
  • 866
  • 1
  • 15
  • 30
0
votes
0 answers

AVCaptureDeviceFormat x Battery Life

Will running an AVCaptureDevice at a 1920x1080 AVCaptureDeviceFormat consume more battery than a format at say 640x480? If on say an iPhone Plus, where there exists a resolution exactly equal to the screen resolution, you're at least saving a…
0
votes
2 answers

AVCapturePhoto Why is my photo always nil?

I'm trying to implement some custom camera similar to snapchat. I cannot see why my image is always nil during segue. Maybe a fresh pair of eyes may help as I have been working on this for 2 days now... When I tap the take photo button (to run…
user7804097
  • 308
  • 1
  • 3
  • 17
0
votes
0 answers

"Extra argument in call" with AVCaptureDevice

Getting Error on this line: error let backCamera = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back) another screen shot of code
user7041947
  • 1
  • 1
  • 4
0
votes
1 answer

Broken cv:Mat from CMSampleBufferRef when using AVCaptureSessionPresetPhoto

I am using this code to create a cv::Mat from a CMSampleBufferRef. It works fine for AVCaptureSessionPreset's (High, Medium, Low) but when I use AVCaptureSessionPresetPhoto it outputs a garbled image. - (cv::Mat)…
0
votes
1 answer

Using custom camera shutter sound

Is there a way to implement custom shutter sound when capturing still image in camera controller? I guess default sound plays automatically and can't be turned off but is it ok to play another sound over it?
ZassX
  • 1,369
  • 2
  • 14
  • 35
0
votes
2 answers

AVCaptureDevice focusPointOfInterest doesn't change

I have an IBAction with this code: .h file: AVCaptureDevice *device; .m file: - (IBAction)focusInfo { if (device == nil) { device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; } NSLog(@"Camera focus point of interest: %d,…
woojtekr
  • 285
  • 1
  • 5
  • 16
0
votes
0 answers

How to ask for multiple permission in iOS swift?

I am using camera for recording in swift.For image capture image i ask user for only one permission.But for video there are two permission Camera & Microphone.I am checking camera permission.I want to user should be able to record video if both…
TechChain
  • 8,404
  • 29
  • 103
  • 228
0
votes
1 answer

AVCaptureMovieFileOutput Orientation In Landscape

My app uses the front facing camera to record video. I have the Preview Layer successfully set up to show it in landscape right mode, which is the only way the app will run. How do I make sure the Movie output displays correctly? session =…
user717452
  • 33
  • 14
  • 73
  • 149
0
votes
1 answer

AVCaptureDevice.devices adjusted to AVCaptureDeviceDiscoverySession

Since AVCaptureDevice.devices is depreciated in iOS 10, I am trying to adjust this example code to AVCaptureDeviceDiscoverySession. var error: NSError? var captureSession: AVCaptureSession? var backVideoDevice: AVCaptureDevice? //let videoDevices =…
Harry
  • 786
  • 1
  • 8
  • 27