5

I am using AVFoundation framework to capture video with iPhone camera, my codes:

 self.session = [[AVCaptureSession alloc] init];
 ...
 self.output = [[AVCaptureVideoDataOutput alloc] init];
 [self.session addOutput:self.output];

Before [session addOutput], everything goes well, memory is limited to 3M, but after [session addOutput], memory usage increase 0.06M per second, after some minutes, the App will crash because of memory warning. AVCaptureVideoDataOutput seems cost too much memory, and maybe have a memory leak issue.

So how can i to reduce the memory usage?

iOS version: 7.1.1

Aloha Silver
  • 1,394
  • 16
  • 35

1 Answers1

0
AVCaptureSession *mSession; ;

use session preset heigh instead of session preset photo

mSession.sessionPreset = AVCaptureSessionPresetHigh; //yes

mSession.sessionPreset = AVCaptureSessionPresetPhoto; //no
Gajendra Rawat
  • 3,613
  • 2
  • 18
  • 36