Draw text overlay using OnVideoFrameBuffer event

If video effect API to draw text overlay if not enough you can draw overlay manually in OnVideoFrameBuffer, using ImageHelper API.

        private void SDK_OnVideoFrameBuffer(object sender, VideoFrameBufferEventArgs e)
        {
            if (!logoInitiated)
            {
                logoInitiated = true;

                InitTextLogo();
            }

            MFP.AddTextLogo(null, e.Frame.Data, e.Frame.Width, e.Frame.Height, ref textLogo, e.Timestamp, 0);
        }

        private bool logoInitiated = false;

        private VFVideoEffectTextLogo textLogo = null;

        private void InitTextLogo()
        {
            textLogo = new VFVideoEffectTextLogo(true);
            textLogo.Text = "Hello world!";
            textLogo.Left = 50;
            textLogo.Top = 50;
        }
        

VisioForge © 2006-2020

  • GitHub-Mark-64px
  • Twitter Социальные Иконка
  • VisioForge Facebook page
  • YouTube channel