avcapturesession

AVAssetWriter has an audio 'crackle' only on iOS 13 devices

与世无争的帅哥 提交于 2019-12-23 03:44:14
问题 I use AVCaptureSession to write to a mov file using AVAssetWriter. The same code on a pre-iOS 13 devices does not have the crackle. On all iOS 13 devices, regardless of iPhone/iPad model, have the audio crackle. I've submitted this to Apple as a bug, but I'm worried I'm missing something simple. Is there anyone else experiencing this? Any ideas of settings I could change? Things I've tried Changed mov -> mpeg Tried multiple audio codecs (particularly AppleLossless and AAC) Pushed to main

Weird bug with AVCaptureSession

天涯浪子 提交于 2019-12-23 00:25:42
问题 I use the following code to set up an AVCaptureSession, record a video file, and play it back: Sometimes this works just fine, and other times I get a black screen on playback. As far as I can tell it's completely random. When the bug happens, if I try to open the file in quicktime, i get a "file cannot be opened, format not recognized" message. This leads me to believe its a recording issue rather than a playback issue. Also, if comment out the part of the code which adds the microphone

Weird bug with AVCaptureSession

南笙酒味 提交于 2019-12-23 00:25:03
问题 I use the following code to set up an AVCaptureSession, record a video file, and play it back: Sometimes this works just fine, and other times I get a black screen on playback. As far as I can tell it's completely random. When the bug happens, if I try to open the file in quicktime, i get a "file cannot be opened, format not recognized" message. This leads me to believe its a recording issue rather than a playback issue. Also, if comment out the part of the code which adds the microphone

Callback when phone call ends? (to resume AVCaptureSession)

谁说胖子不能爱 提交于 2019-12-22 10:33:52
问题 I have a video camera app and I would like it to allow users to capture content while on the phone. I can do this by disconnecting the audio capture when the phone call is received and the session is interrupted, but because the session is no longer interrupted, I now have no way of knowing when the phone call ends and it is ok to reconnect the audio device. If I use this callbacks for AVCaptureSessionWasInterruptedNotification and AVCaptureSessionInterruptionEndedNotification : - (void

AVAssetWriter goes AVAssetWriterStatusFailed after appendSampleBuffer:

隐身守侯 提交于 2019-12-22 09:03:45
问题 I am trying to perform screen-recording using AVAssetWriter, which also accepts audio input. However, I have been stuck on this error, where AVAssetWriter sometimes becomes AVAssetWriterStatusFailed after a few calls on appendSampleBuffer: (inside encodeAudioFrame: ) Failed: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x32b570 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x70d710 "The operation couldn’t be

Unable to get devices using AVCaptureDevice

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 06:36:12
问题 I've managed to find some code that would give me access to the devices of a phone (such as the camera). The issue is that when I compile the code (and I'm printing the different devices) using Xcode, I get an empty array. Here is what I wrote: import UIKit import AVFoundation class ViewController: UIViewController { let captureSession = AVCaptureSession() var previewLayer : AVCaptureVideoPreviewLayer? // If we find a device we'll store it here for later us var captureDevice : AVCaptureDevice

AVCaptureSession preset creates a photo that is too big

久未见 提交于 2019-12-21 22:19:24
问题 I have a photo taking app that is using AVFoundation . Once an image is captured, I have 2 core graphics methods that I have to run in order to properly rotate and crop the image. When testing this using the typical AVFoundation setup for capturing camera photos with a session preset of AVCaptureSessionPresetPhoto , I was always receiving a ton of memory warnings and I spent 2 weeks trying to solve these and I finally gave up. I ended up ditching the typical

How do i save a video (mp4 format) using AVCaptureVideoDataOutput?

烈酒焚心 提交于 2019-12-21 18:40:09
问题 I have set up the input, and the output for the AVCapture session and also the delegate - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection is getting called. How do I convert the frames to a mp4 video file and save it? 回答1: Use an AVAssetWriter to compress the data and write to MP4. These two samples contain code that does this: http://www.gdcl.co.uk/2013/02/20/iPhone-Pause.html http:/

How to take a photo automatically at focus in iPhone SDK?

孤者浪人 提交于 2019-12-21 17:41:16
问题 I am creating an app in which user takes the picture of a image with text and upload to server. I have used AVCaptureSession to open camera and placed a bar button which captures the latest frame and uploads it to the server. In this app, user can send multiple images to the server one by one by clicking the bar button. I was wondering if it was possible that user does not have to press the button to capture a frame. Is this possible that current frame is captured automatically with auto

Swift AVCaptureSession Close Open Button Error : Multiple audio/video AVCaptureInputs are not currently supported

时光怂恿深爱的人放手 提交于 2019-12-21 12:13:29
问题 I have a working barcode scanner code. When I click the openCamera button, first time everything is good. When I click the closeCamera button, good, but if I click again the openCamera button gives a fatal error. Code and error are below. In fact, is it possible to toggle camera view with one button? // Barcode Camera Properties let captureSession = AVCaptureSession() var captureDevice:AVCaptureDevice? var captureLayer:AVCaptureVideoPreviewLayer? override func viewDidLoad() { super