iOS - Automatically resize CVPixelBufferRef
问题 I am trying to crop and scale a CMSampleBufferRef based on user's inputs, on ratio , the below code takes a CMSampleBufferRef, convert it into a CVImageBufferRef and use CVPixelBuffer to crop the internal image based on its bytes. The goal of this process is to have a cropped and scaled CVPixelBufferRef to write to the video - (CVPixelBufferRef)modifyImage:(CMSampleBufferRef) sampleBuffer { @synchronized (self) { CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); //