avcam

Why my iOS app does not ask user permission to access camera?

只愿长相守 提交于 2020-05-15 04:48:07
问题 I develop iOS app and it uses camera. AVCaptureDeviceInput is used to interface to camera. I checked Authorisation status as - (void)checkDeviceAuthorizationStatus { NSString *mediaType = AVMediaTypeVideo; [AVCaptureDevice requestAccessForMediaType:mediaType completionHandler:^(BOOL granted) { if (granted) { //Granted access to mediaType [self setDeviceAuthorized:YES]; } else { //Not granted access to mediaType dispatch_async(dispatch_get_main_queue(), ^{ [[[UIAlertView alloc] initWithTitle:@

Swift isLockingFocusWithCustomLensPositionSupported always returns false

陌路散爱 提交于 2020-01-23 17:01:31
问题 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: https://developer.apple.com/documentation/avfoundation/avcapturedevice/2361529-islockingfocuswithcustomlensposi The method always returns false, even when the device is locked for configuration, which means that calling the method setFocusModeLocked(lensPosition,

Swift isLockingFocusWithCustomLensPositionSupported always returns false

偶尔善良 提交于 2020-01-23 17:01:08
问题 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: https://developer.apple.com/documentation/avfoundation/avcapturedevice/2361529-islockingfocuswithcustomlensposi The method always returns false, even when the device is locked for configuration, which means that calling the method setFocusModeLocked(lensPosition,

Swift isLockingFocusWithCustomLensPositionSupported always returns false

蹲街弑〆低调 提交于 2020-01-23 17:01:07
问题 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: https://developer.apple.com/documentation/avfoundation/avcapturedevice/2361529-islockingfocuswithcustomlensposi The method always returns false, even when the device is locked for configuration, which means that calling the method setFocusModeLocked(lensPosition,

AVCam save full screen captured image

回眸只為那壹抹淺笑 提交于 2020-01-04 13:10:14
问题 I am using AVCam made by apple for my custom camera view. Honestly it is not to simple to understand what's going on in the class AVCamViewController if you see it at first time. Right now I am interested how they set frame of captured image. I tried to found where some fames setters or something like this, but I have not found any. I searched in Google and found answer here AVCam not in fullscreen But when I implemented that solution I just realised that it just made live camera preview

iPhone App - Show AVFoundation video on landscape mode

折月煮酒 提交于 2020-01-02 08:21:46
问题 I am using the AVCam example App from Apple. This example uses AVFoundation in order to show video on a view. I am trying to make from the AVCam a landscape App with no luck. When screen orientation changes the video is shown rotated on the view. Is there a way of handling this problem? 回答1: When you create your preview layer: captureVideoPreviewLayer.orientation = UIInterfaceOrientationLandscapeLeft; And the methods to manage rotations: -(void)willAnimateRotationToInterfaceOrientation:

Reopening AVCaptureSession

只愿长相守 提交于 2020-01-01 05:48:10
问题 I have an application which takes some pictures. My whole application is based on the AVCam sample code from WWDC 2010. I've messed with it a lot and yet, up until now I can't figure out how to release the camera view properly which releases the camera session... All i'm trying to do is the following: Open camera view controller Take some photos Close camera view Controller Open it again The second time I push the viewController the session is lost, preview is not available and capturing is

Front Camera recording is MUTE

可紊 提交于 2019-12-24 15:28:49
问题 I am working with some camera recoding app. I want to record video using front and back camera both. For back camera my video is working fine but for front camera my final video is mute (without audio). CODE: - (id)initWithPreviewView:(UIView *)previewView { self = [super init]; if (self) { NSError *error; self.captureSession = [[AVCaptureSession alloc] init]; self.captureSession.sessionPreset = AVCaptureSessionPresetHigh; //AVCaptureSessionPresetHigh AVCaptureSessionPresetPhoto //

AVCam not in fullscreen

雨燕双飞 提交于 2019-12-21 04:27:21
问题 I've integrated AVCam in my iOS app. The problem is in iPhone 4 the preview frame isn't fullscreen, it has empty side borders... How can I solve this? Thanks. 回答1: You need to use the videoGravity property of the AVCaptureVideoPreviewLayer . Take a look to the doc. You need to use: AVLayerVideoGravityResizeAspectFill Edit: Based on that the solution founded by the asker is: - (void)setSession:(AVCaptureSession *)session { ((AVPlayerLayer *)[self layer]).videoGravity =

How to record video in ProRes codec on iOS?

Deadly 提交于 2019-12-18 18:49:54
问题 I would like to capture video from device’s back camera directly to ProRes codec, now that .proRes422 and .proRes4444 are available as AVVideoCodecType options in iOS 11. But I receive an error that recording is: unsupported given the current configuration On both iPhone X and second generation iPad Pro, when trying to capture video with the following code: movieFileOutput.setOutputSettings([AVVideoCodecKey: AVVideoCodecType.proRes422], for: movieFileOutputConnection!) If this approach is