Change #265168
| Category | ffmpeg |
| Changed by | Ashrit Shetty <ashrit.shetty@microsoft.com> |
| Changed at | Wed 22 Apr 2026 09:48:24 |
| Repository | https://git.ffmpeg.org/ffmpeg.git |
| Project | ffmpeg |
| Branch | master |
| Revision | 9acd820732f0bf738bd743bbde6a5c3eadc216c2 |
Comments
avcodec/mfenc: populate video input type with size, rate, interlace mf_encv_input_adjust() currently only validates the pixel format and otherwise leaves the input IMFMediaType unchanged. The Microsoft H.264, H.265 and AV1 encoder MFTs tolerate this and internally infer the missing attributes from the previously-set output type. Other MediaFoundation encoder MFTs that follow the specification more strictly reject the input type with MF_E_INVALIDMEDIATYPE (due to MF_E_ATTRIBUTENOTFOUND on MF_MT_FRAME_SIZE / MF_MT_FRAME_RATE) when those attributes are absent, which causes IMFTransform::SetInputType to fail and aborts encoding. Set MF_MT_FRAME_SIZE, MF_MT_FRAME_RATE and MF_MT_INTERLACE_MODE on the input media type, mirroring what mf_encv_output_adjust() already writes to the output type. Behaviour on the Microsoft MFTs is unchanged (they were already using these values) and encoding now works with stricter third-party MFTs. The MF_MT_FRAME_SIZE assignment has been present but commented out since the original MediaFoundation wrapper was added in 050b72ab5e. Signed-off-by: Ashrit Shetty <ashritshetty@microsoft.com> Signed-off-by: Martin Storsjö <martin@martin.st>
Changed files
- libavcodec/mfenc.c