title: Add text to image using AForge.Video.FFMEG in C#
body: <p>Using  <code>AForge.Video.FFMPEG</code> I am able to create video from Images.</p>
  
  <pre><code>        string[] files;
          string folderPath = @"FolderPath";
          files = Directory.GetFiles(folderPath).OrderBy(c =&gt; c).ToArray();
  
          VideoFileWriter writer = new VideoFileWriter();
          writer.Open(@"C:folder\new.mp4", imageWidth, imageHeight, 10, VideoCodec.MPEG4);
          for (int j = 0; j &lt; files.Length; j++)
          {
              string fileName = files[j];
              BitmapSource imageBitMap = new BitmapImage(new Uri(fileName, UriKind.RelativeOrAbsolute));
              imageBitMap.Freeze();
              int stride = imageBitMap.PixelWidth * ((imageBitMap.Format.BitsPerPixel + 7) / 8);
              byte[] ImageInBits = new byte[imageBitMap.PixelWidth * imageBitMap.PixelHeight];
              imageBitMap.CopyPixels(ImageInBits, stride, 0);
  
              Bitmap image = new Bitmap(imageWidth, imageHeight, stride, PixelFormat.Format8bppIndexed, Marshal.UnsafeAddrOfPinnedArrayElement(ImageInBits, 0));
  
              writer.WriteVideoFrame(image);
              image.Dispose();
          }
  </code></pre>
  
  <p>I am trying to add text/String to input image using</p>
  
  <pre><code>    private Bitmap WriteString(Bitmap bmp)
      {
          RectangleF rectf = new RectangleF(70, 90, 90, 50);
  
          Bitmap tempBitmap = new Bitmap(bmp.Width, bmp.Height);
          Graphics g = Graphics.FromImage(tempBitmap);
  
          g.DrawImage(bmp, 0, 0);
          g.SmoothingMode = SmoothingMode.AntiAlias;
          g.InterpolationMode = InterpolationMode.HighQualityBicubic;
          g.PixelOffsetMode = PixelOffsetMode.HighQuality;
          g.DrawString("yourText", new Font("Tahoma", 8), Brushes.Red, rectf);
          g.Flush();
  
          return bmp;
      }
  </code></pre>
  
  <p>like </p>
  
  <pre><code>            Bitmap image = new Bitmap(imageWidth, imageHeight, stride, PixelFormat.Format8bppIndexed, Marshal.UnsafeAddrOfPinnedArrayElement(ImageInBits, 0));
              Bitmap outputBitmap=WriteString(image);
              writer.WriteVideoFrame(outputBitmap);
  </code></pre>
  
  <p>How can I write a string to Image? </p>
  
  <p>Is there any way to add subtitle to <code>AForge.Video.FFMEG</code> to image before creating video?</p>