none
EVR: Minimal video decode overhead when video not visible. RRS feed

  • Question

  • Hi,
    Trying to keep a video running even when not visible but want decode overhead minimal when it can't be seen.

    From your sample EVR :

    https://github.com/pauldotknopf/WindowsSDK7-Samples/blob/master/multimedia/mediafoundation/evrpresenter/Presenter.cpp

    ... the code that does the frame decode seems to be :

    // ------------------------------------------------------------------------------------------------------------
    dataBuffer.dwStreamID = 0;
    dataBuffer.pSample = pSample;
    dataBuffer.dwStatus = 0;
    hr = m_pMixer->ProcessOutput(0, 1, &dataBuffer, &dwStatus);

    // ------------------------------------------------------------------------------------------------------------

    This performs a full frame decode. What should I do if (not_visible) to keep everything running smoothly please.

    Have tried skipping the ProcessOutput but that buffers samples so need to be able to discard them somehow.

    This : https://docs.microsoft.com/en-us/windows/desktop/api/mftransform/ns-mftransform-_mft_output_data_buffer

    ... says MFT_PROCESS_OUTPUT_DISCARD_WHEN_NO_BUFFER & set pSample above to null but that requires the output stream to have MFT_OUTPUT_STREAM_DISCARDABLE or MFT_OUTPUT_STREAM_LAZY_READ flag set, which I can read but not write.

    So unclear how to skip unseen video frames (we're rendering in 3D, so sometimes you see it sometimes you don't but want audio to continue & everything to sync as it should).

    Thanks in advance for any guidance. Have searched for sample code but have been unable to identify anything performing this function.

    Can't pause as that breaks flow. Need audio to keep going as you can hear even when you can't see.
    Tuesday, August 28, 2018 4:53 PM

All replies

  • Thanks.

    That's pretty much the conclusion I came to. Delivery isn't a hit, decode is, but without decode, we get glitches due to skipped keyframes.

    hmmm.

    So for now, decode, visible or not seems to be the best we can do which is disappointing as there's a nice optimisation in there somewhere.
    Tuesday, August 28, 2018 6:14 PM