[英]How to create a DirectShow graph which would wait for incoming images and add them as frames into video file?
How to create a DirectShow graph which would wait for incoming images and add them as frames into video file? 如何创建一个DirectShow图形,它将等待传入的图像并将其作为帧添加到视频文件中?
Using GraphEdit or with C\\C++\\C# 使用GraphEdit或C \\ C ++ \\ C#
So I want to have a graph which would work and wait for images incoming into him in any way you think is most easy (for example We can have a folder from where DSfilter would be able to take images) and insert that images as new frames of our video. 因此,我希望有一个可以工作的图形,并等待以您认为最简单的任何方式(例如,我们可以拥有一个文件夹,DSfilter可以在其中拍摄图像)将图像插入他的图像,并将其作为新帧插入我们的视频。
So how to do it? 那怎么办呢?
You need a source filter, multiplexor and file writer. 您需要一个源过滤器,多路复用器和文件编写器。 The multiplexor and file writer are stock components, but the source filter will be a custom filter.
多路复用器和文件编写器是常用组件,但是源过滤器将是自定义过滤器。 Look at the app source example on www.gdcl.co.uk for an example of a custom source filter that you can feed with frames from your app.
在www.gdcl.co.uk上查看应用程序源示例,以获取自定义源过滤器的示例,您可以将其与应用程序中的框架一起使用。
The graph will not be time-sensitive: the multiplexing is based on the timestamps attached to the samples, not on the elapsed time. 该图将不会对时间敏感:多路复用是基于样本的时间戳,而不是经过的时间。 So you set the graph running, and as a frame arrives, you attach a timestamp to it and deliver it via the source filter to the mux.
因此,您将图形设置为运行,并在到达帧时,将时间戳记附加到该时间戳记,并将其通过源过滤器传递到多路复用器。
G G
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.