2 个用 c# 编写的 DirectShow 视频
我想要有 2 个视频窗口播放一个(现在是同一文件)视频。由于我对 C# 和 DirectShow 还很陌生,因此我遇到了问题,并且还没有找到任何多视频解决方案的工作示例。我可以让它在示例中的 1 个窗口中工作,并且想知道要使第 2 个窗口工作还需要什么。我是否还需要为第二个创建一个单独的过滤器,或者只是摆弄手柄就足够了?
I would like to have 2 video windows playing a (same file for now) video. As I'm still new to c# and DirectShow I'm having problems with this and haven't found any working examples for multi-video solutions. I can get it to work for 1 window from samples, and would like to know what else is required to get the 2nd window working. Do I need to create a separate filter for the 2nd one aswell, or just fiddling around with the handles is enough?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在多视频渲染方面面临哪些问题?
据我所知,您需要为每个要渲染的视频流创建一个图形,即每个流一个源/(变换)/渲染链。我不认为使用单个渲染过滤器并使用窗口句柄会起作用(但我可能是错的)。
如果您需要在两个不同的窗口中播放相同的视频文件,只需在源过滤器之后(或在解压缩过滤器之后)连接一个 Smart Tee 过滤器,然后将渲染过滤器连接到每个 Smart Tee 的输出引脚即可。
如果您想要一种简单的方法来测试 Directshow 图形,请使用 GraphEdit (可在 DirectX SDK 和互联网上的许多其他地方)。
What problems are you facing for multi-video rendering ?
As far as I know, you need to create one graph per video stream you want to have rendered, i.e. one Source/(Transform)/Render chain per stream. I don't think using a single render filter and playing with the windows handles is going to work (but I may be mistaken).
If you need to play the same video file in two different windows, just connect a Smart Tee filter after your source filter (or after your decompression filters), and connect a render filter to each of the Smart Tee's output pins.
If you want an easy method to test Directshow graphs, use GraphEdit (available in the DirectX SDK and in many other places on the Internet).