从内存流播放视频文件
只是好奇看看这是否可能。我有一个 Windows 应用程序,它从我的电脑上的 .avi 文件读取所有字节,然后将其存储在 byte[] 中。现在我的内存中有 avi 文件,我想直接从内存将其加载到某种视频播放器控件中。我尝试过使用 wmplayer 控件,显然这是不可能的。我读过有关使用 DirectShow 和 VLC 插件的建议,但我不知道从哪里开始使用这两个插件,而且我还没有看到任何示例代码。有人有任何想法来详细说明上述插件,或者有不同的方法吗?
Just curious to see if this is possible. I have a windows application that reads all the bytes from a .avi file situated on my pc and then stores it in a byte[]. So now I have the avi file in memory, and I want to load it into some sort of a video player control, directly from memory. I've tried using the wmplayer control, apparently this is not possible. I've read suggestion about using the DirectShow and VLC plugins, but I have no idea where to even start using those two and I haven't seen any sample code of this being down. Anybody have any ideas to elaborate on the mentioned plugins, or have a different approach to it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 DirectShow,可能需要内存中的源过滤器。我不知道这样的过滤器可用,但可以基于 来自 DirectShow 示例的异步过滤器示例。不过这是在 C++ 中。
对于 .NET,可以使用 DirectShow.NET 库。 GSSF 过滤器示例可能是内存中源过滤器实现的良好开端。该库还为 DirectShow 提供 COM Interop,可用于构建实例化此过滤器的测试播放器应用程序。
For DirectShow, an in-memory source filter may be required. I am not aware of such a filter being available, but one can be based on Async Filter Sample from DirectShow samples. This is in C++ though.
For .NET, DirectShow.NET library can be used. A sample GSSF filter there may be a good start for an in-memory source filter implementation. This library also provides COM Interop for DirectShow that could be used to build a test player application that instantiates this filter.