avcapturesession

Simplified screen capture: record video of only what appears within the layers of a UIView?

风格不统一 提交于 2019-11-28 02:06:15
This SO answer addresses how to do a screen capture of a UIView . We need something similar, but instead of a single image, the goal is to produce a video of everything appearing within a UIView over 60 seconds -- conceptually like recording only the layers of that UIView , ignoring other layers. Our video app superimposes layers on whatever the user is recording, and the ultimate goal is to produce a master video merging those layers with the original video. However, using AVVideoCompositionCoreAnimationTool to merge layers with the original video is very, very, very slow: exporting a 60

Using vibrate and AVCaptureSession at the same time

时光毁灭记忆、已成空白 提交于 2019-11-27 23:30:54
问题 I'm trying to vibrate the phone while recording video, but I'm finding that AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); doesn't play nicely with AVCaptureSession . Is there any other way to vibrate the phone or am I stuck with losing the vibrate function while recording video? 回答1: You probably need to set the audio to mix with other, I found this useful: - (void)setupAudio { [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil]; UInt32

AVFoundation camera tutorial [closed]

淺唱寂寞╮ 提交于 2019-11-27 20:49:05
问题 Is there a basic tutorial for the AVFoundation for use with the camera anywhere? UIImagePicker isn't the right tool for my app and it looks like this is but I'm not sure how to get it going. I can kind of see how to take a picture using AVCaptureStillImageOutput but I can't see how to display the camera view onto the screen. Any help is much appreciated. Thanks Oliver 回答1: If you're a registered Apple developer, session 409 (in the Graphics and Media section) of this year's WWDC is a very

Focus (Autofocus) not working in camera (AVFoundation AVCaptureSession)

两盒软妹~` 提交于 2019-11-27 20:17:44
I am using standard AVFoundation classes to capture video and show preview ( http://developer.apple.com/library/ios/#qa/qa1702/_index.html ) Here is my code: - (void)setupCaptureSession { NSError *error = nil; [self setCaptureSession: [[AVCaptureSession alloc] init]]; self.captureSession.sessionPreset = AVCaptureSessionPresetMedium; device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; if ([device isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus] && [device lockForConfiguration:&error]) { [device setFocusMode:AVCaptureFocusModeContinuousAutoFocus]; [device

AVCaptureSession specify resolution and quality of captured images obj-c iphone app

社会主义新天地 提交于 2019-11-27 20:14:54
Hi I want to setup AV capture session to capture images with specific resolution (and, if possible, with specific quality) using iphone camera. here's setupping AV session code // Create and configure a capture session and start it running - (void)setupCaptureSession { NSError *error = nil; // Create the session self.captureSession = [[AVCaptureSession alloc] init]; // Configure the session to produce lower resolution video frames, if your // processing algorithm can cope. We'll specify medium quality for the // chosen device. captureSession.sessionPreset = AVCaptureSessionPresetMedium; //

iOS: camera orientation

拈花ヽ惹草 提交于 2019-11-27 17:47:30
问题 I want to capture an image with the camera using AVCaptureSession. It works ok, I start the camera and I can get the output. However, I have some problems with video orientation when I rotate the device. First, I want to support landscape left and right orientations and may be portrait modes too later. I implement: - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation{ return UIInterfaceOrientationIsLandscapse(interfaceOrientation); } When I rotate the

How to capture picture with AVCaptureSession in Swift?

眉间皱痕 提交于 2019-11-27 17:36:34
I have a UIViewController in which I use AVCaptureSession to show the camera and it is working just fine and fast. I placed a UIButton object on top of this camera view and added a IBAction for the button. This is how it looks like right now: Now I want to get the picture of the current camera view when the user taps the button: @IBAction func takePicture(sender: AnyObject) { // omg, what do do?! } I have no idea whatsoever on how I can do that. I imagined there could have been something like: let captureSession = AVCaptureSession() var myDearPicture = captureSession.takePicture() as UIImage /

Method to find device's camera resolution iOS

爷,独闯天下 提交于 2019-11-27 17:32:47
Whats the best method to find the image resolution going to be captured using setting AVCaptureSessionPresetPhoto . I am trying to find the resolution before capturing the image. With the function below, you can programmatically get the resolution from activeFormat before capture begins, though not before adding inputs and outputs: https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/index.html#//apple_ref/occ/instp/AVCaptureDevice/activeFormat private func getCaptureResolution() -> CGSize { // Define default resolution var resolution = CGSize

AVCaptureVideoPreviewLayer (camera preview) freezes/stuck after moving to background and back

一个人想着一个人 提交于 2019-11-27 17:24:52
问题 Cant figure this one out. Everything works fine when the app is active, and than sometimes when i move the app to the background(pressing the home button) and than going back, the previewlayer freezes/stuck. Im using viewWillAppear and viewDidAppear for the set up. This is how i set everything up : var backCamera = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) var global_device : AVCaptureDevice! var captureSession: AVCaptureSession? override func viewWillAppear(animated: Bool) {

Capturing Images from AVCaptureSession

▼魔方 西西 提交于 2019-11-27 14:15:45
问题 I am learning about AVCaptureSession and how to capture multiple images with its delegate method - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection My goal is to capture 1 or many images with a predefined rate per second. For example, 1 or 2 images per 1 second. So I set AVCaptureVideoDataOutput *captureOutput = [[AVCaptureVideoDataOutput alloc] init]; captureOutput