Gaojin Hsu Gaojin Hsu - 1 month ago 21
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


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