Media Foundation Custom Topology E_FAIL

0

I'm trying to create a Media Foundation topology. The topology captures/decodes a video stream, overlays a d3d9 surface with a custom transform, then both displays the video and saves it to a file.

Topology Diagram

The source video is 1080P MPEG4/H264 and so is the destination. The custom transform currently supports both NV12 and YUY2, and is almost identical to the MFT_Grayscale sample code. None of the nodes return errors when their media types are manually set. I've also verified that the encoder, decoder, and EVR support NV12 and YUY2. (I checked DXVA for EVR, and the standard MSFT dec/enc support both formats and accept the types through MFTEnum and SetOutputType).

The problem is that I just can't get a complete working topology without removing the file output or the transform. Trying to start the topology fails with E_FAIL whether I have topology resolution enabled or not.

One cause I've considered is that the decoder actually spits out 1920 x 1088 because of MPEG rounding. I can't manually set the formats to 1088 because the encoders/decoders will fail in SetOutputType if their input resolution is different from their output resolution. However, this current topology doesn't survive long enough for the topoloader to change the resolution to 1088 so there's probably another issue.

If you have any advice or ideas, I'd appreciate your input.

Topology Construction:

HRESULT VideoPipeline::CreateRecordTopology(
    IMFPresentationDescriptor *pPD,   // Presentation descriptor.
    LPCWSTR pFilename,                // Destination file.
    IMFTopology **ppTopology)         // Receives a pointer to the topology.
{
    HRESULT hr = S_OK;
    CComPtr<IMFMediaType> pPipelineType;
    CComPtr<IMFTopology> pTopology;
    CComPtr<IMFStreamSink> pFileSink;
    CComPtr<IMFStreamSink> pPreviewSink;
    CComPtr<IMFTransform> pOverlayTransform;
    CComPtr<IMFTransform> pDeinterlaceTransform;
    CComPtr<IMFTopologyNode> pSourceNode;
    CComPtr<IMFTopologyNode> pDecodeNode;
    CComPtr<IMFTopologyNode> pOverlayNode;
    CComPtr<IMFTopologyNode> pTeeNode;
    CComPtr<IMFTopologyNode> pOutputNode;
    CComPtr<IMFTopologyNode> pEncodeNode;
    CComPtr<IMFTopologyNode> pFileNode;
    BOOL fSelected = FALSE;
    DWORD cSourceStreams = 0;
    DWORD i = -1;

    *ppTopology = nullptr;

    // Create a new topology.
    IFR(MFCreateTopology(&pTopology));
    IFR(pTopology->SetUINT32(MF_TOPOLOGY_DXVA_MODE, MFTOPOLOGY_DXVA_FULL));
    IFR(pTopology->SetUINT32(MF_TOPOLOGY_HARDWARE_MODE, MFTOPOLOGY_HWMODE_USE_HARDWARE));

    // Get the number of streams in the media source.
    IFR(pPD->GetStreamDescriptorCount(&cSourceStreams));

    // For each stream, create the topology nodes and add them to the topology.
    for (i = 0; i < cSourceStreams; i++)
    {
        CComPtr<IMFStreamDescriptor> pSD;
        IFR(pPD->GetStreamDescriptorByIndex(i, &fSelected, &pSD));

        if (fSelected)
        {
            GUID guidMajorType;
            CComPtr<IMFMediaTypeHandler> pHandler;
            CComPtr<IMFMediaType> pInputType, pOutputType, pPipelineType;
            IFR(pSD->GetMediaTypeHandler(&pHandler));

            IFR(pHandler->GetMajorType(&guidMajorType));
            if (guidMajorType != MFMediaType_Video)
            {
                pPD->DeselectStream(i);
                continue;
            }

            IFR(pHandler->GetCurrentMediaType(&pInputType));

            // Create the NV12 media type for the pipeline based on the input format
            IFR(MFCreateMediaType(&pPipelineType));
            IFR(pPipelineType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video));
            IFR(pPipelineType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_NV12));
            IFR(pPipelineType->SetUINT32(MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE));
            IFR(pPipelineType->SetUINT32(MF_MT_COMPRESSED, FALSE));
            IFR(pPipelineType->SetUINT32(MF_MT_YUV_MATRIX, MFVideoTransferMatrix_BT709));
            IFR(pPipelineType->SetUINT32(MF_MT_VIDEO_PRIMARIES, MFVideoPrimaries_BT709));
            IFR(CopyAttribute(pInputType, pPipelineType, MF_MT_INTERLACE_MODE));
            IFR(CopyAttribute(pInputType, pPipelineType, MF_MT_FRAME_SIZE));
            IFR(CopyAttribute(pInputType, pPipelineType, MF_MT_FRAME_RATE));

            // Create the output type with the attributes we want from the input format
            IFR(MFCreateMediaType(&pOutputType));
            IFR(pOutputType->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video));
            IFR(pOutputType->SetGUID(MF_MT_SUBTYPE, MFVideoFormat_H264));
            IFR(CopyAttribute(pInputType, pOutputType, MF_MT_INTERLACE_MODE));
            IFR(CopyAttribute(pInputType, pOutputType, MF_MT_FRAME_SIZE));
            IFR(CopyAttribute(pInputType, pOutputType, MF_MT_AVG_BITRATE));
            IFR(CopyAttribute(pInputType, pOutputType, MF_MT_FRAME_RATE));
            IFR(CopyAttribute(pInputType, pOutputType, MF_MT_PIXEL_ASPECT_RATIO));
            IFR(CopyAttribute(pInputType, pOutputType, MF_MT_MPEG2_PROFILE));

            // Create the outputs
            if (FAILED(hr = CreateVideoFileSink(pOutputType, pFilename, &pFileSink)) ||
                FAILED(hr = CreateVideoRenderer(pPipelineType, &pPreviewSink)))
            {
                // Couldn't create a source, try to deselect the stream
                pPD->DeselectStream(i);
            }
            else
            {
                { std::lock_guard<std::recursive_mutex> lock(m_SourceMutex);
                    // Add a source node for this stream.
                    IFR(AddSourceNode(pTopology, m_pSource, pPD, pSD, &pSourceNode));
                }

                // Add a transform node for the decoder.
                IFR(AddCoderNode(pTopology, false, pOutputType, pPipelineType, 0, &pDecodeNode));

                // Add a transform node for the graph overlay.
                IFR(m_pOverlay.QueryInterface(&pOverlayTransform));
                IFR(AddTransformNode(pTopology, pOverlayTransform, pPipelineType, pPipelineType, &pOverlayNode));

                // Add a tee node for the two outputs.
                IFR(AddTeeNode(pTopology, &pTeeNode));

                // Create the output node for the preview window.
                IFR(AddOutputNode(pTopology, pPreviewSink, pPipelineType, 0, &pOutputNode));

                // Create the transform node for the encoder.
                IFR(AddCoderNode(pTopology, true, pPipelineType, pOutputType, 0, &pEncodeNode));

                // Create the output node for the file.
                IFR(AddOutputNode(pTopology, pFileSink, pOutputType, 0, &pFileNode));

                // Connect the nodes.
                IFR(pSourceNode->ConnectOutput(0, pDecodeNode, 0));
                IFR(pDecodeNode->ConnectOutput(0, pOverlayNode, 0));
                IFR(pOverlayNode->ConnectOutput(0, pTeeNode, 0));
                IFR(pTeeNode->ConnectOutput(0, pOutputNode, 0));
                IFR(pTeeNode->ConnectOutput(1, pEncodeNode, 0));
                IFR(pEncodeNode->ConnectOutput(0, pFileNode, 0));

                break; // We've found our video stream - stop
            }
        }
        // else: If not selected, don't add the branch. 
    }

    if (pSourceNode == nullptr)
    {
        // None of the selected streams were valid video streams
        IFR(E_FAIL);
    }

    // Save the file sink for later finalization
    { std::lock_guard<std::recursive_mutex> lock(m_FileMutex);
        m_pFileSink = pFileSink;
    }

    // Return the IMFTopology pointer to the caller.
    *ppTopology = pTopology.Detach();

    return hr;
}

