Gaojin Hsu Gaojin Hsu - 1 year ago 266
iOS Question

How to rotate 90 and return a new CMSampleBufferRef?

I set

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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download