Displaying text is a bit same as displaying an image over video which I stated previously in my blog also.
The Actual Work
Displaying text over video means, that first we need to create a bitmap then we will write our text over that bitmap, and that bitmap will be blended with the running video with the help of VMR9.
Need Some Control Over Mixing
The thing that is vital, Is some preferences which we need to set. Actually if you display an image over video, You don’t need much control over actual blending, Because if an image is a bit is scaled or changed it is difficult to catch it, But in the case of text you can’t accept such situation. Because if text is a bit scaled or changed it would be much harder to read it. So first of all we need to tell the mixer to not scale our text. The interface which will come to save us is IVMRMixerControl9. Here we request point filtering instead of bilinear filtering (which is default) to improve the text quality. If you are not scaling the app Image, you should use point filtering.
pVmr->QueryInterface( IID_IVMRMixerControl9, (void**) &pMix);
DWORD dwPrefs=0;
pMix->GetMixingPrefs( &dwPrefs);
dwPrefs |= MixerPref_PointFiltering;
dwPrefs &= ~( MixerPref_BiLinearFiltering );
pMix->SetMixingPrefs( dwPrefs );
Text To Image
Now we will create the bitmap having our text. (more…)