Forrest
Forrest

Reputation: 599

How to write directshow filter to process two input sources?

I want to look for some source codes about directshow, which implement this feature : Implement one image process filter for two input video source pins, and render the result.

For example, open two video files, process each frame from two videos , then composite those two frames into only one output frame.

Are there any existing filter implementation or framework source codes ?

Thanks

Upvotes: 0

Views: 2393

Answers (2)

Geraint Davies
Geraint Davies

Reputation: 2847

You can use the stock VMR filter to perform alpha-blending without any special code, as long as you are only going to render the output. Just feed the two videos into separate pins on the same VMR instance.

If you want to save the mixed output, you'll need to do the mixing yourself (or write a custom allocator-presenter plugin for the VMR filter).

G

Upvotes: 0

Francis
Francis

Reputation: 12018

Just implement 2 pins for input connections. Get a sample from DirectX SDK and change input pin number to 2 if it's only one.

Also found some doc and sample for you here.

Upvotes: 1

Related Questions