我正在写一个WMF定制的媒体来源。该源从RTSP流中获取h264数据包(使用FFMPeg 4.1),并将它们发送到解码器并使用EVR呈现给屏幕。它还将它们发送到编码器和文件编写器。
对于第一个~7秒的视频,在~7秒后,FPS从~30变到~2,而EVR将一个旧图像显示为一个伪影(它被显示而不是丢失的帧)。录像看上去很好。
运行MFTrace后,我发现呈现器停止发送MEStreamSinkRequestSample,因此有数据要发送的源(并像以前一样引发MEMediaSample )不会发送示例。样本只到达解码器的ProcessInput,我看不到ProcessOutput调用。根据我的日志,没有B帧(pt,==,dts),两者都是单调的,都有正常的时间戳。
这些是到达EVR的最后一个帧的日志行。
Line 149066: 552,1AA8 13:03:30.50129 CMFSourceReaderCallbackDetours::OnReadSample @0000027792F818B0 Stream index 0x0 Sample @000002779DB2FF80, Time 7266ms, Duration 33ms, Buffers 1, Size 620B, {73A954D4-09E2-4861-BEFC-94BD97C08E6E}=72666778 (0,72666778);MFSampleExtension_Token=@000002779DB1FA60;MFSampleExtension_DeviceTimestamp=72666778 (0,72666778);MFSampleExtension_CleanPoint=0;MFSampleExtension_Interlaced=0
Line 149100: 552,3F90 13:03:30.50182 CMFMediaStreamDetours::HandleEvent @0000027792FF7930 Sample @000002779DB2FF80, Time 7266ms, Duration 33ms, Buffers 1, Size 620B, {73A954D4-09E2-4861-BEFC-94BD97C08E6E}=72666778 (0,72666778);MFSampleExtension_Token=@000002779DB1FA60;MFSampleExtension_DeviceTimestamp=72666778 (0,72666778);MFSampleExtension_CleanPoint=0;MFSampleExtension_Interlaced=0
Line 149174: 552,3F90 13:03:30.50210 CMFTransformDetours::ProcessInput @0000027790451EE0 Stream ID 0, Sample @000002779DB2FF80, Time 7266ms, Duration 33ms, Buffers 1, Size 620B, {73A954D4-09E2-4861-BEFC-94BD97C08E6E}=72666778 (0,72666778);MFSampleExtension_Token=@000002779DB1FA60;MFSampleExtension_DeviceTimestamp=72666778 (0,72666778);MFSampleExtension_CleanPoint=0;MFSampleExtension_Interlaced=0
Line 166573: 552,A50 13:03:31.60248 CMFTransformDetours::ProcessOutput @0000027790451EE0 Stream ID 0, Sample @000002779DB2F980, Time 7266ms, Duration 33ms, Buffers 1, Size 1382400B, {19124E7C-AD4B-465F-BB18-20186287B6AF}=;{424C754C-97C8-48D6-8777-FC41F7B60879}=@0000000000000000;{79EA74DF-A740-445B-BC98-C9ED1F260EEE}=0;MFSampleExtension_CleanPoint=1;MFSampleExtension_Discontinuity=0;MFSampleExtension_Interlaced=0;{B4DD4A8C-0BEB-44C4-8B75-B02B913B04F0}=0
Line 166728: 552,A50 13:03:31.60276 CMFTransformDetours::ProcessInput @000002779041B330 Stream ID 0, Sample @000002779DB2F980, Time 7266ms, Duration 33ms, Buffers 1, Size 1382400B, {19124E7C-AD4B-465F-BB18-20186287B6AF}=;{424C754C-97C8-48D6-8777-FC41F7B60879}=@0000000000000000;{73A954D4-09E2-4861-BEFC-94BD97C08E6E}=83666778 (0,83666778);{79EA74DF-A740-445B-BC98-C9ED1F260EEE}=0;MFSampleExtension_Token=@0000000000000000;MFSampleExtension_DeviceTimestamp=83666778 (0,83666778);MFSampleExtension_CleanPoint=1;MFSampleExtension_Discontinuity=0;MFSampleExtension_Interlaced=0;{B4DD4A8C-0BEB-44C4-8B75-B02B913B04F0}=0
Line 166853: 552,A50 13:03:31.60482 CMFTransformDetours::ProcessOutput @000002779041B330 Stream ID 0, Sample @000002779DB25BC0, Time 7266ms, Duration 33ms, Buffers 1, Size 1843200B, MFSampleExtension_CleanPoint=1;MFSampleExtension_Interlaced=0
Line 166905: 552,A50 13:03:31.60500 CMFStreamSinkDetours::ProcessSample @000002779045A878 Sample @000002779DB25BC0, Time 7266ms, Duration 33ms, Buffers 1, Size 1843200B, {19124E7C-AD4B-465F-BB18-20186287B6AF}=;{424C754C-97C8-48D6-8777-FC41F7B60879}=@0000000000000000;{73A954D4-09E2-4861-BEFC-94BD97C08E6E}=83666778 (0,83666778);{79EA74DF-A740-445B-BC98-C9ED1F260EEE}=0;MFSampleExtension_Token=@000002779DB1F6A0;MFSampleExtension_DeviceTimestamp=83666778 (0,83666778);MFSampleExtension_CleanPoint=1;MFSampleExtension_Discontinuity=0;MFSampleExtension_Interlaced=0;{B4DD4A8C-0BEB-44C4-8B75-B02B913B04F0}=0
Line 166909: 552,A50 13:03:31.60503 CMFTransformDetours::ProcessInput @0000027790455960 Stream ID 0, Sample @000002779DB25BC0, Time 7266ms, Duration 33ms, Buffers 1, Size 1843200B, {19124E7C-AD4B-465F-BB18-20186287B6AF}=;{424C754C-97C8-48D6-8777-FC41F7B60879}=@0000000000000000;{73A954D4-09E2-4861-BEFC-94BD97C08E6E}=83666778 (0,83666778);{79EA74DF-A740-445B-BC98-C9ED1F260EEE}=0;MFSampleExtension_Token=@000002779DB1F6A0;MFSampleExtension_DeviceTimestamp=83666778 (0,83666778);MFSampleExtension_CleanPoint=1;MFSampleExtension_Discontinuity=0;MFSampleExtension_Interlaced=0;{B4DD4A8C-0BEB-44C4-8B75-B02B913B04F0}=0
Line 166918: 552,A50 13:03:31.60510 CMFTransformDetours::ProcessOutput @0000027790455960 Stream ID 0, Sample @000002779045EF00, Time 7266ms, Duration 33ms, Buffers 1, Size 409920B, , Duration 33ms, Buffers 1, Size 409920B,还有以解码器结尾的日志行。
Line 149726: 552,260 13:03:30.53399 CMFSourceReaderCallbackDetours::OnReadSample @0000027792F818B0 Stream index 0x0 Sample @000002779DB2F500, Time 7300ms, Duration 33ms, Buffers 1, Size 662B, {73A954D4-09E2-4861-BEFC-94BD97C08E6E}=73000000 (0,73000000);MFSampleExtension_Token=@000002779DB1F640;MFSampleExtension_DeviceTimestamp=73000000 (0,73000000);MFSampleExtension_CleanPoint=0;MFSampleExtension_Interlaced=0
Line 149760: 552,3F90 13:03:30.53446 CMFMediaStreamDetours::HandleEvent @0000027792FF7930 Sample @000002779DB2F500, Time 7300ms, Duration 33ms, Buffers 1, Size 662B, {73A954D4-09E2-4861-BEFC-94BD97C08E6E}=73000000 (0,73000000);MFSampleExtension_Token=@000002779DB1F640;MFSampleExtension_DeviceTimestamp=73000000 (0,73000000);MFSampleExtension_CleanPoint=0;MFSampleExtension_Interlaced=0
Line 149834: 552,3F90 13:03:30.53471 CMFTransformDetours::ProcessInput @0000027790451EE0 Stream ID 0, Sample @000002779DB2F500, Time 7300ms, Duration 33ms, Buffers 1, Size 662B, {73A954D4-09E2-4861-BEFC-94BD97C08E6E}=73000000 (0,73000000);MFSampleExtension_Token=@000002779DB1F640;MFSampleExtension_DeviceTimestamp=73000000 (0,73000000);MFSampleExtension_CleanPoint=0;MFSampleExtension_Interlaced=0 MFTrace事件(过滤“Met=”) MEStreamSinkRequestSample= 305 MEMediaSample= 213
Line 151717: 552,3F90 13:03:30.63479 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F680,
Line 152202: 552,3F90 13:03:30.63838 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 152377: 552,3F90 13:03:30.66791 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F5C0,
Line 152862: 552,3F90 13:03:30.67133 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 153037: 552,3F90 13:03:30.70149 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB30280,
Line 153522: 552,3F90 13:03:30.70538 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 153697: 552,2DD4 13:03:30.73484 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 154182: 552,2DD4 13:03:30.73861 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 154357: 552,3F90 13:03:30.76793 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FD40,
Line 154842: 552,3F90 13:03:30.77171 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 155017: 552,3CE4 13:03:30.80114 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FC80,
Line 155502: 552,3CE4 13:03:30.80453 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 155677: 552,3CE4 13:03:30.83483 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FF80,
Line 156162: 552,3CE4 13:03:30.83832 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 156337: 552,A50 13:03:30.86834 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F500,
Line 156822: 552,A50 13:03:30.87180 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 156997: 552,3CE4 13:03:30.90157 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FB00,
Line 157482: 552,3CE4 13:03:30.90504 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 157657: 552,3CE4 13:03:30.93457 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @0000027790460240,
Line 158142: 552,3CE4 13:03:30.93822 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 158317: 552,3CE4 13:03:30.96831 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F680,
Line 158802: 552,3CE4 13:03:30.97161 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 158977: 552,2DD4 13:03:31.00100 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F5C0,
Line 159462: 552,2DD4 13:03:31.00419 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 159637: 552,2DD4 13:03:31.03442 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB30280,
Line 160122: 552,2DD4 13:03:31.03824 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 160297: 552,2DD4 13:03:31.06790 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 160930: 552,2DD4 13:03:31.07260 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 161105: 552,A50 13:03:31.10179 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 161443: 552,A50 13:03:31.13445 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 161781: 552,A50 13:03:31.16811 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 162119: 552,A50 13:03:31.19194 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 162457: 552,A50 13:03:31.23510 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 162795: 552,A50 13:03:31.26862 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 163133: 552,A50 13:03:31.30162 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 163463: 552,A50 13:03:31.33445 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FD40,
Line 163781: 552,A50 13:03:31.36811 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB30280,
Line 164099: 552,A50 13:03:31.40173 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F5C0,
Line 164417: 552,A50 13:03:31.43510 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F680,
Line 164735: 552,A50 13:03:31.46827 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @0000027790460240,
Line 165053: 552,A50 13:03:31.50162 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FB00,
Line 165371: 552,A50 13:03:31.53487 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F500,
Line 165689: 552,A50 13:03:31.56838 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FF80,
Line 166174: 552,A50 13:03:31.57268 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 166349: 552,A50 13:03:31.60165 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FC80,
Line 166934: 552,A50 13:03:31.60533 CMFStreamSinkDetours::EndGetEvent @000002779045A878 Met=305 (null), value (empty),
Line 167109: 552,3CE4 13:03:31.63434 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2F980,
Line 167427: 552,3CE4 13:03:31.66812 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @000002779DB2FB00,
Line 167745: 552,3CE4 13:03:31.70109 CMFMediaStreamDetours::EndGetEvent @0000027792FF7930 Met=213 (null), value @0000027790460240,如果你认为更多的数据是需要的,并可以指示我的方向,评论这个问题,我会添加尽可能多的fas与编辑标题。
发布于 2018-12-18 09:38:01
我试图解决这个问题的想法之一是用ffmpeg进行解码,并将未压缩图像(I420)传递给媒体基金会。这为我解决了这个问题。由此我得出结论,问题在于h264解码器没有很好地处理实时流。
https://stackoverflow.com/questions/53467198
复制相似问题