WPF:MediaElement中的视频颜色不同于Windows Media Player [英] WPF: Video colors in MediaElement different from Windows Media Player

查看:476
本文介绍了WPF:MediaElement中的视频颜色不同于Windows Media Player的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到(在我的Vista 64位机器),在WPF MediaElement中显示的视频具有不同于在Windows Media Player中播放时的颜色。在MediaElement里面,视频有一个略微去饱和的外观,对比度较低。

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

我试过的视频是WMV视频,是由不同的人用不同的工具,所以我排除了视频材料的问题。所有Windows Media Player中的视频设置滑块(色相,饱和度,亮度,对比度)都是默认值。

The videos I have tried so far are WMV videos that were produced by different people with different tools, so I'd rule out problems with the video material. All "Video Settings" sliders in Windows Media Player (Hue, Saturation, Brightness, Contrast) are on their default values.

这是为什么我怀疑软件,它广泛使用动画不透明度和内容放在视频上。

That's why at first I suspected an issue in my software which is making extensive use of animated opacity and content being placed over the video.

但我已经能够通过一个简单的测试程序重现行为,XAML看像这样:

But I have been 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?

推荐答案

因为我很确定MediaElement将使用XP上的VMR9和Vista上的EVR,您可能会看到解释的行为这里

Since I'm pretty sure the MediaElement will use the VMR9 on XP and the EVR on Vista, you might be seeing the behavior explained here

我猜Windows Media Player使用VMR7或默认的视频渲染器,因此没有这种行为。或者Microsoft以某种方式得到了补偿。

I'm guessing Windows Media Player uses either the VMR7 or default Video Renderer so it doesn't have that behavior. OR Microsoft has compensated in some way.

这篇关于WPF:MediaElement中的视频颜色不同于Windows Media Player的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