avfoundation

captureOutput not being called

岁酱吖の 提交于 2019-12-01 04:22:25
I have been looking into this for way too long now. I am trying to get MacOS webcam data and run CIDetect on the frames that the webcam outputs. I know I need to: connect AVCaptureDevice (as in input to) into AVCaptureSession connect AVCaptureVideoDataOutput (as an output to) into AVCaptureSession call .setSampleBufferDelegate(AVCaptureVideoDataOutputSampleBufferDelegate, DelegateQueue) For some reason, after calling .setSampleBufferDelegate(...) (and of course after calling .startRunning() on the AVCaptureSession instance), my AVCaptureVideoDataOutputSampleBufferDelegate 's captureOutput is

Best way to access all movie frames in iOS

我与影子孤独终老i 提交于 2019-12-01 04:14:34
问题 Im trying to edit existing movie with added effects on top thus I need ability to scan all movie frames, get them as UIImage, apply effect and then either update that frame or write it into new movie. What I found is people suggesting to use AVAssetImageGenerator. Below is my final edited sample of how Im doing it: -(void)processMovie:(NSString*)moviePath { NSURL* url = [NSURL fileURLWithPath:moviePath]; AVURLAsset *asset=[[AVURLAsset alloc] initWithURL:url options:nil]; float

Switching AVCaptureSession preset when capturing a photo

会有一股神秘感。 提交于 2019-12-01 03:45:10
My current setup is as follows (based on the ColorTrackingCamera project from Brad Larson ): I'm using a AVCaptureSession set to AVCaptureSessionPreset640x480 for which I let the output run through an OpenGL scene as a texture. This texture is then manipulated by a fragment shader. I'm in need of this "lower quality" preset because I want to preserve a high framerate when the user is previewing. I then want to switch to a higher quality output when the user captures a still photo. First I thought I could change the sessionPreset on the AVCaptureSession but this forces the camera to refocus

didOutputSampleBuffer delegate not called

对着背影说爱祢 提交于 2019-12-01 03:34:09
问题 didOutputSampleBuffer function in my code was not called. I don't know why it happened. Here's the code: import UIKit import AVFoundation import Accelerate class ViewController: UIViewController { var captureSession: AVCaptureSession? var dataOutput: AVCaptureVideoDataOutput? var customPreviewLayer: AVCaptureVideoPreviewLayer? @IBOutlet weak var camView: UIView! override func viewWillAppear(animated: Bool) { super.viewDidAppear(animated) captureSession?.startRunning() //setupCameraSession() }

Record and play audio simultaneously in iOS

♀尐吖头ヾ 提交于 2019-12-01 03:33:22
I am trying to play the recorded content simultaneously while recording. Currently I am using AVAudioRecorder for recording and AVAudioPlayer for playing. When I was trying to play the content simultaneously nothing is playing. Please find the pseudo code for what I am doing. If I do the same stuff after stop the recording everything works fine. AVAudioRecorder *recorder; //Initializing the recorder properly. [recorder record]; NSError *error=nil; NSUrl recordingPathUrl; //Contains the recording path. AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:recordingPathUrl

Error '!dat' trying to set the (null) audio devices' sample rate

狂风中的少年 提交于 2019-12-01 03:24:34
问题 I am trying to play an audio clip (using AVAudioPlayer) and a video clip (using MPMoviePlayerController), both of which were working. I then checked the files into SVN and pulled them down on another Mac. Now when I run the app (iPad app) when it tries to play either the audio or video, both give the error: Error '!dat' trying to set the (null) audio devices' sample rate Figuring that SVN corrupted the files, (even though the Mac's QuickLook will play them fine), I replaced them with the

xcode - Add AVFountation Framework

你说的曾经没有我的故事 提交于 2019-12-01 03:17:31
问题 I'm creating an iphone app using xcode 4.2, and trying to use the AVFoundation Framework to play some radio stream. When i import it to the project's frameworks and the build, i get the following warning: ld: warning: ignoring file /Users/xanthos/Documents/tabbartest/AVFoundation.framework/AVFoundation, file was built for unsupported file format which is not the architecture being linked (i386) and of course when using anything of the framework (eg AVAudioSession) i get errors like: Undefined

Custom Camera zoom in/out while recording video using AVFoundation

核能气质少年 提交于 2019-12-01 02:04:53
问题 In the latest iOS 7.1 the native camera app can zoom in/out while recording video, and the video saved in the Photos indeed shows the zoom in/out effect. now, I am using AVFoundation to implement custom Video. I can zoom in/out while recording video by using videoMaxScaleAndCropFactor to modify AVCaptureVideoPreviewLayer. However, the saved video doesn't show the zoom in/out effect. Is there any hint to implement this function ???? 回答1: Try this: float zoomLevel = 2.0f; float zoomRate = 2.0f;

ios AVCaptureVideoPreviewLayer capture current image

做~自己de王妃 提交于 2019-12-01 01:50:06
Once the default iPhone Camera app takes a photo, a preview appears and the image animates to the camera roll button. I am trying to replicate this animation. session = [[AVCaptureSession alloc] init]; session.sessionPreset = AVCaptureSessionPresetPhoto; CALayer *viewLayer = self.vImagePreview.layer; NSLog(@"viewLayer = %@", viewLayer); captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:session]; captureVideoPreviewLayer.frame = CGRectMake(0, 0, 322, 425); [self.vImagePreview.layer addSublayer:captureVideoPreviewLayer]; device = [AVCaptureDevice

captureOutput not being called

你。 提交于 2019-12-01 01:47:14
问题 I have been looking into this for way too long now. I am trying to get MacOS webcam data and run CIDetect on the frames that the webcam outputs. I know I need to: connect AVCaptureDevice (as in input to) into AVCaptureSession connect AVCaptureVideoDataOutput (as an output to) into AVCaptureSession call .setSampleBufferDelegate(AVCaptureVideoDataOutputSampleBufferDelegate, DelegateQueue) For some reason, after calling .setSampleBufferDelegate(...) (and of course after calling .startRunning()