Skip to main content

 none
How can I get the real resolution from the decoder in mft? RRS feed

  • Question

  • I am developing using a media foundation provided by Microsoft.
    The mft (media foundation transform) h264 decoder is used.
    There is a problem in getting the resolution when decoding hardware using d3d11.

    Get resolution value when output stream changes
    A stream that is 1920 * 1080 comes out as 1920 * 1088.
    I think this part of the hardware decoder has effectively converted to a multiple of 16.

    But I need a real resolution value of 1920 * 1080.
    Looking through the documentation doesn't seem to tell you how to get the actual resolution in this case.

    Is there anyone who can solve the problem?

      hr = mft_->GetInputCurrentType(0, &meida_type);
      CHECK_HR(hr, "mft->SetOutputType failed");

      width = 0, height = 0;
      hr = MFGetAttributeSize(meida_type, MF_MT_FRAME_SIZE, &width, &height);
      CHECK_HR(hr, "MFSetAttributeRatio(MF_MT_FRAME_SIZE) failed");
      meida_type->Release();

    Thursday, September 19, 2019 7:23 AM

All replies