简体   繁体   English

如何在 Windows 中使用 H264 视频编码器 MFT 编码位图

[英]how encode bitmap with H264 video encoder MFT in windows

My application do encoding of captured frame from GDI or DXGI method.我的应用程序从 GDI 或 DXGI 方法对捕获的帧进行编码。 currently i am doing encoding with help x264 library.目前我正在使用帮助 x264 库进行编码。
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. AFAIK x264 是基于软件的库,我想在 GPU 的帮助下进行编码,因此它可以节省 CPU 周期并希望速度也会更快。
After searching, I found a H.264 Video Encoder MFT which is doing h264 encoding.搜索后,我找到了一个H.264 Video Encoder MFT,它正在做 h264 编码。
But couple of questions are answered for me.但是我回答了几个问题。
1) is It faster than x264 encoding library? 1) 它比 x264 编码库快吗?
2) can bitmap frame be encoded with help this MFT? 2) 可以在此 MFT 的帮助下对位图帧进行编码吗?
- i have seen only MFVideoFormat_I420, MFVideoFormat_IYUV, MFVideoFormat_NV12, MFVideoFormat_YUY2, MFVideoFormat_YV12 these formats are supported - 我只看到 MFVideoFormat_I420、MFVideoFormat_IYUV、MFVideoFormat_NV12、MFVideoFormat_YUY2、MFVideoFormat_YV12 支持这些格式
3) is it hardware accelerated(mean it's using CPU or GPU)? 3)它是硬件加速的(意味着它使用的是 CPU 还是 GPU)?
- Initially my understanding was it uses GPU but i get confused after reading this post MFT Encoder (h264) High CPU utilization . - 最初我的理解是它使用 GPU,但在阅读这篇文章后我感到困惑MFT 编码器 (h264) 高 CPU 利用率
4) can H.264 Video Encoder MFT be used stand alone without using sink writer, as i have to sent data on network? 4) H.264 Video Encoder MFT 是否可以独立使用而不使用接收器编写器,因为我必须在网络上发送数据?
5) is there any other alternative in windows? 5)在windows中还有其他选择吗?

It might be some questions are very silly, please feel free to edit.可能有些问题很愚蠢,请随时编辑。

Media Foundation H.264 Video Encoder is software encoder. Media Foundation H.264 视频编码器是软件编码器。 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.根据我的 [主观] 体验,它比 x264 慢,也许更重要的是,x264 提供了更广泛的设置,特别是在选择速度超过质量范围的模式时。 Either way, stock MS encoder is not hardware accelerated.无论哪种方式,股票 MS 编码器都不是硬件加速的。

However, there might be other MFTs available (typically installed with respective hardware drivers) that do hardware accelerated H.264 encoding.但是,可能还有其他可用的 MFT(通常与相应的硬件驱动程序一起安装)进行硬件加速的 H.264 编码。 You can discover them by enumerating MFTs, perhaps most popular is Intel Quick Sync Video (QSV) Encoder.您可以通过枚举 MFT 来发现它们,也许最受欢迎的是 Intel Quick Sync Video (QSV) 编码器。

HardwareVideoEncoderTransform app does the enumeration and provides you with relevant details: HardwareVideoEncoderTransform应用程序会进行枚举并为您提供相关详细信息:

在此处输入图片说明

Typical input is NV12, some offer other input choices (such as eg 32-bit RGB).典型的输入是 NV12,有些提供其他输入选择(例如 32 位 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.硬件支持的编码器 CPU 消耗低,其效率取决于硬件实现。 Yes, you can use them standalone, entirely standalone or wrapped as DirectShow filter and included in normal DirectShow pipeline.是的,您可以独立、完全独立或包装为 DirectShow 过滤器并包含在正常的 DirectShow 管道中使用它们。

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.替代的 H.264 编码器通常基于 SDK,或者在 DirectShow/MFT 形式因素中封装这些 SDK,因为供应商以多媒体开发人员已经熟悉的众所周知的形式打包它们的实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM