avcapturedevice

AVCaptureSession Record Video With Audio

萝らか妹 提交于 2019-12-31 09:20:13
问题 I have my app set up to record video from the camera using an AVCaptureSession, however, there is no audio with it. What do I need to do to record audio and then add it to the videoOutput for the file? Here is my code for recording the video: AVCaptureSession *session = [[AVCaptureSession alloc] init]; [session beginConfiguration]; session.sessionPreset = AVCaptureSessionPresetMedium; CALayer *viewLayer = self.vImagePreview.layer; NSLog(@"viewLayer = %@", viewLayer);

Audio Not Recording in AVCaptureSession [duplicate]

梦想与她 提交于 2019-12-30 09:06:09
问题 This question already has answers here : AVCaptureSession audio doesn't work for long videos (3 answers) Closed last year . I have an app that when a view is loaded up, begins capturing video and audio, and upon completion, records it to both the documents folder of the app, along with the Camera Roll of the iPad that it is running on. I have made sure and added in the input to the session for both audio and video, but when I go to view the saved video, there is no audio with it. Can anyone

Audio Not Recording in AVCaptureSession [duplicate]

家住魔仙堡 提交于 2019-12-30 09:05:05
问题 This question already has answers here : AVCaptureSession audio doesn't work for long videos (3 answers) Closed last year . I have an app that when a view is loaded up, begins capturing video and audio, and upon completion, records it to both the documents folder of the app, along with the Camera Roll of the iPad that it is running on. I have made sure and added in the input to the session for both audio and video, but when I go to view the saved video, there is no audio with it. Can anyone

Get Camera Preview to AVCaptureVideoPreviewLayer

我怕爱的太早我们不能终老 提交于 2019-12-29 04:45:07
问题 I was trying to get the camera input to show on a preview layer view. self.cameraPreviewView is tied to a UIView in IB Here is my current code that I put together from the AV Foundation Programming Guide. But the preview never shows AVCaptureSession *session = [[AVCaptureSession alloc] init]; session.sessionPreset = AVCaptureSessionPresetHigh; AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; NSError *error = nil; AVCaptureDeviceInput *input =

Torch in background

断了今生、忘了曾经 提交于 2019-12-25 02:26:32
问题 Is this possible to make torch lighting when app is in background? This is what I do to turn it on: AVCaptureSession *session = [AVCaptureSession new]; AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; [session beginConfiguration]; [device lockForConfiguration:nil]; device.torchMode = AVCaptureTorchModeOn; [device unlockForConfiguration]; [session commitConfiguration]; [session startRunning]; But when app goes to background torch is automatically turned

AVCaptureDevice.requestAccess presents unexpected behavior with a UINavigationController

无人久伴 提交于 2019-12-24 23:03:57
问题 Working with Xcode 10.1 and Swift 4.2 I have a complex app that uses a UINavigationController implemented in the AppDelegate . The rootViewController of the navigationController is a DashboardController() class (subclass of UIViewController ) The DashboardController implements a left menu drawer using several ViewControllers (with self.addChild(viewController) ) Everything works fine, except when I need to push a viewController to present a BarCodeScannerView(). The barebone

AVCaptureDevice's isLowLightBoostSupported always returns false on 5S iOS7.1 (for automaticallyEnablesLowLightBoostWhenAvailable)

独自空忆成欢 提交于 2019-12-23 12:36:59
问题 I'm attempting to enable AVCaptureDevice's automaticallyEnablesLowLightBoostWhenAvailable in an iOS camera app, but I've been utterly unable to make AVCaptureDevice's isLowLightBoostSupported return true. Question: Is there anything that needs to be done to enable the low light boost api beyond locking for configuration? Is there any known reason that isLowLightBoostSupported would always return false (for all devices) on a fully updated, modern, system? I'm testing on a 5S with iOS 7.1. For

How can I determine whether my iOS device has a torch light?

旧时模样 提交于 2019-12-23 11:58:44
问题 In my application I have the option for a torch light. Howevver, only iPhone 4 and iPhone 4S have torch lights. Other devices do not have the torch light. How can I find the current device model? Please help me. Thanks in advance. 回答1: You should not use the device model as an indicator of whether a feature is present. Instead, use the API that tells you exactly if the feature is present. In your case, you want to use AVCaptureDevice 's -hasTorch property: NSArray *devices = [AVCaptureDevice

How to access Mac default camera using swift xcode

穿精又带淫゛_ 提交于 2019-12-23 10:22:02
问题 Today i am coding for Mac first time. What I am trying to do is access the default camera and show a preview. 2nd step i will record or take a snap if i need. For the 1st step i have written the following code import Cocoa import AVFoundation class ViewController: NSViewController { override func viewDidLoad() { super.viewDidLoad() var session:AVCaptureSession = AVCaptureSession() session.sessionPreset = AVCaptureSessionPresetLow var device:AVCaptureDevice = AVCaptureDevice

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