MFormats SDK: images overlaying


{... in progress...}


All editions of MFormats SDK are capable of basic character generator and video mixing features: logo overlay, text overlay, picture-in-picture, basic graphics. This post explains some of these features.


There are two ways to overlay text, video or image over the video source:


  • Create a new MFFrame object for the source of overlay and use MFOverlay method for the main MFFrame object.
  • Modify the current frame in the memory.


Let's take a closer look at some of the overlay use cases.


Add image overlay

Images (.PNG, .JPG, etc.)  overlaying is pretty simple and works quite similar to frames mixing.

The only difference is that overlay frame is created from the source image. So basicly you just create a new MFFrame object using a MFFactory and overlay it over the original frames. 



To overlay an image (.PNG, .JPG, etc.) you should create a single MFFrame object from the file and use it for overlay. To create a frame from file MFFactory object is used:

MFFactory m_objFactory = new MFFactory();

Let's create an MFFrame object from file with MFFactory:


MFFrame frOverlay;
m_objFactory.MFFrameCreateFromFile(openFileDialog.FileName, out frOverlay, "");


And use this frame for overlay:

pFrame.MFOverlay(frOverlay, null, 50, 100, 1, "", "");


You can find this type of overlay in File Playback Sample.