我正在研究H.264解码器,我想知道在哪里可以找到SPS和PPS.我的参考文献告诉我那些是在H.264-Stream中编码的NAL单元,但是当我查看一个带有IsoViewer的示例-MP4-File时,它说SPS和PPS在avcC Box中.
这究竟是如何工作的?它如何查找.mkv文件或其他H.264容器?
提前致谢!
我正在尝试使用硬件支持的视频工具包解码器编写视频解码器.但是,如果我尝试初始化解码会话,如下面发布的示例,我在调用VTDecompressionSessionCreate时收到错误-8971.谁能告诉我这里做错了什么?
感谢你并致以真诚的问候,
奥利弗
OSStatus status;
int tmpWidth = sps.EncodedWidth();
int tmpHeight = sps.EncodedHeight();
NSLog(@"Got new Width and Height from SPS - %dx%d", tmpWidth, tmpHeight);
const VTDecompressionOutputCallbackRecord callback = { ReceivedDecompressedFrame, self };
status = CMVideoFormatDescriptionCreate(NULL,
kCMVideoCodecType_H264,
tmpWidth,
tmpHeight,
NULL,
&decoderFormatDescription);
if (status == noErr)
{
// Set the pixel attributes for the destination buffer
CFMutableDictionaryRef destinationPixelBufferAttributes = CFDictionaryCreateMutable(
NULL, // CFAllocatorRef allocator
0, // CFIndex capacity
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
SInt32 destinationPixelType = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
CFDictionarySetValue(destinationPixelBufferAttributes,kCVPixelBufferPixelFormatTypeKey, CFNumberCreate(NULL, kCFNumberSInt32Type, &destinationPixelType));
CFDictionarySetValue(destinationPixelBufferAttributes,kCVPixelBufferWidthKey, CFNumberCreate(NULL, kCFNumberSInt32Type, &tmpWidth)); …Run Code Online (Sandbox Code Playgroud)