Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess Images and Audio with AVFoundation
    primarykey
    data
    text
    <p>I am using AVFoundation for accessing images and audio for making video. Problem is when i am adding device for audio like.</p> <pre><code>AVCaptureDevice *audioDevice = [AVCaptureDevice defaultDeviceWithMediaType: AVMediaTypeAudio]; AVCaptureDeviceInput * microphone_input = [AVCaptureDeviceInput deviceInputWithDevice:audioDevice error:nil]; AVCaptureAudioDataOutput * audio_output = [[AVCaptureAudioDataOutput alloc] init]; [self.captureSession2 addInput:microphone_input]; [self.captureSession2 addOutput:audio_output]; dispatch_queue_t queue2; queue2 = dispatch_queue_create("Audio", NULL); [audio_output setSampleBufferDelegate:self queue:queue2]; dispatch_release(queue2); </code></pre> <p>and Camera for images.</p> <pre><code>AVCaptureDevice *cameraDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; //putting it on the input. AVCaptureDeviceInput *captureInput = [AVCaptureDeviceInput deviceInputWithDevice:cameraDevice error:nil]; //selecting the Output. AVCaptureVideoDataOutput *captureOutput = [[AVCaptureVideoDataOutput alloc] init]; [self.captureSession addInput:captureInput]; [self.captureSession addOutput:captureOutput]; dispatch_queue_t queue; queue = dispatch_queue_create("cameraQueue", 0); [captureOutput setSampleBufferDelegate:self queue:queue]; dispatch_release(queue); </code></pre> <p>and after all getting raw data through delegates</p> <pre><code>- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { if ([captureOutput isKindOfClass:[AVCaptureAudioDataOutput class]]) [self sendAudeoRaw:sampleBuffer]; if ([captureOutput isKindOfClass:[AVCaptureVideoDataOutput class]]) [self sendVideoRaw:sampleBuffer];} </code></pre> <p><strong>the speed of getting Images Raw data is very slow around 2 images per second. how can i improve it because i am looking around 10-12 images/second. please Help</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload