1

I want to encode video using the "Intel® Quick Sync Video H.264 Encoder MFT". I'm using the MFT manually, without using a paired decoder MFT, or any other MediaFoundation components. Feeding normal buffers (IMFSamples with buffers created by MFCreateAlignedMemoryBuffer) works well.

Now I'm investigating whether I can feed it ID3D11Texture2D surfaces as input (DXGI_FORMAT_NV12, 1280x720) in order to improve performance. I tried to pass IMFSample instances created with MFCreateVideoSampleFromSurface or MFCreateDXGISurfaceBuffer to IMFTransform::ProcessInput and made multiple experiments (trying different texture creation flags), but the best result was that all input samples were accepted, but no output samples produced. In case it matters, I never actually tried uploading data to the textures, assuming this would not make a difference from textures filled with garbage pixel data.

Am I doing something wrong? Is this a bug in the Intel MFT? Is it just not supported?

Tao Mark
  • 31
  • 2
  • I think you shoud create your samples via an IMFVideoSampleAllocatorEx: https://msdn.microsoft.com/en-us/library/windows/desktop/hh448076(v=vs.85).aspx. Or your texture should have D3D11_BIND_DECODER flag specified during its creaion. – VuVirt Apr 15 '17 at 10:55
  • You should also check if the intel encoder changes its output type after the first sample, i.e. MF_E_TRANSFORM_STREAM_CHANGE. – VuVirt Apr 15 '17 at 11:41
  • You should also set an IMFDXGIManager to the encoder via a call to ProcessMessage with MFT_MESSAGE_SET_D3D_MANAGER. – VuVirt Apr 15 '17 at 11:46
  • Possible duplicate of [How to create IMFSample from D11 texture for Intel MFT encoder](http://stackoverflow.com/questions/43432670/how-to-create-imfsample-from-d11-texture-for-intel-mft-encoder) – Roman R. Apr 16 '17 at 07:09
  • After using MFT_MESSAGE_SET_D3D_MANAGER message, It works well. More details, Please refer to http://stackoverflow.com/questions/43432670/how-to-create-imfsample-from-d11-texture-for-intel-mft-encoder/43434705#43434705 – Tao Mark Apr 18 '17 at 08:05
  • @TaoMark, I'm also facing the same problem as yours. The encoder doesn't complain about any errors, but I'm getting just a green screen at the decoder end. https://stackoverflow.com/questions/58503662/getting-green-screen-in-ffplay-streaming-desktop-directx-surface-as-h264-vide Could you please direct me to any samples? – iamrameshkumar Nov 01 '19 at 19:37

0 Answers0