Questions tagged [avcaptureoutput]

51 questions
1
vote
2 answers

AVCaptureStillImageOutput.pngStillImageNSDataRepresentation?

I am working with AVCaptureStillImageOutput for the first time, I save a JPEG image at some point. Instead of a JPEG image I would like to save a PNG image. What do I need to do for that? I have those 3 lines of code along the app: let…
Michel
  • 10,303
  • 17
  • 82
  • 179
1
vote
0 answers

Record video with audio

I am going to create app where I am going to record video with audio and then play it. For this I am using AVCaptureManager in my code. Here if video is about 10 second, both audio and video playing and it's working fine. But if I recorded videos…
0
votes
0 answers

How to relate intrinsics and distortion from AVDepthData to the current video stream?

I am writing a small test app in the context of Computer Vision. The final application will require using the camera calibration, so for now my test app creates a capture session, enables the delivery of the intrinsics matrix and logs it. As an…
0
votes
0 answers

Swift - Optimizing Camera Switching in Custom Camera Feature

I'm currently developing a custom camera feature in my Swift app where users can choose from available cameras on their phones, such as front, back, dual wide, etc. The problem is that when the user switches to a different camera, it takes a…
0
votes
1 answer

Swift: AVAssetWriter output issue with duration

I am using AVAssetWriter to write data captured using AVCaptureOutput. I can able to create the output mp4 but the mp4 generated duration is not in sync with actual frames captured. For eg: If I recorded video for 30 sec with 30fps (900 frames) then…
0
votes
0 answers

Is it possible to set preferred sample buffer size for AVCaptureOutput?

Say we have an AVCaptureAudioDataOutput object that has been set up with an AVCaptureSession to get data samples from the device's microphone. captureOutput(_:didOutput:from:) in AVCaptureAudioDataOutputSampleBufferDelegate always gets called with…
0
votes
1 answer

captureOutput not being called from delegate

So I realize there are several questions about this but I feel like I've reviewed them all and still haven't figured out what I did wrong or different. I call this class from a function that I know happens after viewDidLoad. What I am trying to do…
0
votes
0 answers

Objective C class that works in a native IOS App stops working when added to nativescript

I have a video recording class that I created in Objective C that works and I can view all the frames from the recording when I run it in a native app. The class basically creates and AVCaptureSession and sets that up. All you need to do is pass it…
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

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

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

Crop Image after taking from custom camera in Swift

I have custom camera view and on top of that I have guides I want to crop the taken photo to that guide, when I get the cropped image I get of different section, I want to get the area inside the guides. func imageByCropToRect(rect:CGRect,…
Anirudha Mahale
  • 2,526
  • 3
  • 37
  • 57
0
votes
1 answer

After Imigrating to Swift 4 an AVCaptureOutput function has been stopped being called?

After immigrating Swift 4 following function has been stopped being called. I could not find the reason. func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection:…
Hope
  • 2,096
  • 3
  • 23
  • 40
0
votes
0 answers

AVCaptureVideoDataOutput does not give any frames

After creating the AVCaptureVideoDataOutput the session does not produce any frames. No frames have been dropped, the device log has been checked but there is nothing in there and no errors are produced by the device. This has been tested and works…
0
votes
0 answers

ios didOutputSampleBuffer drop first few frames

Iam making an app which needs to record video and audio usingAVCaptureVideoDataOutputSampleBufferDelegate the functions i use are : func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from…