模拟电视流上的新闻字幕-C# [英] News Marquee over analog TV stream - C#

查看:104
本文介绍了模拟电视流上的新闻字幕-C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用c#在模拟电视流上放置新闻字幕,我可以使用DirectShow进行模拟电视流,但是我不知道如何将其与旋转文本混合使用,是否应该创建过滤器?还是我必须使用DirectShow以外的其他技术?

I want to put a news marquee over an analog TV stream using c#, I can stream analog TV using DirectShow but I can't figure out how to mix it with rotating text, should I create a filter? or I have to use another technology than DirectShow?

推荐答案

DirectShow是执行此操作的最简单方法,但是它确实有一些学习曲线,尤其是来自C#的学习曲线. Wikipedia页面为您提供DirectShow的基本概述.

DirectShow is the simplest way of doing this but it does have a bit of a learning curve, particularly coming from C#. The Wikipedia page gives you a basic overview of DirectShow.

DirectShow工具.使用C ++进行DirectShow编程更直接,但是您可以通过COM interop或DirectShow.net(我尚未尝试过)很容易地使用DirectShow.如果使用COM interop,则以下文章会有所帮助:

DirectShow tools are available in the latest Windows SDK. Using C++ for DirectShow programming is more straightforward but you can use DirectShow fairly easily via COM interop or DirectShow.net (which I haven't tried yet). If using COM interop the following article is helpful:

http://blogs.msdn.com/b/ericgu/archive/2004/09/20/232027.aspx

如果动画效果足够流畅,则可以使用VMR覆盖滤镜.请参阅以下文章

You may be able to use the VMR overlay filter if the animation performance is smooth enough. See the following articles

http://www.codeproject.com/KB/audio-video/VideoPicture.aspx
http://www.codeproject.com/KB/audio-video/Ticker.aspx
http://msdn.microsoft.com/zh-我们/library/dd407344(v=vs.85).aspx

http://www.codeproject.com/KB/audio-video/VideoPicture.aspx
http://www.codeproject.com/KB/audio-video/Ticker.aspx
http://msdn.microsoft.com/en-us/library/dd407344(v=vs.85).aspx

或者,您将需要编写自己的过滤器,以使每个帧上的文本与视频帧的时间戳同步地调整其位置.如果您只需要在自己的应用程序中执行此操作,则以下方法可能是最简单的

Alternatively you will need to write your own filter that renders the text on each frame adjusting its position in synch with the time stamps of the video frames. If you only need to do this inside your own application then the following approach might be easiest

http://www.sichbo.ca/Free_Code/100_C_Sharp_directshow_filters

出于性能原因,Microsoft官方建议使用C ++创建DirectShow筛选器,但在C#中应覆盖滚动文本,因为如果您进行仔细编程,瓶颈将是用于覆盖文本的API.

Microsoft officially recommend that DirectShow filters should be created in C++ for performance reasons but overlaying scrolling text should be OK in C# as the bottleneck will be the APIs used to overlay the text if you program carefully.

这篇关于模拟电视流上的新闻字幕-C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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