avcapturesession

AVcapture session slow launch after session restart

本秂侑毒 提交于 2019-12-03 05:09:38
问题 I have a main view controller and that segues to a second view controller that has an avcapturesession. The first time I segue from the main view controller to the capture session controller, it takes about 50ms (checked using 'instruments'). Then I segue back to the main view controller from the capture session and then back to the avcapturesession controller from the main controller. Each time it takes longer to segue from the main view controller to the avcapturesession and by the 5th or

AVCaptureDevice Camera Zoom

和自甴很熟 提交于 2019-12-03 04:21:02
问题 I have a simple AVCaptureSession running to get a camera feed in my app and take photos. How can I implement the 'pinch to zoom' functionality using a UIGestureRecognizer for the camera? 回答1: The accepted answer is actually outdated and I'm not sure it will actually take the photo of the zoomed in image. There is a method to zoom in like bcattle answer says. The problem of his answer is that it does not take in charge the fact that the user can zoom in and then restart from that zoom position

Can I use AVCaptureSession to encode an AAC stream to memory?

我怕爱的太早我们不能终老 提交于 2019-12-03 03:59:10
问题 I'm writing an iOS app that streams video and audio over the network. I am using AVCaptureSession to grab raw video frames using AVCaptureVideoDataOutput and encode them in software using x264. This works great. I wanted to do the same for audio, only that I don't need that much control on the audio side so I wanted to use the built in hardware encoder to produce an AAC stream. This meant using Audio Converter from the Audio Toolbox layer. In order to do so I put in a handler for

Record Audio/Video with AVCaptureSession and Playback Audio simultaneously?

给你一囗甜甜゛ 提交于 2019-12-03 03:55:54
I'm trying to create an iOS app which can record audio and video while simultaneously outputting audio to the speakers. To do the recording and preview, I'm using AVCaptureSession , an AVCaptureConnection each for both video and audio, and an AVAssetWriterInput each for both video and audio. I basically achieved this by following the RosyWriter example code. Prior to setting up recording in this fashion, I was using AVAudioPlayer to play audio. Now, if I am in the middle of capturing (not even recording, just capturing for preview), and attempt to use AVAudioPlayer , my captureOutput callbacks

iOS 7 AVCaptureMetadataOutput delegate (QRCode scanner)

我的梦境 提交于 2019-12-03 03:25:35
问题 I'm trying to implement a QRCode scanner with the new iOS 7 features but my code isn't calling the main AVCaptureMetadataOutputObjectsDelegate method. I've used the AVFoundation camera before and with my current implementation I've got the preview layer running without a problem. Even switching my output back to AVCaptureVideoDataOutput validates my session setup. I'm using this NSHipster post as a guideline and here's my code so far: Interface: @import AVFoundation; @interface

Camera Freeze when open app while call is running

谁都会走 提交于 2019-12-03 03:25:29
I have created a camera using AVCaptureSession . I have configured that for both Photo and Video recording modes . Camera and App is running fine. Also I allowed background music play (If user play song using Music App in iPhone) while open camera or recording video. It is also working fine. (Attached image 2) I allowed background Music play with the help of this code AVAudioSession *session1 = [AVAudioSession sharedInstance]; [session1 setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionMixWithOthers|AVAudioSessionCategoryOptionDefaultToSpeaker

iOS AVCaptureSession - How to get/set the number of frames per second recorded?

拟墨画扇 提交于 2019-12-03 03:13:58
I'm new to AVCaptureSession and wish to better understand how to work with it. So I managed capturing the video stream as separated CIImages and convert them to UIImages. Now I wish to be able to get the number of Frames Per Second captured and preferably to be able to set it. Any idea how to do that? Ilanchezhian You could use AVCaptureConnection 's videoMinFrameDuration accessor to set the value. See the AVCaptureConnection documentation Consider output be AVCaptureVideoDataOutput object. AVCaptureConnection *conn = [output connectionWithMediaType:AVMediaTypeVideo]; if (conn

How to crop an image from AVCapture to a rect seen on the display

回眸只為那壹抹淺笑 提交于 2019-12-03 02:16:08
问题 This is driving me crazy because I can't get it to work. I have the following scenario: I'm using an AVCaptureSession and an AVCaptureVideoPreviewLayer to create my own camera interface. The interface shows a rectangle. Below is the AVCaptureVideoPreviewLayer that fills the whole screen. I want to the captured image to be cropped in a way, that the resulting image shows exactly the content seen in the rect on the display. My setup looks like this: _session = [[AVCaptureSession alloc] init];

ios/iphone photo burst mode api

南楼画角 提交于 2019-12-03 01:28:06
I'm trying to capture multiple photos on highest resolution(AVCaptureSessionPresetPhoto) on iPhone 5s. I tried using the following code: dispatch_semaphore_t sync = dispatch_semaphore_create(0); while( [self isBurstModeEnabled] == YES ) { [stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error) { if (imageSampleBuffer != NULL) { NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer]; NSString *videoThumbPath = [NSString stringWithFormat:@"%@/img%d.png",

AVAudioSession AVAudioSessionCategoryPlayAndRecord glitch

佐手、 提交于 2019-12-02 23:52:35
I would like to record videos with audio using AVCaptureSession . For this I need the AudioSessionCategory AVAudioSessionCategoryPlayAndRecord , since my app also plays back video with sound. I want audio to be audible from the default speaker and I want it to mix with other audio. So I need the options AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionMixWithOthers . If I do the following while other audio is playing there is a clear audible glitch in the audio from the other app: [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord