title: How to create IMFSample from D11 texture for Intel MFT encoder
body: <p>I want to encode video using the "Intel® Quick Sync Video H.264 Encoder MFT".
  If I create IMFSample from system buffers, it works well. Just like following:</p>
  
  <pre><code>IMFMediaBuffer *pBuffer = NULL;
  MFCreateMemoryBuffer(cbSize, &amp;pBuffer);
  BYTE *pData = NULL;
  pBuffer-&gt;Lock(&amp;pData, NULL, NULL);
  memcpy(pData, bufferIhaveinYYYYUV format, buffer size);
  pBuffer-&gt;Unlock();
  IMFSample *pSample = NULL;
  MFCreateSample(&amp;pSample);
  pSample-&gt;AddBuffer(pBuffer);
  </code></pre>
  
  <p>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.</p>
  
  <p>Am I doing something wrong?</p>