Resizer MFT fails to process output during playback of H264-encoded video

3

I'm implementing an application for Windows which should play videos (some kind of video player). I'm using MediaFoundation for video playback, and it works fine for most of the videos, but fails certain ones.

I create the following MF topology: MF_TOPOLOGY_SOURCESTREAM_NODE -> MF_TOPOLOGY_TRANSFORM_NODE (Microsoft H264 Video Decoder MFT) -> MF_TOPOLOGY_TRANSFORM_NODE (Resizer MFT) -> MF_TOPOLOGY_TRANSFORM_NODE (Color Converter MFT) -> MF_TOPOLOGY_OUTPUT_NODE(SampleGrabberSink).

When I'm playing certain video in my application the following is happening (taken from MF traces via mftrace tool):

  1. MF creates transform node, MFTransform and MEdiaObject for Resizer MFT:

    COle32ExportDetours::CoCreateInstance @ Created {1EA1EA14-48F4-4054-AD1A-E8AEE10AC805} Resizer DMO (C:\Windows\SysWOW64\vidreszr.dll) @0561F060 - traced interfaces: IMFTransform @0561F060, IMediaObject @0561F078

  2. MF sets input type and output type of resizer transform:

    CMFTransformDetours::SetInputType @0561F060 Succeeded MT: MF_MT_MAJOR_TYPE=MEDIATYPE_Video; MF_MT_SUBTYPE=MFVideoFormat_YV12; MF_MT_FRAME_SIZE=3092376453526 (720,406); MF_MT_FRAME_RATE=107374182401(25,1); MF_MT_PIXEL_ASPECT_RATIO=1743756722581(406,405); MF_MT_INTERLACE_MODE=7; MF_MT_AVG_BITRATE=639540; MF_MT_DEFAULT_STRIDE=720; MF_MT_ALL_SAMPLES_INDEPENDENT=1; MF_MT_FIXED_SIZE_SAMPLES=1; MF_MT_SAMPLE_SIZE=438480

    CMFTransformDetours::SetOutputType @0561F060 Succeeded MT: MF_MT_MAJOR_TYPE=MEDIATYPE_Video; MF_MT_SUBTYPE=MFVideoFormat_YV12; MF_MT_FRAME_SIZE=3092376453526 (720,406); MF_MT_FRAME_RATE=42949672960400000 (10000000,400000); MF_MT_GEOMETRIC_APERTURE=00 00 00 00 00 00 00 00 d0 02 00 00 96 01 00 00 ; MF_MT_PIXEL_ASPECT_RATIO=1743756722581(406,405); MF_MT_INTERLACE_MODE=7; MF_MT_DEFAULT_STRIDE=720; MF_MT_ALL_SAMPLES_INDEPENDENT=1; MF_MT_FIXED_SIZE_SAMPLES=1;MF_MT_SAMPLE_SIZE=438480

  3. User starts video playback.

  4. MF again sets input type and output type of the resizer transform:

    CMFTransformDetours::SetInputType @0561F060 Succeeded MT: MF_MT_MAJOR_TYPE=MEDIATYPE_Video; MF_MT_SUBTYPE=MFVideoFormat_YV12; MF_MT_FRAME_SIZE=3092376453536 (720,416); MF_MT_FRAME_RATE=107374182401 (25,1); MF_MT_GEOMETRIC_APERTURE=00 00 00 00 00 00 00 00 d0 02 00 00 96 01 00 00 ; MF_MT_MINIMUM_DISPLAY_APERTURE=00 00 00 00 00 00 00 00 d0 02 00 00 96 01 00 00 ; MF_MT_PAN_SCAN_APERTURE=00 00 00 00 00 00 00 00 d0 02 00 00 96 01 00 00 ; MF_MT_PIXEL_ASPECT_RATIO=1743756722581 (406,405); MF_MT_VIDEO_PRIMARIES=2; MF_MT_INTERLACE_MODE=7; MF_MT_VIDEO_NOMINAL_RANGE=2; MF_MT_TRANSFER_FUNCTION=5; MF_MT_YUV_MATRIX=1; MF_MT_AVG_BITRATE=639540; MF_MT_DEFAULT_STRIDE=720; MF_MT_ALL_SAMPLES_INDEPENDENT=1; MF_MT_FIXED_SIZE_SAMPLES=1; MF_MT_SAMPLE_SIZE=449280; MF_MT_COMPRESSED=0; MF_MT_AVG_BIT_ERROR_RATE = 0

    CMFTransformDetours::SetOutputType @0561F060 Succeeded MT: MF_MT_MAJOR_TYPE=MEDIATYPE_Video; MF_MT_SUBTYPE=MFVideoFormat_YV12; MF_MT_FRAME_SIZE=3092376453526 (720,406); MF_MT_FRAME_RATE=42949672960400000 (10000000,400000); MF_MT_GEOMETRIC_APERTURE=00 00 00 00 00 00 00 00 d0 02 00 00 a0 01 00 00 ; MF_MT_MINIMUM_DISPLAY_APERTURE=00 00 00 00 00 00 00 00 d0 02 00 00 96 01 00 00 ; MF_MT_PAN_SCAN_APERTURE=00 00 00 00 00 00 00 00 d0 02 00 00 96 01 00 00 ; MF_MT_PIXEL_ASPECT_RATIO=1743756722581 (406,405); MF_MT_VIDEO_PRIMARIES=2; MF_MT_INTERLACE_MODE=7; MF_MT_VIDEO_NOMINAL_RANGE=2; MF_MT_TRANSFER_FUNCTION=5; MF_MT_YUV_MATRIX=1; MF_MT_DEFAULT_STRIDE=720; MF_MT_ALL_SAMPLES_INDEPENDENT=1; MF_MT_FIXED_SIZE_SAMPLES=1; MF_MT_SAMPLE_SIZE=438480

  5. MediaObject of Resizer transform fails to process output:

    CMFTransformDetours::ProcessInput @0561F060 Stream ID 0, Sample @056F74C8, Time 80ms, Duration 40ms, Buffers 1, Size 449280B, {B4DD4A8C-0BEB-44C4-8B75-B02B913B04F0}=0;MFSampleExtension_Discontinuity=1;MFSampleExtension_CleanPoint=1;MFSampleExtension_Interlaced=0;MFSampleExtension_Token=@00000000 CMediaObjectDetours::ProcessInput @0561F078 MediaBuffer @0567AFE8, flags 0x00000007, Time 80ms, Duration 40ms, Size 449280B CMediaObjectDetours::ProcessOutput @0561F078 failed hr=0x80004005 E_FAIL CMFTransformDetours::ProcessOutput @0561F060 failed hr=0x80004005 E_FAIL

What would be the reason why ResizerMFT fails to process output after its input and output types were set for the second time? Is it something about properties of output type? Is there a way to get more info about this fail?

Any answer will be greatly appreciated.

video
ms-media-foundation
mft
asked on Stack Overflow Feb 18, 2016 by Denis

1 Answer

1

I'm not sure because hr=0x80004005 means "Unspecified Error", a very usefull information...

Looking at your problem, on Set (in/out) Type, the MF_MT_INTERLACE_MODE equals 7 : MFVideoInterlace_MixedInterlaceOrProgressive.

Perhaps you have this error when the stream is interlaced.

In your ProcessInput MF_MT_INTERLACE_MODE equals 0 : MFVideoInterlace_Unknown. Perhaps the problem comes from here.

answered on Stack Overflow Feb 18, 2016 by mofo77 • edited Feb 18, 2016 by mofo77

User contributions licensed under CC BY-SA 3.0