WPF: Non Windows Media Player Video Colors in MediaElement

I noticed (on my 64 bit Vista machine) that the video displayed in WPF MediaElement has different colors than when played in Windows Media Player. Inside the MediaElement, the video has a slightly desaturated appearance with lower contrast.

The videos I've tried so far are WMV videos that were created by different people with different tools, so I would rule out video footage issues. All Video Settings sliders in Windows Media Player (hue, saturation, brightness, contrast) have default values.

This is why at first I suspected that the problem in my software was making heavy use of animated opacity and content being placed over the video.

But I was able to reproduce the behavior with a simple test program where the XAML looks like this:

<Window x:Class="MediaElementTest.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">

    <MediaElement Source="D:\Test\Video.wmv" />
</Window>

      

Am I doing something wrong? Is there a workaround?

+2


source to share


2 answers


Since I'm pretty sure MediaElement will use VMR9 on XP and EVR on Vista, you can see an explanation of the behavior here



I am assuming Windows Media Player uses either VMR7 or Video Renderer by default, so it doesn't have this behavior. OR Microsoft has compensated somehow.

+2


source


If you support your graphics card, sometimes there are some software options to fix this.

If you have an NVidia card, go to your NVidia dashboard. Click "Video" in the options tree. Select your monitor and click the "With NVidia settings" radio button. On the Advanced tab, select Dynamic Range 0-255.



Here it is!

+2


source







All Articles