2013-07-23 34 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找到。