avcapturesession

How to calculate FOV?

和自甴很熟 提交于 2019-11-30 01:35:11
Initial Context I am developping an augmented reality application location based and I need to get the field of view [FOV] (I just update the value when the orientation change, so I am looking for a method which can get this value when I call it) The goal is to make a "degree ruler" relevant to reality like the following: I am already using AVCaptureSession to display camera stream ; and a path coupled with a CAShapeLayer to draw the ruler. This is working pretty good, but now I have to use Field of view value to place my element in the right place (choose the right space between 160° and 170°

iOS 8 iPad AVCaptureMovieFileOutput drops / loses / never gets audio track after 13 - 14 seconds of recording

▼魔方 西西 提交于 2019-11-30 01:03:49
问题 I have the following code which works for iOS 6 & 7.x. In iOS 8.1 I have a strange issue where if you capture a session for about 13 seconds or longer, the resulting AVAsset only has 1 track (video), the audio track is just not there. If you record for a shorter period the AVAsset has 2 tracks (video and audio) as expected. I have plenty of disk space, the app has permission to use camera and microphone. I created a new project with minimal code, it reproduced the issue. Any ideas would be

Allows music playback during recording video like snapchat ios

天涯浪子 提交于 2019-11-30 00:51:38
First I want to discuss the scenario happening in snapchat . In snapchat when you start recording video and song is running in background; It allows continue that song while recording video and after you record that video you can also able to hear that song in background. I am using SCRecorder for recording video and capture image with my custom layout . Now in that I want to do just like above scenario but problem is whenever I start recording the video in background song is stopped playing. SCRecorder is using AVCaptureSession for recording video. So how can I resolve this two problem: Allow

AVCaptureSession - Stop Running - take a long long time

与世无争的帅哥 提交于 2019-11-29 23:13:07
问题 I use ZXing for an app, this is mainly the same code than the ZXing original code except that I allow to scan several time in a row (ie., the ZXingWidgetController is not necesseraly dismissed as soon as something is detected). I experience a long long freeze (sometimes it never ends) when I press the dismiss button that call - (void)cancelled { // if (!self.isStatusBarHidden) { // [[UIApplication sharedApplication] setStatusBarHidden:NO]; // } [self stopCapture]; wasCancelled = YES; if

What is the role of AVCaptureDeviceType.builtInDualCamera

廉价感情. 提交于 2019-11-29 22:55:15
问题 I am playing with swift and an iPhone 7 Plus. I am working with builtInWideAngleCamera and builtInTelephotoCamera. This is great, even if i cannot get the 2 images simultaneously. I saw in apple documentation that AVCaptureDeviceType contains a builtInDualCamera entry. What is the purpose of this device in avfoundation, because we cannot do anything (zoom, depth effect) with apple API ? In other word, i cannot see the difference between builtInDualCamera and builtInWideAngleCamera when

AVCapture capturing and getting framebuffer at 60 fps in iOS 7

那年仲夏 提交于 2019-11-29 19:55:11
I'm developping an app which requires capturing framebuffer at as much fps as possible. I've already figured out how to force iphone to capture at 60 fps but - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection method is being called only 15 times a second, which means that iPhone downgrades capture output to 15 fps. Has anybody faced such problem? Is there any possibility to increase capturing frame rate? Update my code: camera = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo

Dot Product and Luminance/ Findmyicone

帅比萌擦擦* 提交于 2019-11-29 16:38:45
All, I have a basic question that I am struggling with here. When you look at the findmyicone sample code from WWDC 2010, you will see this: static const uint8_t orangeColor[] = {255, 127, 0}; uint8_t referenceColor[3]; // Remove luminance static inline void normalize( const uint8_t colorIn[], uint8_t colorOut[] ) { // Dot product int sum = 0; for (int i = 0; i < 3; i++) sum += colorIn[i] / 3; for (int j = 0; j < 3; j++) colorOut[j] = (float) ((colorIn[j] / (float) sum) * 255); } And then it is called: normalize(orangeColor, referenceColor); Running the debugger, it is converting BGRA: (Red

How can I get autofocus to work in a second AVCaptureSession without recreating the sessions?

只谈情不闲聊 提交于 2019-11-29 15:40:11
问题 Autofocus is not working on the first AVCaptureSession when I create a second AVCaptureSession. The second session to be created is the one where autofocus works and the first created one does not autofocus. I would expect that either session would be able to auto focus when started after the other one is stopped in the same way the auto white balance and auto exposure work for both sessions. If you observe the log window with the sample code below you can see the key-value-observing messages

iOS: captureOutput:didOutputSampleBuffer:fromConnection is NOT called

徘徊边缘 提交于 2019-11-29 15:34:59
问题 I want to pull frames from the live-feed of AVCaptureSession and I am using Apple's AVCam as a test case. Here is the link to AVCam: https://developer.apple.com/library/ios/samplecode/AVCam/Introduction/Intro.html I found that that captureOutput:didOutputSampleBuffer:fromConnection is NOT called and I would like to know why or what I am doing wrong. Here is what I have done: (1) I make the AVCamViewController a delegate @interface AVCamViewController () <AVCaptureFileOutputRecordingDelegate,

AVCaptureSession cancels background audio

ε祈祈猫儿з 提交于 2019-11-29 14:55:47
问题 Whenever I start an AVCaptureSession running with the microphone as an input it cancels whatever background music is currently running (iPod music for instance). If I comment out the line adding the audio input, the background audio continues. Does anyone know of a way to record video clips with the microphone while continuing to allow background audio to play? I've looked around a lot, and can't seem to find any references to this behavior. Thanks for any help! 回答1: Try setting