MFTrace Output (Resolution Enabled):

>>>>>>>>>>>>> queued topology
14792,3030 02:28:42.83045 CTopologyHelpers::TraceNode @ Node 0 @0000029242C8EDC0 ID:39C800000001, 0 inputs, 1 outputs, type 1, MF_TOPONODE_SOURCE=@0000029242C6B3D0;MF_TOPONODE_PRESENTATION_DESCRIPTOR=@0000029242D19870;MF_TOPONODE_STREAM_DESCRIPTOR=@0000029242CA9C80
14792,3030 02:28:42.83045 CMFTopologyNodeDetours::GetGUID @0000029242C8EDC0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83046 CTopologyHelpers::TraceObject @ Source @0000029242C6B3D0 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\System32\mfmp4srcsnk.dll), MFMEDIASOURCE_CHARACTERISTICS=0x00000086
14792,3030 02:28:42.83051 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029242C788B0 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_AVG_BITRATE=8008222;MF_MT_MPEG4_SAMPLE_DESCRIPTION=00 00 00 b8 73 74 73 64 00 00 00 00 00 00 00 01 00 00 00 a8 61 76 63 31 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07 80 04 38 00 48 00 00 00 48 00 00 00 00 00 00 00 01 ;MF_MT_MPEG_SEQUENCE_HEADER=00 00 01 27 64 00 28 ac 2c 85 01 e0 08 9f 97 01 6e 02 1a 02 80 00 00 03 00 80 00 00 1e 70 20 00 0f 42 40 00 07 a1 21 7b df 07 68 70 c2 16 00 00 01 28 ee 3c b0 ;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_AM_FORMAT_TYPE=FORMAT_MPEG2Video;{8F020EEA-1508-471F-9DA6-507D7CFA40DB}=1;MF_MT_MPEG2_LEVEL=31;MF_MT_MPEG4_CURRENT_SAMPLE_ENTRY=0;{A7911D53-12A4-4965-AE70-6EADD6FF0551}=1;MF_MT_MPEG2_PROFILE=100;MF_MT_VIDEO_NOMINAL_RANGE=1;{C380465D-2271-428C-9B83-ECEA3B4A85C1}=0;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_SAMPLE_SIZE=1;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MEDIASUBTYPE_H264
14792,3030 02:28:42.83051 CTopologyHelpers::TraceNode @ Node 1 @0000029242C788B0 ID:39C800000002, 1 inputs, 1 outputs, type 2, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0;MF_TOPONODE_DECODER=1
14792,3030 02:28:42.83051 CMFTopologyNodeDetours::GetGUID @0000029242C788B0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83054 CTopologyHelpers::TraceObject @ MFT @000002924D37ADE0 {00000000-0000-0000-0000-000000000000} (C:\Windows\System32\msmpeg2vdec.dll), {206B4FC8-FCF9-4C51-AFE3-9764369E33A0}=1;{2EFD8EEE-1150-4328-9CF5-66DCE933FCF4}=0;{5AE557B8-77AF-41F5-9FA6-4DB2FE1D4BCA}=7680;{7262A16A-D2DC-4E75-9BA8-65C0C6D32B13}=4320;{9561C3E8-EA9E-4435-9B1E-A93E691894D8}=4294967295;{9C27891A-ED7A-40E1-88E8-B22727A024EE}=0;{A24E30D7-DE25-4558-BBFB-71070A2D332E}=0;{AC2C1838-1EB9-4933-85A3-CD62D1B9EC1B}=0;{D8980DEB-0A48-425F-8623-611DB41D3810}=0;MF_TRANSFORM_ASYNC_UNLOCK=1;MF_SA_D3D_AWARE=1;{EF80833F-F8FA-44D9-80D8-41ED6232670C}=0;{F7DB8A2F-4F48-4EE8-AE31-8B6EBE558AE2}=1
14792,3030 02:28:42.83056 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C8EDC0 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_AVG_BITRATE=8008222;MF_MT_COMPRESSED=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;{5601A134-2005-4AD2-B37D-22A6C554DEB2}=1;MF_MT_DEFAULT_STRIDE=0;MF_MT_AVG_BIT_EROR_RATE=0MF_MT_MPEG2_PROFILE=100;MF_MT_FIXED_SIZE_SAMPLES=0;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=0;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MEDIASUBTYPE_H264
14792,3030 02:28:42.83057 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029242C77FE0 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_AVG_BIT_EROR_RATE=0MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83057 CTopologyHelpers::TraceNode @ Node 2 @0000029242C77FE0 ID:39C800000003, 1 inputs, 1 outputs, type 2, MF_TOPONODE_LOCKED=1
14792,3030 02:28:42.83057 CMFTopologyNodeDetours::GetGUID @0000029242C77FE0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83058 CTopologyHelpers::TraceObject @ MFT @0000029242309C50 {00000000-0000-0000-0000-000000000000} (C:\Users\matth\Code\Beck\winlaserlux7\WinLaserlux7\bin\x64\Debug\WLLNative.dll), <NULL>
14792,3030 02:28:42.83059 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C788B0 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83060 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029242C99D60 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83060 CTopologyHelpers::TraceNode @ Node 3 @0000029242C99D60 ID:39C800000004, 1 inputs, 2 outputs, type 3, MF_TOPONODE_PRIMARYOUTPUT=0
14792,3030 02:28:42.83060 CMFTopologyNodeDetours::GetGUID @0000029242C99D60 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83060 CTopologyHelpers::TraceObject @ Tee @0000000000000000 {00000000-0000-0000-0000-000000000000} ((null)), (null)
14792,3030 02:28:42.83060 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C77FE0 stream 0, MT: <<not set, hr=80004005 E_FAIL>>
14792,3030 02:28:42.83061 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029227FBDBC0 stream 0, MT: <<not set, hr=80004005 E_FAIL>>
14792,3030 02:28:42.83061 CTopologyHelpers::TraceStream @ Output stream 1, connected to node @000002925EA3EF10 stream 0, MT: <<not set, hr=80004005 E_FAIL>>
14792,3030 02:28:42.83061 CTopologyHelpers::TraceNode @ Node 4 @0000029227FBDBC0 ID:39C800000005, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0
14792,3030 02:28:42.83061 CMFTopologyNodeDetours::GetGUID @0000029227FBDBC0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83062 CTopologyHelpers::TraceObject @ Sink @000002924D371708 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\SYSTEM32\MF.dll), (null)
14792,3030 02:28:42.83062 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C99D60 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83063 CTopologyHelpers::TraceNode @ Node 5 @000002925EA3EF10 ID:39C800000006, 1 inputs, 1 outputs, type 2, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0
14792,3030 02:28:42.83063 CMFTopologyNodeDetours::GetGUID @000002925EA3EF10 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83063 CTopologyHelpers::TraceObject @ MFT @000002924D331338 {00000000-0000-0000-0000-000000000000} (C:\Windows\System32\mfh264enc.dll), {86A355AE-3A77-4EC4-9F31-01149A4E92DE}=1;MF_TRANSFORM_ASYNC_UNLOCK=1
14792,3030 02:28:42.83064 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C99D60 stream 1, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83066 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029242CF3B90 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_AVG_BITRATE=8008222;MF_MT_MPEG_SEQUENCE_HEADER=00 00 00 01 67 64 00 28 ac 2c ac 07 80 22 7e 5c 04 40 00 00 03 00 40 00 00 0f 07 68 22 11 4e 00 00 00 01 68 ce 3c 30 ;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;{5601A134-2005-4AD2-B37D-22A6C554DEB2}=1;MF_MT_MPEG2_PROFILE=100;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MEDIASUBTYPE_H264
14792,3030 02:28:42.83067 CTopologyHelpers::TraceNode @ Node 6 @0000029242CF3B90 ID:39C800000007, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0
14792,3030 02:28:42.83067 CMFTopologyNodeDetours::GetGUID @0000029242CF3B90 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83067 CTopologyHelpers::TraceObject @ Sink @0000029242CFC620 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\System32\mfmp4srcsnk.dll), (null)
14792,3030 02:28:42.83068 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000002925EA3EF10 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_AVG_BITRATE=8008222;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;{5601A134-2005-4AD2-B37D-22A6C554DEB2}=1;MF_MT_MPEG2_PROFILE=100;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MEDIASUBTYPE_H264
14792,3030 02:28:42.83068 CMFTopologyDetours::GetUINT32 @0000029242D45BD0 attribute not found guidKey = MF_TOPOLOGY_RESOLUTION_STATUS
14792,3030 02:28:42.83069 CTopologyHelpers::Trace @0000029242D45BD0 MF_TOPOLOGY_RESOLUTION_STATUS = NOT FOUND!!!
14792,3030 02:28:42.83069 CTopologyHelpers::Trace @0000029242D45BD0 <<<<<<<<<<<<< queued topology
14792,3030 02:28:42.83069 CMFMediaSourceDetours::Attach @0000029242C6B3D0 Rate control @0000029242C6B3E8
14792,3030 02:28:42.83069 CMFTransformDetours::Attach @000002924D37ADE0 Rate control @000002924D37AE88
14792,3030 02:28:42.83075 CMFMediaSessionDetours::EndGetEvent @0000029242CB0020 Met=111 MESessionTopologyStatus, value @0000029242D45BD0, failed HrStatus=80004005 E_FAIL, MF_EVENT_TOPOLOGY_STATUS=100
14792,3030 02:28:42.83075 CTopologyHelpers::Trace @0000029242D45BD0 >>>>>>>>>>>>> ready topology
14792,3030 02:28:42.83076 CTopologyHelpers::TraceNode @ Node 0 @0000029242C8EDC0 ID:39C800000001, 0 inputs, 1 outputs, type 1, MF_TOPONODE_SOURCE=@0000029242C6B3D0;MF_TOPONODE_PRESENTATION_DESCRIPTOR=@0000029242D19870;MF_TOPONODE_STREAM_DESCRIPTOR=@0000029242CA9C80
14792,3030 02:28:42.83076 CMFTopologyNodeDetours::GetGUID @0000029242C8EDC0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83076 CTopologyHelpers::TraceObject @ Source @0000029242C6B3D0 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\System32\mfmp4srcsnk.dll), MFMEDIASOURCE_CHARACTERISTICS=0x00000086
14792,3030 02:28:42.83081 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029242C788B0 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_AVG_BITRATE=8008222;MF_MT_MPEG4_SAMPLE_DESCRIPTION=00 00 00 b8 73 74 73 64 00 00 00 00 00 00 00 01 00 00 00 a8 61 76 63 31 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 07 80 04 38 00 48 00 00 00 48 00 00 00 00 00 00 00 01 ;MF_MT_MPEG_SEQUENCE_HEADER=00 00 01 27 64 00 28 ac 2c 85 01 e0 08 9f 97 01 6e 02 1a 02 80 00 00 03 00 80 00 00 1e 70 20 00 0f 42 40 00 07 a1 21 7b df 07 68 70 c2 16 00 00 01 28 ee 3c b0 ;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_AM_FORMAT_TYPE=FORMAT_MPEG2Video;{8F020EEA-1508-471F-9DA6-507D7CFA40DB}=1;MF_MT_MPEG2_LEVEL=31;MF_MT_MPEG4_CURRENT_SAMPLE_ENTRY=0;{A7911D53-12A4-4965-AE70-6EADD6FF0551}=1;MF_MT_MPEG2_PROFILE=100;MF_MT_VIDEO_NOMINAL_RANGE=1;{C380465D-2271-428C-9B83-ECEA3B4A85C1}=0;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_SAMPLE_SIZE=1;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MEDIASUBTYPE_H264
14792,3030 02:28:42.83081 CTopologyHelpers::TraceNode @ Node 1 @0000029242C788B0 ID:39C800000002, 1 inputs, 1 outputs, type 2, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0;MF_TOPONODE_DECODER=1
14792,3030 02:28:42.83082 CMFTopologyNodeDetours::GetGUID @0000029242C788B0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83084 CTopologyHelpers::TraceObject @ MFT @000002924D37ADE0 {00000000-0000-0000-0000-000000000000} (C:\Windows\System32\msmpeg2vdec.dll), {206B4FC8-FCF9-4C51-AFE3-9764369E33A0}=1;{2EFD8EEE-1150-4328-9CF5-66DCE933FCF4}=0;{5AE557B8-77AF-41F5-9FA6-4DB2FE1D4BCA}=7680;{7262A16A-D2DC-4E75-9BA8-65C0C6D32B13}=4320;{9561C3E8-EA9E-4435-9B1E-A93E691894D8}=4294967295;{9C27891A-ED7A-40E1-88E8-B22727A024EE}=0;{A24E30D7-DE25-4558-BBFB-71070A2D332E}=0;{AC2C1838-1EB9-4933-85A3-CD62D1B9EC1B}=0;{D8980DEB-0A48-425F-8623-611DB41D3810}=0;MF_TRANSFORM_ASYNC_UNLOCK=1;MF_SA_D3D_AWARE=1;{EF80833F-F8FA-44D9-80D8-41ED6232670C}=0;{F7DB8A2F-4F48-4EE8-AE31-8B6EBE558AE2}=1
14792,3030 02:28:42.83085 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C8EDC0 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_AVG_BITRATE=8008222;MF_MT_COMPRESSED=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;{5601A134-2005-4AD2-B37D-22A6C554DEB2}=1;MF_MT_DEFAULT_STRIDE=0;MF_MT_AVG_BIT_EROR_RATE=0MF_MT_MPEG2_PROFILE=100;MF_MT_FIXED_SIZE_SAMPLES=0;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=0;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MEDIASUBTYPE_H264
14792,3030 02:28:42.83086 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029242C77FE0 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_AVG_BIT_EROR_RATE=0MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83087 CTopologyHelpers::TraceNode @ Node 2 @0000029242C77FE0 ID:39C800000003, 1 inputs, 1 outputs, type 2, MF_TOPONODE_LOCKED=1
14792,3030 02:28:42.83087 CMFTopologyNodeDetours::GetGUID @0000029242C77FE0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83087 CTopologyHelpers::TraceObject @ MFT @0000029242309C50 {00000000-0000-0000-0000-000000000000} (C:\Users\matth\Code\Beck\winlaserlux7\WinLaserlux7\bin\x64\Debug\WLLNative.dll), <NULL>
14792,3030 02:28:42.83088 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C788B0 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83089 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029242C99D60 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83089 CTopologyHelpers::TraceNode @ Node 3 @0000029242C99D60 ID:39C800000004, 1 inputs, 2 outputs, type 3, MF_TOPONODE_PRIMARYOUTPUT=0
14792,3030 02:28:42.83089 CMFTopologyNodeDetours::GetGUID @0000029242C99D60 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83089 CTopologyHelpers::TraceObject @ Tee @0000000000000000 {00000000-0000-0000-0000-000000000000} ((null)), (null)
14792,3030 02:28:42.83090 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C77FE0 stream 0, MT: <<not set, hr=80004005 E_FAIL>>
14792,3030 02:28:42.83090 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029227FBDBC0 stream 0, MT: <<not set, hr=80004005 E_FAIL>>
14792,3030 02:28:42.83090 CTopologyHelpers::TraceStream @ Output stream 1, connected to node @000002925EA3EF10 stream 0, MT: <<not set, hr=80004005 E_FAIL>>
14792,3030 02:28:42.83090 CTopologyHelpers::TraceNode @ Node 4 @0000029227FBDBC0 ID:39C800000005, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0
14792,3030 02:28:42.83091 CMFTopologyNodeDetours::GetGUID @0000029227FBDBC0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83091 CTopologyHelpers::TraceObject @ Sink @000002924D371708 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\SYSTEM32\MF.dll), (null)
14792,3030 02:28:42.83092 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C99D60 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83092 CTopologyHelpers::TraceNode @ Node 5 @000002925EA3EF10 ID:39C800000006, 1 inputs, 1 outputs, type 2, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0
14792,3030 02:28:42.83092 CMFTopologyNodeDetours::GetGUID @000002925EA3EF10 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83092 CTopologyHelpers::TraceObject @ MFT @000002924D331338 {00000000-0000-0000-0000-000000000000} (C:\Windows\System32\mfh264enc.dll), {86A355AE-3A77-4EC4-9F31-01149A4E92DE}=1;MF_TRANSFORM_ASYNC_UNLOCK=1
14792,3030 02:28:42.83093 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @0000029242C99D60 stream 1, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_COMPRESSED=0;MF_MT_YUV_MATRIX=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MFVideoFormat_NV12
14792,3030 02:28:42.83095 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @0000029242CF3B90 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_AVG_BITRATE=8008222;MF_MT_MPEG_SEQUENCE_HEADER=00 00 00 01 67 64 00 28 ac 2c ac 07 80 22 7e 5c 04 40 00 00 03 00 40 00 00 0f 07 68 22 11 4e 00 00 00 01 68 ce 3c 30 ;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;{5601A134-2005-4AD2-B37D-22A6C554DEB2}=1;MF_MT_MPEG2_PROFILE=100;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MEDIASUBTYPE_H264
14792,3030 02:28:42.83095 CTopologyHelpers::TraceNode @ Node 6 @0000029242CF3B90 ID:39C800000007, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0
14792,3030 02:28:42.83096 CMFTopologyNodeDetours::GetGUID @0000029242CF3B90 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
14792,3030 02:28:42.83096 CTopologyHelpers::TraceObject @ Sink @0000029242CFC620 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\System32\mfmp4srcsnk.dll), (null)
14792,3030 02:28:42.83097 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000002925EA3EF10 stream 0, MT: MF_MT_FRAME_SIZE=8246337209400 (1920,1080);MF_MT_AVG_BITRATE=8008222;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;{5601A134-2005-4AD2-B37D-22A6C554DEB2}=1;MF_MT_MPEG2_PROFILE=100;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_INTERLACE_MODE=7;MF_MT_SUBTYPE=MEDIASUBTYPE_H264
14792,3030 02:28:42.83097 CMFTopologyDetours::GetUINT32 @0000029242D45BD0 attribute not found guidKey = MF_TOPOLOGY_RESOLUTION_STATUS
14792,3030 02:28:42.83097 CTopologyHelpers::Trace @0000029242D45BD0 MF_TOPOLOGY_RESOLUTION_STATUS = NOT FOUND!!!
14792,3030 02:28:42.83097 CTopologyHelpers::Trace @0000029242D45BD0 <<<<<<<<<<<<< ready topology<<<<<<<<<<<<< ready topology
c++
windows
ms-media-foundation
asked on Stack Overflow Mar 29, 2018 by Mastax • edited Mar 29, 2018 by Mastax

