1

I am trying to write a video player which is able overlay video with text and image. Now I am using driectshow sample grabber filter to capture the video and present it on my software. It works fine, but it is very slow on less powerful systems like Atom. I also tried to use EVR Presenter as other people suggested. I used EVR Presenter from code project (EVR Presenter in pure C# with Direct3D Video Rendering) code example on Managed DirectX 9 Graphics and Game Programming, Kick Start to convert frame into texture and persent the converted texture to screen, sample code as shown:

    lock (m_csLock)
{
    if (systemSurface == null)
        systemSurface = Surface.CreateOffscreenPlain(m_Device, _surface.Description.Width, _surface.Description.Height, _surface.Description.Format, Pool.SystemMemory);

    if (texture == null)
        texture = new Texture(m_Device, systemSurface.Description.Width, systemSurface.Description.Height, 1, Usage.Dynamic, systemSurface.Description.Format, Pool.Default);

    using (Surface texturesurface = texture.GetSurfaceLevel(0))
    {
        m_Device.GetRenderTargetData(_surface, systemSurface);
        m_Device.UpdateSurface(systemSurface, texturesurface);
    }
}

But still the rendering speed is very slow and takes a lot of cpu power. May I know if there is a way to capture video or copy video frame to texture faster?

ncite
  • 533
  • 1
  • 4
  • 19

0 Answers0