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
3
votes
0 answers

Snapshot of a AVCaptureVideoPreviewLayer and overlaid Views

I have a AVCaptureVideoPreviewLayer on a view with the camera feed and some views above it (buttons, reference lines, etc). How can I get a snapshot of the app as the user sees it (with the camera image and overlays)? The window…
João Colaço
  • 1,202
  • 1
  • 14
  • 38
3
votes
1 answer

AVFoundation, AVCaptureMetadataOutput capturing screenshot

I am using AVCaptureMetadataOutput in order to use iOS QRCode,barcode scanning feature. This works well, and I get the result of scanning through AVCaptureMetadataOutput delegate method -(void)captureOutput:(AVCaptureOutput *)captureOutput…
3
votes
1 answer

Supported AVCaptureSessionPreset on iOS device

Is there a way to check whether is concrete AVCaptureSessionPreset supported on iOS device? I want to set a resolution of AVCaptureSession, but I do not know how to check whether the divice is capable to capture camera frames using selected…
3
votes
2 answers

Can't use dispatch_sync in c++ class with Objective-C++ code

I need to use Objective-C++ code in inherited C++ class which works with video recording from iPhone camera (getting CMSampleBufferRef through an other native-objective-c class Wrapper with CMSampleBufferDelegate). The AVCaptureVideoOutput that i…
dreamzor
  • 5,795
  • 4
  • 41
  • 61
3
votes
2 answers

Can I get any useful information from the camera?

I am using the AVCaptureVideoDataOutputSampleBufferDelegate to display the video from an iPhones camera in a custom UIView with the following delegate method. - (void)captureOutput:(AVCaptureOutput *)captureOutput…
Wez
  • 10,555
  • 5
  • 49
  • 63
2
votes
0 answers

iOS AVFoundation image capture too slow

I am creating session and AVCaptureStillImageOutput this way: __imageCaptureSession = [[AVCaptureSession alloc] init]; __imageCaptureSession.sessionPreset = AVCaptureSessionPresetPhoto; __imageCapture = [[AVCaptureStillImageOutput alloc]…
Martin Pilch
  • 3,245
  • 3
  • 38
  • 61
2
votes
0 answers

Reset permissions for iOS apps installed on Apple Silicon Mac

UI flows can be built around requesting permissions for, for example, camera or microphone access in iOS apps. With Xcode 14, it's super easy to run an app on an Apple Silicon Mac with the device "My Mac (Designed for iPhone)". However, how do you…
CosmicVarion
  • 116
  • 9
2
votes
1 answer

How to get an AVCapture Timecode?

I'm working on a video capture app using the AVFoundation framework, based on the AVCam sample by Apple. I'd like to implement functionality to set a maximum video length, and have the capture automatically stops when this limit is reached (similar…
2
votes
0 answers

iPhone AVCapture: accessing the CVPixelBuffer is slow

I've been using CoreGraphics to create a bitmap context around the pixel buffer and extract an image using CGBitmapContextCreateImage, then using CGContextDrawImage to draw that image in another (grayscale) buffer. Profiling shows that…
LaC
  • 12,624
  • 5
  • 39
  • 38
2
votes
0 answers

Swift isLockingFocusWithCustomLensPositionSupported always returns false

I want to set the lens distance of my iPhoneX to a constant. In order to check if that is supported, I check the isLockingFocusWithCustomLensPositionSupported property of my device, as described in the documentation here:…
Bghaak
  • 1,150
  • 14
  • 24
2
votes
1 answer

Not able to add input in case of Front camera, Switching camera from back to front?

I am opening my camera in a custom view(cameraView) and It is working fine for Back camera but the issue comes when I switch it to front using a custom turn button(TurnCamera), I got the following: input "AVCaptureFigVideoDevice: 0x1035c9e80…
piyush ranjan
  • 391
  • 4
  • 15
2
votes
1 answer

AVCapture session freezes/stuck when locking/unlocking the iPhone

I'm implementing scanner functionality in my xamarin.forms app and for that I'm using iOS native AVCaptureSession. But my problem is while scanning or while capture session is active and the device is being locked, then after unlocking the device…
Nidhi Sood
  • 125
  • 1
  • 1
  • 7
2
votes
1 answer

Capturing video and saving it via AVAssetWriter

I want to save AVAssetWriter output to the camera roll, I'm currently saving it to the documents directory. I have tried to use the UISaveVideoAtPathToSavedPhotosAlbum(_:_:_:_:) . I am currently using AVAssetWriter to write to the…
2
votes
1 answer

iOS camera AVCaptureSession in portrait with landscape size or resolution

I created AVCaptureVideoPreviewLayer in portrait mode, I want to know how to appears it in 16:9 ration(landscape aspect ratio) while holding in portrait mode I tried: 1.Giving camera PreviewLayer 16:9 size but it appears as zoomed 2.I tried using…
dev
  • 87
  • 1
  • 5
2
votes
1 answer

Switch between AVCaptureSession and ARKit - do I need to recalibrate the AR session?

I am working on a project where I need to take high quality photos( ReplayKit quality is not enough) and combine them with positions from ARKit frame. I need to take about 10 photos with positions and each of those photos should be in the same…
Adam Roszyk
  • 389
  • 1
  • 10