1 Answer

0

@VuVirt convinced me to try the Video Processor MFT again, and it worked. I had to use some convoluted types to get it to resolve (shown in the order of the pipeline):

Still having problems with the EVR and FileSink, but I suppose that's for another question.

CreateRecordTopology(1263) : pSourceType
    MF_MT_FRAME_SIZE    1920 x 1080
    MF_MT_AVG_BITRATE   8008222
    MF_MT_MPEG4_SAMPLE_DESCRIPTION  <<byte array>>
    MF_MT_MPEG_SEQUENCE_HEADER  <<byte array>>
    MF_MT_MAJOR_TYPE    MFMediaType_Video
    MF_MT_AM_FORMAT_TYPE    {E06D80E3-DB46-11CF-B4D1-00805F6CBBEA}
    {8F020EEA-1508-471F-9DA6-507D7CFA40DB}  1
    MF_MT_MPEG2_LEVEL   31
    MF_MT_MPEG4_CURRENT_SAMPLE_ENTRY    0
    {A7911D53-12A4-4965-AE70-6EADD6FF0551}  1
    MF_MT_MPEG2_PROFILE 100
    MF_MT_VIDEO_NOMINAL_RANGE   1
    {C380465D-2271-428C-9B83-ECEA3B4A85C1}  0
    MF_MT_FRAME_RATE    30 x 1
    MF_MT_PIXEL_ASPECT_RATIO    1 x 1
    MF_MT_SAMPLE_SIZE   1
    MF_MT_INTERLACE_MODE    7 (mixed)
    MF_MT_SUBTYPE   MFVideoFormat_H264
