如何在C#中使用DirectShowLib将图像与USB捕获设备的视频流混合 [英] How can I mix Image with a Video stream from USB capture device using DirectShowLib in C#

查看:358
本文介绍了如何在C#中使用DirectShowLib将图像与USB捕获设备的视频流混合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在窗口中显示视频流。我在C#中使用DirectShow VideoMixingRenderer9。我创建了一个带有文本的图像。现在,我如何将该图像与视频流混合,以便在捕获窗口中同时显示视频流和文本。我尝试使用ISampleGrabber过滤器,但它不适用于所有视频设备,并且捕获屏幕仅显示黑色背景的文本,而没有视频流。因此,我不想使用ISampleGrabber过滤器。

I'm able to show a video stream in a window. I'm using DirectShow VideoMixingRenderer9 in C#. I have created an Image with sometext in it. Now, how can I mix this image with the video stream so that both video stream and text is shown in the capture window. I tried with ISampleGrabber filter but it doesn't work with all video device and capture screan only shows the text with black background but no video stream. So I don't want to use ISampleGrabber filter.

推荐答案

IVMRMixerBitmap9接口应该对您有所帮助,该接口由VMR实现。这是MSDN的链接:

IVMRMixerBitmap9 interface should help you, which is implemented by the VMR. This is the link to MSDN:

[http://msdn.microsoft.com/zh-cn/library/windows/desktop/dd390451(v = vs.85 ).aspx] [1]

[http://msdn.microsoft.com/en-us/library/windows/desktop/dd390451(v=vs.85).aspx][1]

位图需要具有alpha值,以便可以与渲染的视频混合。

The bitmap needs to have alpha values so that it can be blended with the rendered video.

这篇关于如何在C#中使用DirectShowLib将图像与USB捕获设备的视频流混合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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