[FFmpeg-devel] [PATCH] avcodec: Add MediaFoundation encoder wrapper

Martin Storsjö martin at martin.st
Tue May 12 13:01:51 EEST 2020


On Sun, 10 May 2020, Marton Balint wrote:

>
>
> On Sun, 10 May 2020, Martin Storsjö wrote:
>
>> From: wm4 <nfxjfg at googlemail.com>
>>
>> This contains encoder wrappers for H264, HEVC, AAC, AC3 and MP3.
>>
>> This is based on top of an original patch by wm4
>> <nfxjfg at googlemail.com>. The original patch supported both encoding
>> and decoding, but this patch only includes encoding.
>>
>> The patch contains further changes by Paweł Wegner
>> <pawel.wegner95 at gmail.com> (primarily for splitting out the encoding
>> parts of the original patch) and further cleanup, build compatibility
>> fixes and tweaks for use with Qualcomm encoders by Martin Storsjö.
>> ---
>> This allows access to the HW video encoder on Windows on ARM64
>> on Qualcomm platforms. However, to actually use that, one has to
>> manually choose nv12 as input pixel format, otherwise the encoder
>> format negotiation fails.
>>
>> I've tried to read up on the feedback this patch got the earlier
>> times it was posted and address those issues. In particular,
>> this is enabled automatically if suitable headers are available.
>> The built binary still runs on Vista (even if the required MF
>> functionality isn't available there).
>>
>> Building succeeds with MSVC, old and new mingw-w64 toolchains,
>> and isn't detected nor enabled on mingw.org toolchains. The configure
>> check looks for one of the API details used; mingw-w64 versions
>> from before that feature was added won't try to build the code,
>> while newer ones should have enough features to build it successfully.
>> ---
>> configure              |   11 +
>> libavcodec/Makefile    |    1 +
>> libavcodec/allcodecs.c |    5 +
>> libavcodec/mf_utils.c  |  677 +++++++++++++++++++++++
>> libavcodec/mf_utils.h  |  138 +++++
>> libavcodec/mfenc.c     | 1181 ++++++++++++++++++++++++++++++++++++++++
>> libavcodec/version.h   |    2 +-
>> 7 files changed, 2014 insertions(+), 1 deletion(-)
>> create mode 100644 libavcodec/mf_utils.c
>> create mode 100644 libavcodec/mf_utils.h
>> create mode 100644 libavcodec/mfenc.c
>
> Missing docs update.

Which one is mandatory here? I added a changelog entry locally now as wel. 
I guess it could have short general description in doc/encoders.texi, or 
does one have to duplicate the info about all the options as well?

// Martin


More information about the ffmpeg-devel mailing list