如何在低分辨率WPF中播放视频? [英] How to Play a Video in Low Resolution WPF?

查看:163
本文介绍了如何在低分辨率WPF中播放视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!我正在制作一个视频播放器..主窗口包含2 MediaElements ,其中一个是全尺寸(应该以真实质量),另一个是如此之小(60x60),它应该显示同一视频的小预览并在搜索栏中显示为气球...

<我的问题是当我尝试播放高清视频时,应用程序使用了大量的CPU(+ 70%),因为它同时播放了两个完全高清的视频..所以我想要的是播放小视频分辨率非常低因此我可以降低CPU使用率, 来调整视频大小并保留在内存中。谢谢



这是我用于小视频的内容:

Hello there! I'm making a Video player.. main window contains 2 MediaElements, one of them is full size ( which supposed to show videos in its real quality ), and the other is so small ( 60x60 ) which is supposed to show small preview of the same video and appears as a balloon at the seekbar...
My Problem is when I try to play an HD video, the app use a lot of CPU (+70%) because it is playing two fully HD videos at the same time.. so what I want is to play the small video at very low resolution so I could decrease CPU usage, OR to resize Video and keep in Memory. Thanks

This what I use for the small Video:

<Ellipse Height="80" Width="80" Name="elipsemedia" HorizontalAlignment="Left" VerticalAlignment="Top" Stroke="White" StrokeThickness="5" >
    <Ellipse.Fill>
        <VisualBrush TileMode="None">
            <VisualBrush.Visual>
                <MediaElement x:Name="MediaPreview" Source="Source.mp4" Volume="0" ScrubbingEnabled="True" Stretch="UniformToFill" LoadedBehavior="Pause" Width="80" />
            </VisualBrush.Visual>
        </VisualBrush>
    </Ellipse.Fill>
</Ellipse>

推荐答案

这篇关于如何在低分辨率WPF中播放视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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