How to extract motion vectors from H.264 AVC CMBlockBufferRef after VTCompressionSessionEncodeFrame

一世执手 提交于 2019-12-06 13:51:53

问题


I'm trying read or understand CMBlockBufferRef representation of H.264 AVC 1/30 frame.

The buffer and the encapsulating CMSampleBufferRef is created by using VTCompressionSessionRef.
https://gist.github.com/petershine/de5e3d8487f4cfca0a1d

H.264 data is represented as AVC memory buffer, CMBlockBufferRef from the compressed sample.

Without fully decompressing again, I'm trying to extract motion vectors or predictions from this CMBlockBufferRef.
I believe that for the fastest performance, byte-by-byte reading from the data buffer using CMBlockBufferGetDataPointer() should be necessary.

However, I'm having trouble finding the right way to read the data buffer, with the intention to find and extract motion vectors or predictions.

Is there no way at all, without decompressing, or using ffmpeg?

来源:https://stackoverflow.com/questions/33407273/how-to-extract-motion-vectors-from-h-264-avc-cmblockbufferref-after-vtcompressio

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