本文介绍了VideoToolbox无法正确解码MFT编码的H264的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人遇到VideoToolbox无法正确解码Media Foundation Transform(MFT)编码的H264的问题?解码帧的绿色块失真超过帧的一半.我尝试了 Livy Stork的示例来解码MFT编码的H264,它是通过网络从Windows 7桌面上运行的PC视频终结点通过网络传输的.我正在使用Xcode 6.3并在iOS 8设备上运行它.

Did anyone experience an issue where VideoToolbox can't decode Media Foundation Transform (MFT) encoded H264 properly? The decoded frame has green block distortion more than half of the frame. I tried Livy Stork's example for decoding MFT encoded H264, which is transmitted over network from PC video endpoint running on Windows 7 desktop. I'm using Xcode 6.3 and running it on iOS 8 devices.

提示:当MFT编码的H264来自运行在Windows 8或8.1台式机/平板电脑上的PC视频端点时,相同的算法可以正常工作.根据 MSDN ,Windows 7不支持大多数编解码器属性,但我无法弄清楚哪个属性会有所不同...

Clue: Same algorithm works fine when MFT encoded H264 comes from PC video endpoint running on Windows 8 or 8.1 desktop/tablet. According to MSDN, most codec properties aren't supported in Windows 7, but I can't figure it out which property makes the difference...

推荐答案

但是,如果您替换所有NALU的所有开始代码,它应该可以工作.我已经成功解决了一个问题,即当它们以4个字节的起始代码开始然后以8个字节的3个字节开始代码开始时,使用视频工具箱对具有多个I切片或多个p切片的数据数组进行解码.只需将每个起始代码分别替换为切片长度即可.请注意,分片长度不包括起始代码长度,您应该忽略它们.

But if you replace all the start code of all the NALUs, it should work. I have successfully solved a problem that using Video Toolbox to decode a data array with multiple I slices or multiple p slice when they start with 4 bytes start code then following 8 slice with 3 bytes start code. Just replace every start code with slice length respectively. Note that slice length doesn't include start code length, you should ignore them.

这篇关于VideoToolbox无法正确解码MFT编码的H264的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-13 21:15