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

Optional Types in Swift AVCaptureDevice

let captureDeviceInput: AVCaptureDeviceInput? do { captureDeviceInput = try AVCaptureDeviceInput(device: device) if session.canAddInput(captureDeviceInput) { session.addInput(captureDeviceInput) } }…
tchen2
  • 61
  • 4
2
votes
0 answers

Focus not working some time in custom camera

I'm using SwiftyCam as CustomCamera in my App. but in camera i notice focus sometime not changing. if i tap on far object it not going focus fast and sometime i need to move my phone. I'm not able to find reason why this happening. Below is the code…
jay patel
  • 238
  • 2
  • 14
2
votes
1 answer

Invert / Reverse White on Black Barcode for iOS 11 AVCaptureMetadataOutput

Does the iOS 11 Apple AVCaptureMetadataOutput for scanning barcodes work with Code 128, Data Matrix, and QR Code when White on Black? Any extra variables, properties, or settings in the library we are not familiar with? There is a reasoning for…
Berry Wing
  • 113
  • 1
  • 5
2
votes
1 answer

Overlay over AVCaptureVideoPreviewLayer

I am trying to create an overlay over my video preview layer. I tried the following. But my overlay view is not being displayed on top of the preview layer. It simply shows a blank screen. CameraOverlayView contains my design let previewLayer:…
Cloy
  • 2,141
  • 23
  • 32
2
votes
0 answers

Reading QR-Code with null byte in Swift

I'm trying to scan a QR-Code containing a null byte (\x00) with AVFoundation. The problem is that AVMetaDataMachineReadableCodeObject.stringValue only returns the data before the null byte. For example when QR-Code data is "ABC\x00abc" the…
ndreisg
  • 1,119
  • 13
  • 33
2
votes
1 answer

AVCapture and zooming of previewLayer in Swift

I have a camera app which allows the user to both take pictures and record video. The iPhone is attached to a medical otoscope using an adapter, so the video that is captured is very small (about the size of a dime). I need to be able to zoom the…
Steve Graff
  • 198
  • 2
  • 8
2
votes
1 answer

isVideoOrientationSupported always Returns NO AVCaptureConnection

I'm using AVCaptureMetadataOutput to detect faces on iOS, and I'm trying to set the orientation of the video after the user rotates their device. However, it appears that I can't do this as every time I call the getter isVideoOrientationSupported on…
Alex Wulff
  • 2,039
  • 3
  • 18
  • 29
2
votes
1 answer

(Cocoa error -1) When attempting to save video created with AVCaptureSession

I'm generating a video using an AVCapture session and then using an AVVideoCompositionCoreAnimationTool to add a simple overlay. I then use an AVAssetExportSession to output the file. This all seems to work but then when I attempt to save it to the…
Gaz Long
  • 347
  • 3
  • 13
2
votes
1 answer

IOS Capture 12 MP Video (IPhone 6s) yields 1000x750

According to https://forums.developer.apple.com/thread/21694 Both iPhone 6s and 6s Plus can capture 12 megapixel photos (4032x3024) on the rear-facing camera via the AVCaptureStillImageOutput, and can deliver up to 30 fps 12 MP frames to your…
Heribert
  • 613
  • 1
  • 9
  • 27
2
votes
0 answers

AVCaptureStillImageOutput area selection

Here is a challenge I am facing, when saving an image taken from the camera, in an iOS app written in Swift. I am not saving exactly what I want, I am saving more than necessary and it is not good. These are the two relevant chunks of code for this…
Michel
  • 10,303
  • 17
  • 82
  • 179
2
votes
1 answer

AVCapture arbitrary shaped lens

Starting to handle the camera in a swift app I have the following chunk of code (which I got from the net) working as supposed to. previewLayer = AVCaptureVideoPreviewLayer(session:…
Michel
  • 10,303
  • 17
  • 82
  • 179
2
votes
1 answer

UIImage from CMSampleBuffer has a blue tint

I am displaying a video feed of CMSampleBuffers converted to UIImages inside a UIImageView. In the photo below, the background layer is an AVCapturePreviewLayer and the center is the buffer feed. My goal is to remove the blue tint. Here is the…
Ivan Lesko
  • 1,274
  • 13
  • 26
2
votes
1 answer

iPhone video capture (best method)

I am curious about the new APIs for iPhone iOS: AVCapture... Does this include a documented way to grab a screenshot of the camera preview? The doc seems a bit confusing to me, and since it is out of NDA now, I thought I would post my question…
Brett
  • 11,637
  • 34
  • 127
  • 213
2
votes
4 answers

AVCaptureVideoPreviewLayer and preview from camera position

I'm developing an app that permits user to takes photo. I've started using AVCam apple provides but i'm actually have a problem Simply i cannot position the camera layer where i want but it's positioned automatically on center of the View On the…
Tiziano
  • 316
  • 1
  • 4
  • 17
2
votes
1 answer

Objective-C iOS7 detect active phone call and microphone availability

I want to be able to detect if microphone is available for recording a video, and if the user is on a phone call microphone isn't available. What is the best way to detect microphone availability taking into account phone calls. This is the code I…
kevin
  • 4,177
  • 10
  • 32
  • 33