Why did H.264, MPEG-4 HE AAC stop working on iphoneXS/Max?

吃可爱长大的小学妹 提交于 2019-12-05 10:33:55

This bug resolved itself for me in iOS13 beta release. Apple got back to me and informed me that the H264 header said that my video was version 4.0 but the first H264 frame says that it's 3.1, and iOS12 will not allow that.

I was able to fix this in code by specifying my header version as 3.1

I had a similar problem to this with black video on iPhone XS Max, and it turns out that I was setting the keys kCVPixelBufferCGImageCompatibilityKey and kCVPixelBufferCGBitmapContextCompatibilityKey to YES in the sourcePixelBufferAttributes dictionary when creating the AVAssetWriterInputPixelBufferAdaptor. Commenting out those two keys from the dictionary seems to have fixed the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!