I am using ffmpeg to decode an rtsp stream which is displayed using DirectShow I need to add text to the each video frame and I also need to record the video with the text added. I can’t therefore use DirectShow to overlay the text as it won’t be on the raw frame to be saved. The (not set in stone yet) requirement for the text is that it can be various fonts or sizes etc.
I presume then that I will need create the raw bitmap of my text and overlay this on top of my raw BGR image. I know how to write over the current image. What I do not know is how to get from Font XX, Size, XX, String XX to some raw data to overlay.
Can someone suggest what I should do or point me in the right direction. My low level code is in C/C++, but this is being driven from a C#.Net application.
Any help is appreciated.
Thanks.
You’ll have to get the device context (HDC) of the raw bitmap that you want to write the text on and do something like this: