如何知道我的 WPF 应用程序可以播放哪些视频格式?
我有一个允许播放视频的小应用程序。首先,我不限制用户选择特定类型的文件。我想要做的是确保我可以播放用户选择的文件。如何获取可用编解码器的列表,或查询 WPF 应用程序(MediaElement
控件)的播放质量?
建议的替代方案是在播放之前将任何选定的输入文件转换为统一格式(例如 MPEG),但这似乎更困难。
I have a small application that allows the playback of videos. First off, I do not restrict the user to select particular types of file. What I want to do is make sure I can play the file the user selected. How do I get a list of available codecs, or query the playback qualities of the WPF application (the MediaElement
control)?
The alternative proposed is to convert any selected input file to a uniform format (for example, MPEG) before it's played, but that seems to be more difficult.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么不呢:
执行此操作时,您始终可以隐藏媒体元素。这比任何预先计算支持和不支持的尝试都要可靠得多。
Why don't you:
You could always make the media element hidden while you did this. This will be much more reliable than any attempt to pre-calculate what is and isn't supported.