2013-07-23 97 views
1

我正在使用WPF MediaKit呈现directshow图形。如果wpf D3DRender很小,显示帧率会很好。如果我增加显示器的大小(即控制),帧率会显着下降。WPF MediaKit用于VMR9的大显示器的低帧速率

如何防止帧率下降?我的显示器需要偶尔全屏显示图形,这会导致帧率下降到不可接受的值。我听说EVR(增强视频渲染)比VMR9好很多。当增加显示器尺寸时,EVR是否会保持帧速率?

+0

EVR(增强型视频渲染器)比VMR-9(视频混合渲染器9)提供更好的性能和更好的图像质量 您可以在这里找到有用的链接[1](http://directshownet.sourceforge.net/about。 html)和[2](http://www.codeproject.com/Articles/419286/EVR-Presenter-in-pure-Csharp-with-Direct3D-Video-R) – Steven

+0

EVR优于VMR-9,但是您遇到的问题可能是由其他问题引起的,例如最大限度地使用CPU或数据带宽。 –

+0

尝试使用最新的[WPF-Media](https://github.com/Sascha-L/WPF-MediaKit)工具包资源,并进行一些D3DRenderer优化。 – xmedeko

回答

1

当初始化directshow图时,您应指定视频压缩编解码器(MediaSubType)。当使用默认压缩方式从网络摄像机捕捉视频时,我遇到了同样的问题(在我的例子中是YUY2)。

实施例:

/// <summary> 
/// Configures the DirectShow graph to play the selected video capture 
/// device with the selected parameters 
/// </summary> 
private void SetupGraph() 
{ 
    ... 

    if (UseYuv && !EnableSampleGrabbing) 
    { 
     /* Configure the video output pin with our parameters and if it fails 
     * then just use the default media subtype*/ 
     if (!SetVideoCaptureParameters(graphBuilder, m_captureDevice, MediaSubType.YUY2)) 
      SetVideoCaptureParameters(graphBuilder, m_captureDevice, Guid.Empty); 
    } 
    else 
     /* Configure the video output pin with our parameters */ 
     SetVideoCaptureParameters(graphBuilder, m_captureDevice, MediaSubType.MJPG); // Change default compression to MJPG. 

    ... 
} 

实施例可以在WPFMediaKit.DirectShow.MediaPlayers.VideoCapturePlayer找到。