avcapturedevice

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

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

Show camera stream while AVCaptureSession's running

时间秒杀一切 提交于 2019-12-20 09:31:56
问题 I was able to capture video frames from the camera using AVCaptureSession according to http://developer.apple.com/iphone/library/qa/qa2010/qa1702.html. However, it seems that AVCaptureScreen captures frames from the camera without showing the camera stream on the screen. I would like to also show camera stream just like in UIImagePicker so that the user knows that the camera is being turned on and sees what the camera is pointed at. Any help or pointer would be appreciated! 回答1:

How do I record a video on iOS without using a preset?

大憨熊 提交于 2019-12-20 01:39:46
问题 The simpler way to record a video on iOS is by setting a AVCaptureSession.sessionPreset. But that doesn't work for me since I want to control parameters like binning, stabilization (cinematic, standard, or none) and ISO. I find the format I want and assign it to activeFormat, but when I try to start recording, I get an error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AVCaptureMovieFileOutput startRecordingToOutputFileURL:recordingDelegate:] No

AVAudioSession setCategory not working

有些话、适合烂在心里 提交于 2019-12-19 03:18:39
问题 I have a video capturing app and I want to be able to play background music while recording audio+video. I can accomplish this if I set the AVAudioSession category to PlayAndRecord in didFinishLaunchingWithOptions . However, this causes a glitch in the audio whenever the view with the camera enters or exits the foreground, and its apparently impossible to get rid of: https://forums.developer.apple.com/message/74778#74778 I can live with the glitch if it just happens when I start/stop

Why AVCaptureSession output a wrong orientation?

北城以北 提交于 2019-12-17 23:44:12
问题 So, I followed Apple's instructions to capture video session using AVCaptureSession : http://developer.apple.com/iphone/library/qa/qa2010/qa1702.html. One problem I'm facing is that even though the orientation of the camera / iPhone device is vertical (and the AVCaptureVideoPreviewLayer shows a vertical camera stream), the output image seems to be in the landscape mode. I checked the width and height of imageBuffer inside imageFromSampleBuffer: of the sample code, and I got 640px and 480px

Individual Access of Camera LED Lights of iPhone 5s

怎甘沉沦 提交于 2019-12-17 18:14:27
问题 I'm coding for the iPhone 5s and it now has two LED lights for the rear camera. I don't know the official LED color names, but one LED is white and the other LED is yellowish. Apple refers to this as "True Tone". I'm trying to access these camera LED lights individually. I believe this to be possible because when I access iOS7's control center (swipe up from bottom) and press the built-in flash light, only the white LED comes on. This is different from applying the torch light code below.

Accessing iOS 6 new APIs for camera exposure and shutter speed

我怕爱的太早我们不能终老 提交于 2019-12-17 06:33:28
问题 On Apple's iOS 6.0 feature page, it used to say Take advantage of the built-in camera’s advanced features. New APIs let you control focus, exposure, and region of interest. You can also access and display faces with face detection APIs, and leverage hardware-enabled video stabilization. This text has since been removed, and I can't find new methods in the API for controlling exposure. In class AVCaptureDevice under "Exposure Settings" there is no new property/method for iOS 6.0. Do you know

Turn on torch/flash on iPhone

若如初见. 提交于 2019-12-16 22:35:59
问题 I know that the only way to turn on the flash and keep it on on iPhone 4 is by turning the video camera on. I'm not too sure of the code though. Here is what I am trying: -(IBAction)turnTorchOn { AVCaptureSession *captureSession = [[AVCaptureSession alloc] init]; AVCaptureDevice *videoCaptureDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; NSError *error = nil; AVCaptureDeviceInput *videoInput = [AVCaptureDeviceInput deviceInputWithDevice:videoCaptureDevice error:&error

Check which camera is currently in use in iOS Application

会有一股神秘感。 提交于 2019-12-13 06:20:38
问题 I'm writing an app which has a custom made view for taking photos with the Camera, similar to Apple's AVCam. In it, I want to make a button disappear and re-appear for the flash icon every time the camera is switched. IE When using the front camera, the flash button shouldn't be there and when using the back it should! My code for this at the moment is: AVCaptureDevicePosition position = [[videoInput device] position]; if (position == AVCaptureDevicePositionBack) { self.flashButton.hidden ==