GOP setting is not honored by Intel H264 hardware MFT

后端 未结 1 1432
北海茫月
北海茫月 2020-12-06 07:19

Problem statement:

Intel hardware MFT is not honoring the GOP setting, resulting in more bandwidth consumption in realtime applications. The same co

相关标签:
1条回答
  • 2020-12-06 07:37

    Some miracle has happened. While also playing around with encoder configurations, I accidentally changed my primary monitor to a different one on my machine, now the problem is gone. Switching back to the previously selected primary monitor leads to the same problem. I suspect the d3ddevice to be the trouble maker. I'm not sure why this happens only on that device/monitor yet, have to experiment some more.

    Note: I'm not marking this as an answer due to the fact that I'm yet to find out the reason for the problem happening only on that monitor/d3ddevice. Just posting this as a reference for other people who may come across a similar situation. I will update the answer once I'm able to find the reason for the strange behavior on that particular d3d11device instance.

    This is how I'm creating the d3ddevice, and reusing the same for desktop duplication image capturer, video processor for color conversion and also for the hardware transform through MFT_MESSAGE_SET_D3D_MANAGER property.

    Options:

    const D3D_DRIVER_TYPE m_DriverTypes[] = {
    
        //Hardware based Rasterizer
        D3D_DRIVER_TYPE_HARDWARE,
    
        //High performance Software Rasterizer
        D3D_DRIVER_TYPE_WARP,
    
        //Software Rasterizer (Low performance but more accurate)
        D3D_DRIVER_TYPE_REFERENCE,
    
        //TODO: Explore other driver types
    };
    
    const D3D_FEATURE_LEVEL m_FeatureLevel[] = {
    
        D3D_FEATURE_LEVEL_11_1,
        D3D_FEATURE_LEVEL_11_0,
        D3D_FEATURE_LEVEL_10_1,
        D3D_FEATURE_LEVEL_10_0,
        D3D_FEATURE_LEVEL_9_3,
        D3D_FEATURE_LEVEL_9_2,
        D3D_FEATURE_LEVEL_9_1
    
        //TODO: Explore other features levels as well
    };
    
    int m_DriversCount = ARRAYSIZE(m_DriverTypes);
    int m_FeatureLevelsCount = ARRAYSIZE(m_FeatureLevel);
    

    Create d3ddevice:

    DWORD errorCode = ERROR_SUCCESS;
    
    if (m_FnD3D11CreateDevice == NULL)
    {
        errorCode = loadD3D11FunctionsFromDll();
    }
    
    if (m_Id3d11Device)
    {
        m_Id3d11Device = NULL;
        m_Id3d11DeviceContext = NULL;
    }
    
    UINT uiD3D11CreateFlag = (0 * D3D11_CREATE_DEVICE_SINGLETHREADED) | D3D11_CREATE_DEVICE_VIDEO_SUPPORT;
    
    if (errorCode == ERROR_SUCCESS)
    {
        if (m_FnD3D11CreateDevice) {
    
            for (UINT driverTypeIndex = 0; driverTypeIndex < m_DriversCount; ++driverTypeIndex)
            {
                m_LastErrorCode = D3D11CreateDevice(nullptr, m_DriverTypes[driverTypeIndex], nullptr, uiD3D11CreateFlag,
                    m_FeatureLevel, m_FeatureLevelsCount, D3D11_SDK_VERSION, &m_Id3d11Device, &m_SelectedFeatureLevel, &m_Id3d11DeviceContext);
    
                if (SUCCEEDED(m_LastErrorCode))
                {
                    break;
                }
            }
        }
    }
    
    0 讨论(0)
提交回复
热议问题