CreateRecordTopology(1276) : pInputType
    MF_MT_FRAME_SIZE    1920 x 1080
    MF_MT_AVG_BITRATE   8008222
    MF_MT_MAJOR_TYPE    MFMediaType_Video
    MF_MT_MPEG2_PROFILE 100
    MF_MT_FRAME_RATE    30 x 1
    MF_MT_PIXEL_ASPECT_RATIO    1 x 1
    MF_MT_INTERLACE_MODE    7 (mixed)
    MF_MT_SUBTYPE   MFVideoFormat_H264
CreateRecordTopology(1299) : pDecodedType
    MF_MT_FRAME_SIZE    1920 x 1080
    MF_MT_COMPRESSED    0
    MF_MT_MAJOR_TYPE    MFMediaType_Video
    MF_MT_FRAME_RATE    30 x 1
    MF_MT_ALL_SAMPLES_INDEPENDENT   1
    MF_MT_INTERLACE_MODE    7 (mixed)
    MF_MT_SUBTYPE   MFVideoFormat_NV12
CreateRecordTopology(1310) : pProcessorType
    MF_MT_FRAME_SIZE    1920 x 1088
    MF_MT_COMPRESSED    0
    MF_MT_MAJOR_TYPE    MFMediaType_Video
    MF_MT_FRAME_RATE    30 x 1
    MF_MT_ALL_SAMPLES_INDEPENDENT   1
    MF_MT_INTERLACE_MODE    7 (mixed)
    MF_MT_SUBTYPE   MFVideoFormat_NV12
CreateRecordTopology(1317) : pPipelineType
    MF_MT_FRAME_SIZE    1920 x 1080
    MF_MT_COMPRESSED    0
    MF_MT_MAJOR_TYPE    MFMediaType_Video
    MF_MT_FRAME_RATE    30 x 1
    MF_MT_ALL_SAMPLES_INDEPENDENT   1
    MF_MT_INTERLACE_MODE    2 (progressive)
    MF_MT_SUBTYPE   MFVideoFormat_NV12
CreateRecordTopology(1283) : pOutputType
    MF_MT_FRAME_SIZE    1920 x 1080
    MF_MT_AVG_BITRATE   8008222
    MF_MT_MAJOR_TYPE    MFMediaType_Video
    MF_MT_MPEG2_PROFILE 100
    MF_MT_FRAME_RATE    30 x 1
    MF_MT_PIXEL_ASPECT_RATIO    1 x 1
    MF_MT_INTERLACE_MODE    2 (progressive)
    MF_MT_SUBTYPE   MFVideoFormat_H264
answered on Stack Overflow Mar 29, 2018 by Mastax

User contributions licensed under CC BY-SA 3.0