问题描述
我的应用程序对GDI或DXGI方法捕获的帧进行编码。目前我正在使用帮助x264库进行编码。AFAIK x264是基于软件的库,我想在GPU的帮助下进行编码,因此可以节省CPU周期,希望速度也会更快。 >
搜索后,我发现一个
典型输入是NV12,有些提供其他输入选择(例如32位RGB) 。如果需要其他格式,则必须对输入进行预转换。
硬件支持的编码器CPU占用率很低,其效率取决于硬件实现。是的,您可以使用它们独立的,完全独立的或包装的DirectShow过滤器,并包含在正常的DirectShow管道中。
替代的H.264编码器通常是基于SDK或包装器DirectShow / MFT中的这些SDK形式是因为供应商将其实现以多媒体开发人员熟悉的知名形式进行打包。
My application do encoding of captured frame from GDI or DXGI method. currently i am doing encoding with help x264 library.
AFAIK x264 is software based library, i want to do encoding with help of GPU, so it can save CPU cycles and hope speed also will be faster.
After searching, I found a H.264 Video Encoder MFT which is doing h264 encoding.
But couple of questions are answered for me.
1) is It faster than x264 encoding library?
2) can bitmap frame be encoded with help this MFT?
- i have seen only MFVideoFormat_I420, MFVideoFormat_IYUV, MFVideoFormat_NV12, MFVideoFormat_YUY2, MFVideoFormat_YV12 these formats are supported
3) is it hardware accelerated(mean it's using CPU or GPU)?
- Initially my understanding was it uses GPU but i get confused after reading this post MFT Encoder (h264) High CPU utilization.
4) can H.264 Video Encoder MFT be used stand alone without using sink writer, as i have to sent data on network?
5) is there any other alternative in windows?
It might be some questions are very silly, please feel free to edit.
Media Foundation H.264 Video Encoder is software encoder. From my [subjective] experience it slower than x264 and, perhaps more important, x264 offers wider range of settings, specifically when it comes to choose modes on the speed over quality end of the range. Either way, stock MS encoder is not hardware accelerated.
However, there might be other MFTs available (typically installed with respective hardware drivers) that do hardware accelerated H.264 encoding. You can discover them by enumerating MFTs, perhaps most popular is Intel Quick Sync Video (QSV) Encoder.
HardwareVideoEncoderTransform
app does the enumeration and provides you with relevant details:
Typical input is NV12, some offer other input choices (such as e.g. 32-bit RGB). If you need other formats, you will have to pre-convert the input.
Hardware backed encoders CPU consumption is low, and their efficiency depends on the hardware implementation. Yes, you can use them standalone, entirely standalone or wrapped as DirectShow filter and included in normal DirectShow pipeline.
Alternate H.264 encoders are typically SDK based, or wrappers over those SDKs in DirectShow/MFT form factors because vendors package their implementation in well-known forms already familiar to multimedia developers.
这篇关于如何在Windows中使用H264视频编码器MFT编码位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!