MFT Encoder (h264) High CPU utilization

ⅰ亾dé卋堺 提交于 2019-12-01 22:04:24
Jeff

The first key is to ensure you have configured the sink with MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS. I also set the MF_LOW_LATENCY attribute.

// error checking omitted for brevity
hr = attributes->SetUINT32(MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS, TRUE);
hr = attributes->SetUINT32(MF_SINK_WRITER_DISABLE_THROTTLING, TRUE);
hr = attributes->SetUINT32(MF_LOW_LATENCY, TRUE);

The other key is to ensure you are selecting the native format for the output of the source. Otherwise, you will remain very disappointed. I describe this in detail here.

I should also mention that you should consider creating the transform sample and memory buffer once at the beginning, instead of recreating them on each sample received.

Good luck. I hope this helps.

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