目标是:从网络摄像头按原样录制视频(无音频)流,即不进行转码。
当前的实现是使用如下的简单拓扑(括号中的节点编号,以便在读取跟踪日志时参考):
[Source (0)] -> [Tee (1)] -> (auto-added Decoder (2)) -> [EVR (3)]
\-> [Sink Writer (4)]
使用IMFMediaSession
处理拓扑解析(在通过解析 Activation 对象绑定 EVR 输出之后,如MSDN - binding outputs中所述)
如果我根本不添加 Sink Writer - 会话工作正常,在指定的窗口中生成输出(视频预览)。无论是否存在 Tee 节点,都可以正常工作(如预期的那样)。
当我尝试将 Sink Writer 合并到拓扑中时,会出现问题。
Sink Writer 的初始化非常简约。基本上只有MFCreateSinkWriterFromURL()
提供输出文件的名称,IMFAttributes
指定无转换器,无硬件转换加上低延迟和没有限制。 转码容器类型指定为MPEG4
,但如果从文件名的扩展名( .mp4 )推断出该参数,则结果不会改变。
创建 Sink Writer 后,将通过AddStream()
向其添加新流,并且网络摄像头的媒体类型将直接用于指定输出的媒体类型以及SetInputMediaType()
来电。
调用BeginWriting()
来完成 Sink Writer 的初始化,然后通过调用SetObject()
将其添加到节点。
Tee 然后将它的辅助输出连接到 Sink Writer 的节点,并且拓扑得到解决(成功),并且可能已准备就绪。
一旦拓扑排队到一个新创建的会话中,MFSESSION_SETTOPOLOGY_NORESOLUTION
标志(以及MFSESSION_SETTOPOLOGY_IMMEDIATE
),播放和录音应该开始 - 这是我目前对它应该如何工作的理解。
然而,这是我通过Invoke()
获取媒体会话事件的事件类型MESessionTopologySet
,错误状态代码 0x80004002 !
使用 Sink Writer 的属性(指定空/默认值)不会产生正面结果。在添加编写器之前移动拓扑分辨率并没有改变任何东西。将 Tee 节点的主输出流指定为 EVR 也无济于事。
在EnableFrameServerMode
设置为0
的情况下禁用MS的 Red-Stone 功能无效。
在 Windows 10 Pro 桌面上使用 Windows SDK 10.0.10586 构建并运行。
以下是来自 mftrace 的日志作为参考(必须修剪一下以适应30K限制):
PID, TID Time (UTC) TraceMessage --------- -------------- ------------ ...... removed the beginning to save space 8000,2ED0 21:51:35.64241 CMFPlatExportDetours::MFStartup @ Version=0x00020070, dwFlags=0x00000001 ...... enumerating hardware and setting up client factories 8000,2ED0 21:51:35.65757 CMFPlatExportDetours::MFStartup @ Version=0x00020070, dwFlags=0x00000000 ...... CoCreateInstance calls 8000,2ED0 21:51:35.66117 CMFActivateDetours::ActivateObject @000001B0B3BE3390 New MFT @000001B0B3BE3590 8000,2ED0 21:51:35.66119 CMFActivateDetours::ActivateObject @000001B0B3BE3390 New source @000001B0B3BEFB80 8000,2ED0 21:51:35.66123 CMFMediaSourceDetours::TracePD @000001B0B3BEFB80 Stream 0 (ID 0): selected 1, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:35.66150 CMFActivateDetours::ActivateObject @000001B0B3BE3390 New MFT @000001B0B3BE3590 8000,2ED0 21:51:35.66150 CMFActivateDetours::ActivateObject @000001B0B3BE3390 New source @000001B0B3BEFB80 8000,2ED0 21:51:35.66153 CMFMediaSourceDetours::TracePD @000001B0B3BEFB80 Stream 0 (ID 0): selected 1, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.33229 CMFActivateDetours::ActivateObject @000001B0B3BE3390 New MFT @000001B0B3BE3590 8000,2ED0 21:51:38.33229 CMFActivateDetours::ActivateObject @000001B0B3BE3390 New source @000001B0B3BEFB80 8000,2ED0 21:51:38.33233 CMFMediaSourceDetours::TracePD @000001B0B3BEFB80 Stream 0 (ID 0): selected 1, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.33272 CMFReadWriteExportDetours::MFCreateSinkWriterFromURL @ URL: 'c:\tmp\rry-raw.mp4', bytestream @0000000000000000, MF_SINK_WRITER_DISABLE_THROTTLING=1;MF_TRANSCODE_CONTAINERTYPE=MFTranscodeContainerType_MPEG4;MF_READWRITE_DISABLE_CONVERTERS=1;{9C27891A-ED7A-40E1-88E8-B22727A024EE}=1;MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS=0 8000,2ED0 21:51:38.33289 COle32ExportDetours::CoCreateInstance @ Created {48E2ED0F-98C2-4A37-BED5-166312DDD83F} MFReadWrite Class Factory (C:\Windows\System32\mfreadwrite.dll) @000001B0B234EFA0 - traced interfaces: IMFReadWriteClassFactory @000001B0B234EFA0, 8000,2ED0 21:51:38.33290 CMFReadWriteClassFactoryDetours::CreateInstanceFromURL @000001B0B234EFA0 URL: 'c:\tmp\rry-raw.mp4', MF_SINK_WRITER_DISABLE_THROTTLING=1;MF_TRANSCODE_CONTAINERTYPE=MFTranscodeContainerType_MPEG4;MF_READWRITE_DISABLE_CONVERTERS=1;{9C27891A-ED7A-40E1-88E8-B22727A024EE}=1;MF_READWRITE_ENABLE_HARDWARE_TRANSFORMS=0 8000,2ED0 21:51:38.33292 CMFPlatExportDetours::MFCreateFile @ URL: 'c:\tmp\rry-raw.mp4' 8000,2ED0 21:51:38.33315 CMFReadWriteClassFactoryDetours::HandleObject @ New sink writer @000001B0B3C01770 8000,2ED0 21:51:38.33322 CMFSinkWriterDetours::AddStream @000001B0B3C01770 Stream Index 0x0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.33326 CMFSinkWriterDetours::SetInputMediaType @000001B0B3C01770 Stream Index 0x0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.33379 COle32ExportDetours::CoCreateInstance @ Created {A22C4FC7-6E91-4E1D-89E9-53B2667B72BA} MF MPEG4 Sink Class Factory (C:\Windows\System32\mfmp4srcsnk.dll) @000001B0B234EFA0 - traced interfaces: 8000,2ED0 21:51:38.33423 CMFByteStreamDetours::GetCapabilities @000001B0B3BE0520 Capabilities 0x00000806 8000,2ED0 21:51:38.33434 CMFSinkWriterDetours::BeginWriting @000001B0B3C01770 Began writing 8000,2ED0 21:51:38.33538 COle32ExportDetours::CoCreateInstance @ New MFT @000001B0B3C24730, VIDEO_ZOOM_RECT=00 00 00 00 00 00 00 00 00 00 80 3f 00 00 80 3f 8000,2ED0 21:51:38.33539 COle32ExportDetours::CoCreateInstance @ Created {E474E05A-AB65-4F6A-827C-218B1BAAF31F} MF Video Mixer (C:\Windows\System32\evr.dll) @000001B0B3C24730 - traced interfaces: IMFTransform @000001B0B3C24730, 8000,2ED0 21:51:38.38105 COle32ExportDetours::CoCreateInstance @ Created {A0A7A57B-59B2-4919-A694-ADD0A526C373} Tearless Window Presenter (C:\Windows\System32\evr.dll) @000001B0B3C292E8 - traced interfaces: 8000,2ED0 21:51:38.38107 COle32ExportDetours::CoCreateInstance @ Created {98455561-5136-4D28-AB08-4CEE40EA2781} MF Video Presenter (C:\Windows\System32\evr.dll) @000001B0B3C27390 - traced interfaces: 8000,2ED0 21:51:38.38111 CMFTransformDetours::ProcessMessage @000001B0B3C24730 Message type=0x00000002 MFT_MESSAGE_SET_D3D_MANAGER, param=B3C28090 8000,2ED0 21:51:38.39477 CMFActivateDetours::ActivateObject @000001B0B3C00430 New sink @000001B0B3C29950 8000,2ED0 21:51:38.39477 CMFMediaSinkDetours::Attach @000001B0B3C29950 Clock state @000001B0B3C29970 8000,2ED0 21:51:38.40944 CMFTransformDetours::SetInputType @000001B0B3C24730 Succeeded MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.40952 CMFTransformDetours::SetInputType @000001B0B3C2B0F0 Succeeded MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.40986 CMFTransformDetours::SetInputType @000001B0B3C24730 Succeeded MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.40988 CMFTransformDetours::SetOutputType @000001B0B3C2B0F0 Succeeded MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 ...... attach clock and rate control 8000,2ED0 21:51:38.41105 CTopologyHelpers::Trace @000001B0B3C2A8E0 >>>>>>>>>>>>> input topology 8000,2ED0 21:51:38.41106 CTopologyHelpers::TraceNode @ Node 0 @000001B0B3C00430 ID:1F4000000001, 0 inputs, 1 outputs, type 1, MF_TOPONODE_MARKIN_HERE=1;MF_TOPONODE_MARKOUT_HERE=1;MF_TOPONODE_MEDIASTART=0 (0,0);MF_TOPONODE_SOURCE=@000001B0B3BEFB80;MF_TOPONODE_PRESENTATION_DESCRIPTOR=@000001B0B3BF45A0;MF_TOPONODE_STREAM_DESCRIPTOR=@000001B0B3BF4170 8000,2ED0 21:51:38.41107 CTopologyHelpers::TraceObject @ Source @000001B0B3BEFB80 {00000000-0000-0000-0000-000000000000} (C:\Windows\SYSTEM32\MFCORE.DLL), MFMEDIASOURCE_CHARACTERISTICS=0x00000005 8000,2ED0 21:51:38.41109 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @000001B0B3C2B030 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.41109 CTopologyHelpers::TraceNode @ Node 1 @000001B0B3C2B030 ID:1F4000000003, 1 inputs, 2 outputs, type 3, MF_TOPONODE_PRIMARYOUTPUT=0 8000,2ED0 21:51:38.41109 CTopologyHelpers::TraceObject @ Tee @0000000000000000 {00000000-0000-0000-0000-000000000000} ((null)), (null) 8000,2ED0 21:51:38.41111 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000001B0B3C00430 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.41112 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @000001B0B3C2ADB0 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.41114 CTopologyHelpers::TraceStream @ Output stream 1, connected to node @000001B0B3C29130 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.41115 CTopologyHelpers::TraceNode @ Node 2 @000001B0B3C2ACF0 ID:1F4000000002, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0;MF_TOPONODE_TRANSFORM_OBJECTID={D23E6477-B104-4707-81CB-E1CA19A07016};{B8AA3129-DFC9-423A-8ACD-1D82850A3D1F}=@000001B0B3C27370 8000,2ED0 21:51:38.41115 CTopologyHelpers::TraceObject @ Sink @000001B0B3C2A048 {D23E6477-B104-4707-81CB-E1CA19A07016} (C:\Windows\SYSTEM32\MF.dll), (null) 8000,2ED0 21:51:38.41115 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000001B0B3C2ADB0 stream 0, MT: > 8000,2ED0 21:51:38.41116 CTopologyHelpers::TraceNode @ Node 3 @000001B0B3C2ADB0 ID:1F4000000008, 1 inputs, 1 outputs, type 2, MF_TOPONODE_TRANSFORM_OBJECTID={CF862982-23B0-4E3D-8C76-D03FEF084AF8} 8000,2ED0 21:51:38.41116 CTopologyHelpers::TraceObject @ MFT @000001B0B3C2B0F0 {CF862982-23B0-4E3D-8C76-D03FEF084AF8} (C:\Windows\SYSTEM32\MFCORE.DLL), MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE=1 8000,2ED0 21:51:38.41118 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000001B0B3C2B030 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.41120 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @000001B0B3C2ACF0 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,2ED0 21:51:38.41120 CTopologyHelpers::TraceNode @ Node 4 @000001B0B3C29130 ID:1F4000000004, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0 8000,2ED0 21:51:38.41120 CMFTopologyNodeDetours::GetGUID @000001B0B3C29130 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID 8000,2ED0 21:51:38.41121 CTopologyHelpers::TraceObject @ UnknownType @0000000000000000 {00000000-0000-0000-0000-000000000000} ((null)), (null) 8000,2ED0 21:51:38.41121 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000001B0B3C2B030 stream 1, MT: > 8000,2ED0 21:51:38.41121 CTopologyHelpers::Trace @000001B0B3C2A8E0 MF_TOPOLOGY_RESOLUTION_STATUS = 0 8000,2ED0 21:51:38.41121 CTopologyHelpers::Trace @000001B0B3C2A8E0 >>>>>>>>>>>> queued topology 8000,229C 21:51:38.41144 CTopologyHelpers::TraceNode @ Node 0 @000001B0B3C00430 ID:1F4000000001, 0 inputs, 1 outputs, type 1, MF_TOPONODE_MARKIN_HERE=1;MF_TOPONODE_MARKOUT_HERE=1;MF_TOPONODE_MEDIASTART=0 (0,0);MF_TOPONODE_SOURCE=@000001B0B3BEFB80;MF_TOPONODE_PRESENTATION_DESCRIPTOR=@000001B0B3BF45A0;MF_TOPONODE_STREAM_DESCRIPTOR=@000001B0B3BF4170;{9C27891A-ED7A-40E1-88E8-B22727A024EE}=1 8000,229C 21:51:38.41145 CTopologyHelpers::TraceObject @ Source @000001B0B3BEFB80 {00000000-0000-0000-0000-000000000000} (C:\Windows\SYSTEM32\MFCORE.DLL), MFMEDIASOURCE_CHARACTERISTICS=0x00000005 8000,229C 21:51:38.41147 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @000001B0B3C2B030 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,229C 21:51:38.41147 CTopologyHelpers::TraceNode @ Node 1 @000001B0B3C2B030 ID:1F4000000003, 1 inputs, 2 outputs, type 3, MF_TOPONODE_PRIMARYOUTPUT=0;{9C27891A-ED7A-40E1-88E8-B22727A024EE}=1 8000,229C 21:51:38.41148 CTopologyHelpers::TraceObject @ Tee @0000000000000000 {00000000-0000-0000-0000-000000000000} ((null)), (null) 8000,229C 21:51:38.41149 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000001B0B3C00430 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,229C 21:51:38.41151 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @000001B0B3C2ADB0 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,229C 21:51:38.41152 CTopologyHelpers::TraceStream @ Output stream 1, connected to node @000001B0B3C29130 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,229C 21:51:38.41153 CTopologyHelpers::TraceNode @ Node 2 @000001B0B3C2ACF0 ID:1F4000000002, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0;MF_TOPONODE_TRANSFORM_OBJECTID={D23E6477-B104-4707-81CB-E1CA19A07016};{9C27891A-ED7A-40E1-88E8-B22727A024EE}=1;{B8AA3129-DFC9-423A-8ACD-1D82850A3D1F}=@000001B0B3C27370 8000,229C 21:51:38.41153 CTopologyHelpers::TraceObject @ Sink @000001B0B3C2A048 {D23E6477-B104-4707-81CB-E1CA19A07016} (C:\Windows\SYSTEM32\MF.dll), (null) 8000,229C 21:51:38.41153 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000001B0B3C2ADB0 stream 0, MT: > 8000,229C 21:51:38.41154 CTopologyHelpers::TraceNode @ Node 3 @000001B0B3C2ADB0 ID:1F4000000008, 1 inputs, 1 outputs, type 2, MF_TOPONODE_TRANSFORM_OBJECTID={CF862982-23B0-4E3D-8C76-D03FEF084AF8};{9C27891A-ED7A-40E1-88E8-B22727A024EE}=1 8000,229C 21:51:38.41155 CTopologyHelpers::TraceObject @ MFT @000001B0B3C2B0F0 {CF862982-23B0-4E3D-8C76-D03FEF084AF8} (C:\Windows\SYSTEM32\MFCORE.DLL), MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE=1;{9C27891A-ED7A-40E1-88E8-B22727A024EE}=1 8000,229C 21:51:38.41156 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000001B0B3C2B030 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,229C 21:51:38.41158 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @000001B0B3C2ACF0 stream 0, MT: MF_MT_FRAME_SIZE=1374389534960 (320,240);MF_MT_AVG_BITRATE=36864000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=640;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_AM_FORMAT_TYPE=FORMAT_VIDEOINFO2;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=128849018881 (30,1);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_FRAME_RATE_RANGE_MIN=128849018881 (30,1);MF_MT_SAMPLE_SIZE=153600;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2 8000,229C 21:51:38.41159 CTopologyHelpers::TraceNode @ Node 4 @000001B0B3C29130 ID:1F4000000004, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0;{9C27891A-ED7A-40E1-88E8-B22727A024EE}=1 8000,229C 21:51:38.41159 CMFTopologyNodeDetours::GetGUID @000001B0B3C29130 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID 8000,229C 21:51:38.41159 CTopologyHelpers::TraceObject @ UnknownType @0000000000000000 {00000000-0000-0000-0000-000000000000} ((null)), (null) 8000,229C 21:51:38.41159 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @000001B0B3C2B030 stream 1, MT: > 8000,229C 21:51:38.41159 CTopologyHelpers::Trace @000001B0B3C2A8E0 MF_TOPOLOGY_RESOLUTION_STATUS = 0 8000,229C 21:51:38.41159 CTopologyHelpers::Trace @000001B0B3C2A8E0
答案 0 :(得分:1)
Sink Writer 不是要为输出节点指定的有效对象。只有两个有效对象是IMFStreamSink
和IMFActivate
。
正确创建并配置IMFStreamSink
后,其他所有内容都会像魅力一样开始工作。
创建要在节点IMFStreamSink
调用中使用的SetObject()
的步骤:
IMFByteStream
(例如通过MFCreateFile()
)IMFMediaSink
创建IMFByteStream
并进行设置(在MSDN中描述)GetStreamSinkById()
获取IMFStreamSink
对象 - 即在节点的SetObject()
调用中使用的对象!