C# 中的流畅视频渲染
我正在尝试找到一种在 WPF 中渲染视频的方法,其 CPU 使用率低于 MediaElement。 目标是像 C++ 编程中的 Direct3D/DirectDraw 视频渲染一样流畅且低 CPU 视频播放。
我尝试使用Direct2D(带有WindowsAPICodePack)来渲染视频,结果是CPU使用率很低,但问题是我无法平滑地渲染视频,因为没有像C++中的DirectX那样精确的计时器来精确更新视频。
也许我需要回到 C++ 世界来原生使用 Direct3D,并在 C# WPF 窗口中通过 DirectX 窗口托管 C++。尽管我不知道会发生什么,但我想可能值得尝试。
如果你们有任何建议,请告诉我。
I am trying to find a way to render video in WPF with lower CPU usage than MediaElement.
The goal is smooth and low CPU video playback as much as Direct3D/DirectDraw video rendering in C++ programming.
I tried Direct2D(with WindowsAPICodePack) to render video, and the result is CPU usage is pretty low, but the problem is that I have no way to render video smoothly since there's no accurate timer to update video at exact time like DirectX in C++.
Maybe I need to go back to C++ world to use Direct3D natively and hosting C++ with DirectX window in C# WPF window. Even though I don't know what will happen with that, it may worth to try, I guess.
If you guys have any advise, please let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试编写一个小型 XNA 应用程序来渲染视频和 将其嵌入到您的 winform 中
You could try writing a small XNA app to render the video and embed that into your winform