E_UNEXPECTED in MESessionStarted event when topology has two branches

0

I am working on a session topology that records a video (with audio) while showing the video stream with an EVR. I am using SampleGrabber sinks for the video and audio streams so I can easily control when I start/end recording (using a sinkwriter) and extract sample data as I need to (for capturing stills and displaying the microphone's audio level). I am using a Tee node to split the video feed between the EVR and the video samplegrabber, and a copierMFT to deliver samples to the EVR. Both the audio and the video samplegrabbers are marked RATELESS.

Each branch of the topology work by themselves, but when I add both to the topology the media session fails to start, with a status="E_UNEXPECTED Catastrophic Error" set on the MESessionStarted event. That is the only error I find in the MFTrace logs. My camera never turns on and I don't receive any samples in my samplegrabbers. The topology seems to resolve correctly, so I'm not sure what the session didn't expect. The documentation for MediaSession::Start doesn't mention anything about this error. My current guess is that is has something to do with syncing the presentation clock, but setting the samplegrabber output nodes as rateless doesn't seem to help. After I receive the Topology Ready status event, checking the session's clock state returns MFCLOCK_STATE_INVALID.

Is there any special setup required to have a live camera source and microphone source in the same topology? Is there any way to get more info on the E_UNEXPECTED error?

Any help on getting to the bottom of this is appreciated. Here is a snippet of my mftrace log which shows the ready topology and the error:

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,

UPDATE 1: As suggested by mofo77, I tried creating a new presentationclock with a systemtimesource and setting it as set the EVR's presentation clock. Unfortunately this didn't change anything.

Looking more into the TopologyReady event, I noticed that the clock doesn't have a presentation time source:

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.

I tried creating a systemtimesource and setting it on the mediasession's clock, but that also doesn't help.

With only the video branch (or only the audio branch), my samplegrabber receives the OnSetPresentationClock callback. With both added to the topology, this never happens and I get the catastrophic failure status on the MESessionStarted event.

audio
video
video-capture
ms-media-foundation
audio-capture
asked on Stack Overflow Aug 11, 2015 by jkutilek • edited Jan 8, 2016 by jkutilek

2 Answers

1

I think you need to provide a valid clock to the EVR.

UPDATE

After your update and better reading your question, it seems that you don't use MFCreateAggregateSource to Aggregate audio and video capture.

If i'm right, you can check my project : MFNode

Under MFNodePlayer, you have source code for MFCreateAggregateSource, and the concept of using audio/video capture with the Media Session. You will not need to worry about clock, because yes, the Media Session handles the presentation clock.

answered on Stack Overflow Nov 25, 2015 by mofo77 • edited Jan 8, 2016 by mofo77
0

This question was also asked on MSDN where Venki.thiyag replied

In case if your topology has 2 sources, then topology needs to be added via Sequencer source.

Refer https://msdn.microsoft.com/en-us/library/windows/desktop/ms698996(v=vs.85).aspx for more details.

This is a quote from the Sequencer Source documentation

You can use it to create playlists, or to play streams from multiple sources simultaneously.

Unfortunately the documentation for Sequencer Source does not detail how to "to play [capture] streams from multiple sources simultaneously". Note the emphasis on simultaneously.

A method for how to use Sequencer Source to simultaneously capture from multiple Media Sources is described in the ofxWMFVideoPlayer technical description section titled "Bonus (experimental) feature : playing multiple video in sync"

Like @mofo77, the ofxWMFVideoPlayer technical description also suggests using the MFCreateAggregateSource function as another way to simultaneously capture from multiple Media Sources.

The MFCreateAggregateSource function is a very direct approach to simultaneously capturing from multiple Media Device Sources. This a quote from the MFCreateAggregateSource documentation remarks.

The aggregated media source is useful for combining streams from separate media sources. For example, you can use it to combine a video capture source and an audio capture source.

answered on Stack Overflow Oct 25, 2019 by beyeriii • edited Oct 25, 2019 by beyeriii

User contributions licensed under CC BY-SA 3.0