Отвечая на мой вопрос:
CVImageBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
CVPixelBufferLockBaseAddress(pixelBuffer, 0);
// access the data
int width = CVPixelBufferGetWidth(pixelBuffer);
int height = CVPixelBufferGetHeight(pixelBuffer);
unsigned char *rawPixelBase = (unsigned char *)CVPixelBufferGetBaseAddress(pixelBuffer);
// Do something with the raw pixels here
// ...
// Fill in the AVFrame
CVPixelBufferUnlockBaseAddress(pixelBuffer, 0);
AVFrame *pFrame;
pFrame = avcodec_alloc_frame();
avpicture_fill((AVPicture*)pFrame, rawPixelBase, PIX_FMT_RGB32, width, height);
Теперь pFrame
заполняется содержимым буфера семплов, который использует пиксельный формат kCVPixelFormatType_32BGRA
.
Это решило мою проблему. Спасибо.