locked
High performance, Full HD (1920x1080) video player RRS feed

  • Question

  • Hi,

    My company and I are currently working on a WPF application for a client who wishes to overlay, at runtime, specific information on top of a full hd video.

    We are nearing the first test phase release date, and we are facing horrific problems. So far, we are able to perfectly animate and present the various overlay data, but the video is now very laggy, though the term is probably not appropriate. Let's just say the video is not playing in a smooth fashion, and desynchronizes from the overlay data, as frames seem to be skipped, in a non predictable way.

    We have tried every possible solution we came accross, including Wpf MediaElement, VlcDotNet player, WpfMediaToolkit player, ...
    The only way the video is playing correctly is to play it with DirectShow, which has its whole lot of problems, including the fact we are therefore forced to use a WndHost, which goes topmost of my overlay window, save with the clipping box trick, which however prohibits (or at least restricst in an inacceptable way) the use of transparency.

    I know WPF has a variable framerate, and I understand this is the reason why my video (and only the video) is outputed in an non-smooth fashion, for it requires a fixed framerate (29.970029 to be specific).

    We are stuck with this aweful problem, and no solution seem to be appropriate. Has anyone knowledge of a trick/turnaround/solution to this problem? Even a thrid-party tool, of a reasonable price, would do the trick for us.
    All we want is to ensure perfect playback quality with no, or very little change, to our main UI.

    Thanks in advance for both the time and help,

    Chad


    • Edited by Chad333 Friday, December 19, 2014 3:51 PM
    Friday, December 19, 2014 3:47 PM

Answers

  • Hello Chad,

    WPF MediaElement uses the WMP OCX, with a customized renderer.  This means you pay the cost of the full WMP player OCX, which includes some extra stuff.  So as far as I know, the performance problem about WPF Media Element play vidio is hard to fix. Possible solutions may related to your hardware and your video. You may need to take actions on them.

    All I said above is just about WPF embed MediaElement and not any other libraries. I was only allowed to talk about this library, not any other libraries and hope you can understand.

    I will recommend you use your favorite search engine to get some libraries and raise the question on those library related forum. 

    For example, if you choose to use this kit: http://wpfmediakit.codeplex.com/ and find you have problem use it, you can try the discussion part.

    Best regards,



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 22, 2014 8:11 AM

All replies

  • Additional notes:

    We tried to somehow "force" wpf to adopt a fixed framerate, but this seems impossible.

    The following test was made:

    public class TestWindow
    : Window
    {

    private int _RenderedFrames;
    private System.Timers.Timer _Timer;
    private System.Diagnostics.StopWatch _Stopwatch;

    public TestWindow()
    :base()
    {
    _Timer = new System.Timers.Timer(33);
    _Timer.Elapsed += eh_Timer_Elapsed;
    _Stopwatch = new System.Diagnostics.StopWatch();
    this.Loaded += eh_Loaded;
    }

    private eh_Loaded(object sender, eventargs e)
    {
    _Stopwatch .Start();
    _Timer.Start();
    }

    private eh_Timer_Elapsed(object sender, eventargs e)
    {
    _RenderedFrames += 1;
    if(_Stopwatch.Elapsed.TotalMilliseconds > 10000)
    {
    _Stopwatch.Reset();
    _Stopwatch.Stop();
    MessageBox.Show(_RenderedFrames.ToString());
    }
    }

    }

    The result is both absurd and frustrating: 214... What in the nine hells is going on? WPF or not, my damn timer should fire every 33ms and increment the _RendererFrames int of 1. In 10 seconds, I should have had about 30*10=300!!!

    Friday, December 19, 2014 4:51 PM
  • Hello Chad,

    WPF MediaElement uses the WMP OCX, with a customized renderer.  This means you pay the cost of the full WMP player OCX, which includes some extra stuff.  So as far as I know, the performance problem about WPF Media Element play vidio is hard to fix. Possible solutions may related to your hardware and your video. You may need to take actions on them.

    All I said above is just about WPF embed MediaElement and not any other libraries. I was only allowed to talk about this library, not any other libraries and hope you can understand.

    I will recommend you use your favorite search engine to get some libraries and raise the question on those library related forum. 

    For example, if you choose to use this kit: http://wpfmediakit.codeplex.com/ and find you have problem use it, you can try the discussion part.

    Best regards,



    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 22, 2014 8:11 AM