Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS:VideoToolBox解压缩h263视频异常_Ios_Video_Compression_Hardware Acceleration_Video Toolbox - Fatal编程技术网

iOS:VideoToolBox解压缩h263视频异常

iOS:VideoToolBox解压缩h263视频异常,ios,video,compression,hardware-acceleration,video-toolbox,Ios,Video,Compression,Hardware Acceleration,Video Toolbox,我正在使用VideoToolBox进行H263解压。但是在解码4CIF视频流时,输出的像素数据都是0值,并且没有错误信息 我不知道为什么会发生这种情况,因为CIF分辨率的视频流已正确解压缩 有人有同样的问题吗 这是我的一段代码: CMFormatDescriptionRef newFmtDesc = nil; OSStatus status = CMVideoFormatDescriptionCreate(kCFAllocatorDefault,

我正在使用VideoToolBox进行H263解压。但是在解码4CIF视频流时,输出的像素数据都是0值,并且没有错误信息

我不知道为什么会发生这种情况,因为CIF分辨率的视频流已正确解压缩

有人有同样的问题吗

这是我的一段代码:

CMFormatDescriptionRef newFmtDesc = nil;
OSStatus status = CMVideoFormatDescriptionCreate(kCFAllocatorDefault,
                                                 kCMVideoCodecType_H263,
                                                 width,
                                                 height,
                                                 NULL,
                                                 &_videoFormatDescription);
if (status)
{
   return -1;
}
CFMutableDictionaryRef dpba = CFDictionaryCreateMutable(kCFAllocatorDefault,
                                                        2,
                                                        &kCFTypeDictionaryKeyCallBacks,
                                                        &kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(dpba,
                     kCVPixelBufferOpenGLCompatibilityKey,
                     kCFBooleanFalse);
VTDictionarySetInt32(dpba,
                     kCVPixelBufferPixelFormatTypeKey,
                     kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange); // use NV12
VTDictionarySetInt32(dpba,
                     kCVPixelBufferWidthKey,
                     dimension.width);
VTDictionarySetInt32(dpba,
                     kCVPixelBufferHeightKey,
                     dimension.height);
VTDictionarySetInt32(dpba,
                     kCVPixelBufferBytesPerRowAlignmentKey,
                     dimension.width);// setup decoder callback record
VTDecompressionOutputCallbackRecord decoderCallbackRecord;
decoderCallbackRecord.decompressionOutputCallback = onDecodeCallback;
decoderCallbackRecord.decompressionOutputRefCon = this;// create decompression session
status = VTDecompressionSessionCreate(kCFAllocatorDefault,
                                      _videoFormatDescription,
                                      nil,
                                      dpba,
                                      &decoderCallbackRecord,
                                      &_session);
// Do Decode
CMSampleBufferRef sampleBuffer;
sampleBuffer = VTSampleBufferCreate(_videoFormatDescription, (void*)data_start, data_len, ts);
VTDecodeFrameFlags flags = 0;
VTDecodeInfoFlags flagOut = 0;
OSStatus decodeStatus = VTDecompressionSessionDecodeFrame(_session,
                                                              sampleBuffer,
                                                              flags,
                                                              nil,
                                                              &flagOut);

我尝试用VideoToolBox压缩H263,我以4CIF的分辨率插入会话,并将4CIF NV12图像推送到压缩会话,但H263流的输出是CIF分辨率

VideoToolBox是否不能支持4CIF H263视频的压缩和解压缩