Reputation: 61
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
Upvotes: 6
Views: 739
Reputation: 3663
AVCaptureSession *mSession; ;
use session preset heigh instead of session preset photo
mSession.sessionPreset = AVCaptureSessionPresetHigh; //yes
mSession.sessionPreset = AVCaptureSessionPresetPhoto; //no
Upvotes: 1