Drawing a video with text on top

I am working on an application and I have a problem that I just cannot find a solution to. The application is written in vC ++. What I need to do is display a YUV video feed with text on top of it.

Now it works correctly, drawing text in the OnPaint method, using GDI and video on the DirectDraw overlay. I need to get rid of the overlay because it causes a lot of problems. It will not work on some graphics cards, Vista, 7, etc.

I cannot find a way to complete the same thing in a more compatible way. I can draw a video using DirectDraw with a reverse buffer and just copy it to the primary buffer. The problem here is that the text drawn in GDI is blinking due to the number of video updates being updated. I would really like the code to not draw text, if possible, as it works well.

Is there a way to draw text directly in the DirectDraw buffer or in the memory buffer or something else and then delete it in the back buffer? Should I look at another method together? The two important OSs are XP and 7. If anyone has any ideas, just let me know and I'll check them out. Thanks.

+6
windows-7 windows-xp gdi directshow directdraw
source share
2 answers

Try exploring DirectShow and the Ticker sample at microsoft.com:

DirectShow ticket example

This example uses the Video Mixing Renderer to mix video and text. It uses the IVMRMixerBitmap9 interface to mix text at the bottom of the video window.

DirectShow is intended for constructing graphs of filters for playing audio or video streams, adding various filters for various effects, and manipulating video and audio samples.

+2
source share

Instead of using Video Mixing Renderer DirectShow, you can also use the ISampleGrabber interface. The advantage is that it is a filter that can be used with other visualization tools, for example, when you do not display the video on the screen, but transfer it over the network or upload it to a file.

+1
source share

All Articles