Friday, 16 August 2013

How to set AVCaptureVideoDataOutput capture frame size?

How to set AVCaptureVideoDataOutput capture frame size?

I have a layerRect that show my camera's image like this:
CGRect layerRect = [[videoStreamView layer] bounds];
[[[self captureManager] previewLayer] setBounds:layerRect];
[[[self captureManager] previewLayer]
setPosition:CGPointMake(CGRectGetMidX(layerRect),
CGRectGetMidY(layerRect))];
[[videoStreamView layer] addSublayer:[[self captureManager] previewLayer]];
The videoStreamView is the view I show image. But when how can I match my
AVCaptureVideoDataOutput to get the image? I use setSampleBufferDelegate
from my AVCaptureVideoDataOutput, but the video frame I get is the whole
camera image. How can I modify it? Thanks.

No comments:

Post a Comment