0

我正在研究一个会话拓扑,该拓扑记录视频(带音频),同时显示带有 EVR 的视频流。我正在为视频和音频流使用 SampleGrabber 接收器,因此我可以轻松控制何时开始/结束录制(使用接收器写入器)并根据需要提取样本数据(用于捕获静止图像和显示麦克风的音频电平)。我正在使用 Tee 节点在 EVR 和视频采样器之间拆分视频源,并使用 copierMFT 将样本传送到 EVR。音频和视频采样器都标记为 RATELESS。

拓扑的每个分支都自行工作,但是当我将两者都添加到拓扑时,媒体会话无法启动,并且在 MESessionStarted 事件上设置了 status="E_UNEXPECTED Catastrophic Error"。这是我在 MFTrace 日志中发现的唯一错误。我的相机永远不会打开,我的采样器中也没有收到任何样本。拓扑似乎可以正确解析,所以我不确定会话没有预料到什么。MediaSession::Start 的文档没有提及有关此错误的任何内容。我目前的猜测是这与同步演示时钟有关,但是将采样器输出节点设置为无速率似乎没有帮助。在我收到拓扑就绪状态事件后,检查会话的时钟状态会返回 MFCLOCK_STATE_INVALID。

在同一拓扑中拥有实时摄像机源和麦克风源是否需要任何特殊设置?有什么方法可以获取有关 E_UNEXPECTED 错误的更多信息?

任何有助于了解这一点的帮助表示赞赏。这是我的 mftrace 日志的片段,其中显示了就绪的拓扑和错误:

