Gaojin Hsu Gaojin Hsu - 3 days ago 4
iOS Question

How to rotate 90 and return a new CMSampleBufferRef?

I set

AVCaptureVideoDataOutput
like this, and how to rotate 90 in the callback function?

AVCaptureVideoDataOutput *outDevice = [[AVCaptureVideoDataOutput alloc]init];
NSDictionary *vSetting = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange] ,(id)kCVPixelBufferPixelFormatTypeKey,nil];
outDevice.videoSettings = vSetting ;


- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
{
//rotate 90 degree

// deal with the new samplebuffer
}

Answer

I find GPUImage is very helpful to deal with image things.

Comments