JD Prasad

Hi All,

I m novice to DirectShow application programming and this is my first project in my career.I have to make an application which plays a movie file and superimposes the text upon it.Can i have the sample code please for reference.

In this project i m able to run the movie file by using the sample code given in MSDN, after that i dont have any idea to how to display text.please help me Asap.

Thanks for your time

JD Prasad




Re: DirectShow Development Superimposing of text on moving video in DirectShow

LGS

There are several ways I can think of to do this.

1) Use the vmr to overlay a text stream

2) Use SampleGrabber to get a buffer and write your text on it with GDI methods.

3) Write your own transform filter and add it to the graph.

I expect some google searches might also turn up some hits.

If it were me, I'd probably go with #2, but that's mostly because I use SG a lot.





Re: DirectShow Development Superimposing of text on moving video in DirectShow

JD Prasad

Can u provide Sample piece of code




Re: DirectShow Development Superimposing of text on moving video in DirectShow

LGS

I'm afraid I do most of my coding in c# these days. Not sure that would be useful to you.





Re: DirectShow Development Superimposing of text on moving video in DirectShow

Xancholy

I'm coding in C#, so this is of interest to me. I would really appreciate seeing a code sample to use SampleGrabber and GDI methods to overlay formatted text on running video. Thanks for any help




Re: DirectShow Development Superimposing of text on moving video in DirectShow

LGS

Are you using http://DirectShowNet.SourceForge.Net If so, doesn't the DxText sample do some of this

--

Co-author of DirectShowNet





Re: DirectShow Development Superimposing of text on moving video in DirectShow

Xancholy

Thank you ! I looked over those samples and I found the text overlay....but I did not see a logo overlay for live video...

Could you please show me how to overlay a logo on running video




Re: DirectShow Development Superimposing of text on moving video in DirectShow

LGS

Perhaps one of the other samples would show how to do this. Have you looked I see one named DxLogo. Sounds promising.



Re: DirectShow Development Superimposing of text on moving video in DirectShow


Re: DirectShow Development Superimposing of text on moving video in DirectShow

sunwei2004

U can find a example in the DIRECTXSDK9.0, it's location is :

C:\DXSDK\Samples\C++\DirectShow\VMR9\Watermark

hope this can help u:)






Re: DirectShow Development Superimposing of text on moving video in DirectShow

Grattier

Hi,

I'm actually looking for something similar.. I want to add text but not for the entire movie.. and also, at the end, I want to add black frames with text on it or image

Thanks for help





Re: DirectShow Development Superimposing of text on moving video in DirectShow

Bowljoman

I started collecting some of my more useful classes and am slowly making them available.
try AutoDC from my link below. It is hardwired to 320 X240 X32 but easily parameterized as I have in another project.
Code Snippet


CAutoDC*adc;



adc=new CAutoDC;


//then after construction pass it a *buffer and some *text



adc->TextSample (FinalMix,this->text );

//where FinalMix is the media sample buffer





You could use the hobby project Im working on which can play an AVI, into another sourcefilter. The sourcefilter can run independantly of the avi so you could start the avi at any time and continue those black frames you want. Updateable text as well.

The project primarily blends 1 or 2 capture devices which you are promted for, however you can opt for only one and just load your file to accomplish your task. then use the source filter in amcap. Heck you can 'Picture in Picture' your smiling face over the vid.

The source filter and mixer uses sockets to comunicate to AMcap thus triggering a security alert.


Slowly the classes will all be posted that are making up the mixer.
http://saladbowlguitar.com/code/
you are warned not to load the source filter into the mixer itself. I dont check against it and it will loop to itself through the socket.