12656,14E8 19:25:29.69496 CTopologyHelpers::Trace @02A799F8 >>>>>>>>>>>>> ready topology
12656,14E8 19:25:29.69499 CTopologyHelpers::TraceNode @ Node 0 @02A7A110 ID:317000000001, 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=@02A95200;MF_TOPONODE_PRESENTATION_DESCRIPTOR=@02A63820;MF_TOPONODE_STREAM_DESCRIPTOR=@02A662C8;{89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02A85698
12656,14E8 19:25:29.69500 CMFTopologyNodeDetours::GetGUID @02A7A110 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
12656,14E8 19:25:29.69501 CTopologyHelpers::TraceObject @ Source @02A95200 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\SYSTEM32\MFCORE.DLL), MFMEDIASOURCE_CHARACTERISTICS=0x00000005
12656,14E8 19:25:29.69507 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @02A7A188 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_AVG_BITRATE=147456000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=1280;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=614400;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2
12656,14E8 19:25:29.69509 CTopologyHelpers::TraceNode @ Node 1 @02A7A188 ID:317000000002, 1 inputs, 2 outputs, type 3, MF_TOPONODE_PRIMARYOUTPUT=0;{89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02A7CE00
12656,14E8 19:25:29.69509 CMFTopologyNodeDetours::GetGUID @02A7A188 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
12656,14E8 19:25:29.69509 CTopologyHelpers::TraceObject @ Tee @00000000 {00000000-0000-0000-0000-000000000000} ((null)), (null)
12656,14E8 19:25:29.69514 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @02A7A110 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_AVG_BITRATE=147456000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=1280;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=614400;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2
12656,14E8 19:25:29.69518 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @02A79D68 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_AVG_BITRATE=147456000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=1280;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=614400;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2
12656,14E8 19:25:29.69522 CTopologyHelpers::TraceStream @ Output stream 1, connected to node @02A7B1F0 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_AVG_BITRATE=147456000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=1280;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=614400;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2
12656,14E8 19:25:29.69524 CTopologyHelpers::TraceNode @ Node 2 @02A79D68 ID:317000000005, 1 inputs, 1 outputs, type 2, {89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02A85908
12656,14E8 19:25:29.69524 CMFTopologyNodeDetours::GetGUID @02A79D68 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
12656,14E8 19:25:29.69526 CTopologyHelpers::TraceObject @ MFT @02A6DAE8 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\SYSTEM32\MFCORE.DLL), MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE=1;{851745D5-C3D6-476D-9527-498EF2D10D18}=4
12656,14E8 19:25:29.69531 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @02A7A188 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_AVG_BITRATE=147456000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=1280;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=614400;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2
12656,14E8 19:25:29.69536 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @02A79EA0 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_AVG_BITRATE=147456000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=1280;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=614400;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2
12656,14E8 19:25:29.69538 CTopologyHelpers::TraceNode @ Node 3 @02A79DE0 ID:317000000003, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_DISABLE_PREROLL=1;{89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02A85AE0
12656,14E8 19:25:29.69539 CMFTopologyNodeDetours::GetGUID @02A79DE0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
12656,14E8 19:25:29.69539 CTopologyHelpers::TraceObject @ Sink @02A6FB28 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\SYSTEM32\MFCORE.DLL), (null)
12656,14E8 19:25:29.69544 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @02A7B1F0 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=2560;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_GEOMETRIC_APERTURE=00 00 00 00 00 00 00 00 80 02 00 00 e0 01 00 00 ;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=42949672960333333 (10000000,333333);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_SAMPLE_SIZE=1228800;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_SUBTYPE=MFVideoFormat_RGB32
12656,14E8 19:25:29.69546 CTopologyHelpers::TraceNode @ Node 4 @02A7B1F0 ID:31700000000C, 1 inputs, 1 outputs, type 2, MF_TOPONODE_TRANSFORM_OBJECTID={98230571-0087-4204-B020-3282538E57D3};{89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02A86040
12656,14E8 19:25:29.69546 CTopologyHelpers::TraceObject @ MFT @02A7A488 {98230571-0087-4204-B020-3282538E57D3} (C:\Windows\SYSTEM32\colorcnv.dll), <NULL>
12656,14E8 19:25:29.69551 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @02A7A188 stream 1, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_AVG_BITRATE=147456000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=1280;MF_MT_VIDEO_CHROMA_SITING=6;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_SAMPLE_SIZE=614400;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_SUBTYPE=MFVideoFormat_YUY2
12656,14E8 19:25:29.69556 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @02A79DE0 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=2560;MF_MT_VIDEO_CHROMA_SITING=6;MF_MT_GEOMETRIC_APERTURE=00 00 00 00 00 00 00 00 80 02 00 00 e0 01 00 00 ;MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_VIDEO_NOMINAL_RANGE=2;MF_MT_FRAME_RATE=42949672960333333 (10000000,333333);MF_MT_PIXEL_ASPECT_RATIO=4294967297 (1,1);MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_SAMPLE_SIZE=1228800;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_SUBTYPE=MFVideoFormat_RGB32
12656,14E8 19:25:29.69559 CTopologyHelpers::TraceNode @ Node 5 @02A79EA0 ID:317000000004, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_NOSHUTDOWN_ON_REMOVE=0;MF_TOPONODE_DISABLE_PREROLL=1;{89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02A86218;{B8AA3129-DFC9-423A-8ACD-1D82850A3D1F}=@02A8B9E0
12656,14E8 19:25:29.69560 CMFTopologyNodeDetours::GetGUID @02A79EA0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
12656,14E8 19:25:29.69560 CTopologyHelpers::TraceObject @ Sink @02A8E5D4 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\SYSTEM32\MF.dll), (null)
12656,14E8 19:25:29.69565 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @02A79D68 stream 0, MT: MF_MT_FRAME_SIZE=2748779069920 (640,480);MF_MT_AVG_BITRATE=147456000;MF_MT_YUV_MATRIX=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Video;MF_MT_VIDEO_LIGHTING=3;MF_MT_DEFAULT_STRIDE=1280;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=614400;MF_MT_VIDEO_PRIMARIES=2;MF_MT_INTERLACE_MODE=2;MF_MT_FRAME_RATE_RANGE_MAX=128849018881 (30,1);MF_MT_SUBTYPE=MFVideoFormat_YUY2
12656,14E8 19:25:29.69568 CTopologyHelpers::TraceNode @ Node 6 @02A79F18 ID:317000000006, 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=@02A65D40;MF_TOPONODE_PRESENTATION_DESCRIPTOR=@02A63CE8;MF_TOPONODE_STREAM_DESCRIPTOR=@02A63048;{89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02A86370
12656,14E8 19:25:29.69568 CMFTopologyNodeDetours::GetGUID @02A79F18 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
12656,14E8 19:25:29.69569 CTopologyHelpers::TraceObject @ Source @02A65D40 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\SYSTEM32\MFCORE.DLL), MFMEDIASOURCE_CHARACTERISTICS=0x00000005
12656,14E8 19:25:29.69571 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @02A7BFA0 stream 0, MT: MF_MT_AUDIO_AVG_BYTES_PER_SECOND=384000;MF_MT_AUDIO_BLOCK_ALIGNMENT=8;MF_MT_AUDIO_NUM_CHANNELS=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Audio;MF_MT_AUDIO_CHANNEL_MASK=3;MF_MT_AUDIO_SAMPLES_PER_SECOND=48000;MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_AUDIO_BITS_PER_SAMPLE=32;MF_MT_SUBTYPE=MFAudioFormat_Float
12656,14E8 19:25:29.69573 CTopologyHelpers::TraceNode @ Node 7 @02A7BDC0 ID:317000000007, 1 inputs, 0 outputs, type 0, MF_TOPONODE_STREAMID=0;MF_TOPONODE_DISABLE_PREROLL=1;{89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02A864E0
12656,14E8 19:25:29.69573 CMFTopologyNodeDetours::GetGUID @02A7BDC0 attribute not found guidKey = MF_TOPONODE_TRANSFORM_OBJECTID
12656,14E8 19:25:29.69574 CTopologyHelpers::TraceObject @ Sink @02A70410 {00000000-0000-0000-0000-000000000000} (C:\WINDOWS\SYSTEM32\MFCORE.DLL), (null)
12656,14E8 19:25:29.69575 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @02A7BFA0 stream 0, MT: MF_MT_AUDIO_AVG_BYTES_PER_SECOND=88200;MF_MT_AUDIO_BLOCK_ALIGNMENT=2;MF_MT_AUDIO_NUM_CHANNELS=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Audio;MF_MT_AUDIO_CHANNEL_MASK=4;MF_MT_AUDIO_SAMPLES_PER_SECOND=44100;MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_AUDIO_BITS_PER_SAMPLE=16;MF_MT_SUBTYPE=MFAudioFormat_PCM
12656,14E8 19:25:29.69577 CTopologyHelpers::TraceNode @ Node 8 @02A7BFA0 ID:317000000010, 1 inputs, 1 outputs, type 2, MF_TOPONODE_TRANSFORM_OBJECTID={F447B69E-1884-4A7E-8055-346F74D6EDB3};{89485B85-2FFA-4547-B269-B82C79EE197C}=1;{9C86CC4E-68CE-4CFF-AA1E-9A5A40D5B4E0}=@02AAA068
12656,14E8 19:25:29.69578 CTopologyHelpers::TraceObject @ MFT @02A7C4AC {F447B69E-1884-4A7E-8055-346F74D6EDB3} (C:\Windows\SYSTEM32\resampledmo.dll), <NULL>
12656,14E8 19:25:29.69581 CTopologyHelpers::TraceStream @ Input stream 0, connected to node @02A79F18 stream 0, MT: MF_MT_AUDIO_AVG_BYTES_PER_SECOND=384000;MF_MT_AUDIO_BLOCK_ALIGNMENT=8;MF_MT_AUDIO_NUM_CHANNELS=2;MF_MT_MAJOR_TYPE=MEDIATYPE_Audio;MF_MT_AUDIO_CHANNEL_MASK=3;MF_MT_AUDIO_SAMPLES_PER_SECOND=48000;MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_AUDIO_BITS_PER_SAMPLE=32;MF_MT_SUBTYPE=MFAudioFormat_Float
12656,14E8 19:25:29.69583 CTopologyHelpers::TraceStream @ Output stream 0, connected to node @02A7BDC0 stream 0, MT: MF_MT_AUDIO_AVG_BYTES_PER_SECOND=88200;MF_MT_AUDIO_BLOCK_ALIGNMENT=2;MF_MT_AUDIO_NUM_CHANNELS=1;MF_MT_MAJOR_TYPE=MEDIATYPE_Audio;MF_MT_AUDIO_SAMPLES_PER_SECOND=44100;MF_MT_AUDIO_PREFER_WAVEFORMATEX=1;MF_MT_ALL_SAMPLES_INDEPENDENT=1;MF_MT_AUDIO_BITS_PER_SAMPLE=16;MF_MT_SUBTYPE=MFAudioFormat_PCM
12656,14E8 19:25:29.69584 CTopologyHelpers::Trace @02A799F8 MF_TOPOLOGY_RESOLUTION_STATUS = 0
12656,14E8 19:25:29.69584 CTopologyHelpers::Trace @02A799F8 <<<<<<<<<<<<< ready topology
12656,14E8 19:25:29.69590 CKernel32ExportDetours::OutputDebugStringA @ TOPOLOGY READY 
12656,14E8 19:25:29.69600 CMFTopologyDetours::GetUINT32 @02A799F8 attribute not found guidKey = {9C27891A-ED7A-40E1-88E8-B22727A024EE}
12656,14E8 19:25:29.69612 CMFMediaSessionDetours::EndGetEvent @02A6DDC0 Met=103 MESessionStarted, value (empty), failed HrStatus=8000FFFF E_UNEXPECTED,

更新 1: 按照 mofo77 的建议,我尝试使用系统时间源创建一个新的演示时钟,并将其设置为设置 EVR 的演示时钟。不幸的是,这并没有改变任何东西。

深入研究 TopologyReady 事件,我注意到时钟没有显示时间源:

IMFClock* pClock;
hr = pMediaSession->GetClock(&pClock);
MFCLOCK_STATE state;
hr = pClock->GetState(0, &state);
//state == MFCLOCK_STATE_INVALID    

IMFPresentationClock* pPresentationClock;
hr = pClock->QueryInterface(&pPresentationClock);
IMFPresentationTimeSource* pPresentationTimeSource;
hr = pPresentationClock->GetTimeSource(&pPresentationTimeSource);
//hr == 0xc00d9c41 : No Presentation Time Source has been specified.

我尝试创建一个系统时间源并将其设置在 mediasession 的时钟上,但这也无济于事。

只有视频分支(或只有音频分支),我的 samplegrabber 接收 OnSetPresentationClock 回调。将两者都添加到拓扑中后,这永远不会发生,并且我在 MESessionStarted 事件中获得了灾难性的故障状态。

4

2 回答 2

1

我认为你需要为 EVR 提供一个有效的时钟。

更新

在您更新并更好地阅读您的问题之后,您似乎没有使用 MFCreateAggregateSource 来聚合音频和视频捕获。

如果我是对的,你可以检查我的项目:MFNode

在 MFNodePlayer 下,您有 MFCreateAggregateSource 的源代码,以及通过媒体会话使用音频/视频捕获的概念。您无需担心时钟,因为是的,媒体会话处理演示时钟。

于 2015-11-25T18:53:21.497 回答
0

这个问题也在MSDN上被问到,Venki.thiyag 回答了

如果您的拓扑有 2 个源,则需要通过 Sequencer 源添加拓扑。

有关详细信息,请参阅 https://msdn.microsoft.com/en-us/library/windows/desktop/ms698996(v=vs.85).aspx

这是来自 Sequencer Source 文档的引用

您可以使用它来创建播放列表,或同时播放来自多个来源的流。

不幸的是,Sequencer Source 的文档没有详细说明如何“同时从多个源播放 [捕获] 流”。注意同时强调。

题为“奖励(实验)功能:同步播放多个视频”的ofxWMFVideoPlayer技术描述部分描述了如何使用Sequencer Source同时从多个媒体源捕获的方法

与@mofo77 一样,ofxWMFVideoPlayer技术描述也建议使用MFCreateAggregateSource函数作为同时从多个媒体源捕获的另一种方式。

MFCreateAggregateSource函数是一种从多个媒体设备源同时捕获的非常直接的方法。这是来自 MFCreateAggregateSource 文档备注的引用。

聚合媒体源对于组合来自不同媒体源的流很有用。例如,您可以使用它来组合视频捕获源和音频捕获源。

于 2019-10-25T06:57:24.493 回答