locked
H265 DXVA2.0 fails RRS feed

  • Question

  • I am trying to use the DXVA 2.0 HEVC decoder (GPU is Geforce 1080 GTX) isolated (only transformation ,no renderer and no source object). Everything seems to be fine but after decoding 13 frames ProcessOutput returns E_FAIL. I guess the reason for that is a memory management issue, is there any step necessary besides calling “Release” on the returned sample (Part of MFT_OUTPUT_DATA_BUFFER)?

    Thanks in advance!

    Wednesday, July 27, 2016 9:13 AM

Answers

  • In the meantime I found the issue: I didn’t call MFStaratup.

    Sorry for wasting your time and thank you so much for your help.

    • Marked as answer by PsycoB Friday, August 12, 2016 7:23 AM
    Friday, August 12, 2016 7:23 AM

All replies

  • I can obtain a IMFDXGIBuffer implementing the ID3D11Texture2D Interface from the IMFMediaSample  (I am using DirectX 11). I think it is not freed correctly since there is no EVR connected. Is it possible at all to use a DXVA 2.0 Media Foundation Transformation wihtout an evr?
    Wednesday, August 10, 2016 3:10 PM
  • Use of EVR is not mandatory. Perhaps you have a sort of leak in your COM interface management and indeed it might so happen that when all allocated samples remain "in use" your streaming locks dead.

    http://alax.info/blog/tag/directshow

    Wednesday, August 10, 2016 7:22 PM
  • I see, thank you. Maybe you can give me a hint what needs to be done in order to release a sample besides releasing pSample (part of MFT_OUTPUT_DATA_BUFFER).

    Thursday, August 11, 2016 11:16 AM
  • I suppose you should post some code. Proper release is straightforward, but maybe you do it somehow wrong way.

    http://alax.info/blog/tag/directshow

    Thursday, August 11, 2016 11:26 AM
  • I tried to compile a minimal example, please let me know if this is enough:

    bool isDone = false;
    while (!isDone)
    {
    	DWORD pwdStatus = 0;
    	MFT_OUTPUT_DATA_BUFFER buffer;
    	memset(&buffer, 0, sizeof(buffer));
    
    	result = h265Decoder->ProcessOutput(0, 1, &buffer, &pwdStatus);
    
    	IMFCollection* events = buffer.pEvents;
    	if (events != nullptr) {
    		events->Release();
    	}
    
    	switch (result)
    	{
    	case MF_E_TRANSFORM_STREAM_CHANGE:
    		negotiate(h265Decoder);
    		break;
    	case MF_E_TRANSFORM_NEED_MORE_INPUT:
    		isDone = true;
    		break;
    	case S_OK:
    		buffer.pSample->Release();
    		break;
    	default:
    		{
    			throw std::exception(("proccessing output: " + std::to_string(result)).c_str());
    		}	
    	}
    }

    Thursday, August 11, 2016 12:01 PM
  • In the meantime I found the issue: I didn’t call MFStaratup.

    Sorry for wasting your time and thank you so much for your help.

    • Marked as answer by PsycoB Friday, August 12, 2016 7:23 AM
    Friday, August 12, 2016 7:23 AM