作为 .NET 中的窗口渲染到视频输入/输出卡(例如 BlackMagic Design 的 Decklink)
我正在研究将视频输入/输出卡视为窗口的可能性,以便我可以从 .NET 向其渲染图形。它需要能够处理透明度,以便我可以在传入视频上设置渲染图形的关键帧。
我还没有找到任何能完全做到这一点的东西 - 一些 SDK 允许您渲染图形,但您必须使用它们的 API 来绘制它们,而不是使用标准 .NET WPF/Windows 窗体例程。
I am investigating the possibility of treating a video input/output card as a Window so that I can render graphics to it from .NET. It would need the ability to handle transparency so that I can key the rendered graphics over incoming video.
I haven't found anything that does exactly this - some SDKs allow you to render graphics, but you have to use their API to draw them, rather than using standard .NET WPF/Windows Forms routines.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将 Decklink 卡与 C# 一起使用,并执行与您想要执行的操作类似的操作。我使用通过 Graphics.FromImage() 创建的标准 Graphics 对象 (GDI+)。在每个帧完成的回调中,我在图形对象上绘制,然后获取指向连接的位图的指针,并将像素复制到 Decklink 视频帧缓冲区。在副本中,您可以对透明像素执行任何您想要的操作(不是复制并将输入保留在那里等等。)本质上您所需要的只是一个指向 ARGB 表面(或您设置的任何格式)的指针,然后您可以将其复制到 DeckLinks 帧缓冲区。
虽然我不使用视频输入(我正在对静止图像序列进行关键帧),但查看 API,复制输入帧,然后在其上绘制对象,然后将其复制到 API 看起来并不困难。输出缓冲区。 SDK 中有一些示例(大部分是本机代码,但很容易看到发生了什么),它们提供了一个互操作 dll,可以轻松地从 .net 访问 API。
您还应该查看一个黑魔法开发人员邮件列表。
布莱恩
I use the decklink cards with C# and do something similar to what you are looking to do. I use the standard Graphics object (GDI+) that I created using Graphics.FromImage(). At each frame completed callback I draw on the graphics object and then get a pointer to the connected bitmap and copy the pixels to the decklink video frame buffer. In the copy you can do whatever you want with the transparent pixels (not copy and leave the input there instead etc..) Essentially all you need is a pointer to an ARGB surface (or whatever format you're set up for) and you can copy it to the decklinks frame buffer.
Although I do not use a video input with it (I am keying over a still image sequence), looking at the API it does not look difficult to copy the input frame and then draw your objects on top of it and then copy it to the output buffer. There are some samples in the SDK (mostly in native code but it's easy to see what is going on) and they provide an interop dll which makes access to the API from .net easy.
There is a black-magic developers mailing list you should check out also.
Brian