public void ShouldAbleToConvertRgbToH264()
        {
            var image = (Bitmap)Image.FromFile("Test.jpg");
            var image1 = (Bitmap)ImageHelper.Resize(image, new Size(352, 288));
            var finalImage = ImageHelper.Clone(image1, PixelFormat.Format24bppRgb);
            var rgbFrame = RgbFrameFactory.CreateFrame(finalImage);
            var converter = new RGB24ToYUV420Converter();
            var yuvFrame = (YuvFrame)converter.Process(rgbFrame);

            var vs = new VideoSequence(YuvFormatType.Yuv420, new Size(yuvFrame.Width, yuvFrame.Height));
            vs.Encode(yuvFrame.Data);
        }
        public void ConvertFromRgb24ToYuv420()
        {
            var image = (Bitmap)Image.FromFile("Test.jpg", false);
            var converter = new RGB24ToYUV420Converter();
            var destImage = converter.Process(RgbFrameFactory.CreateFrame(image));

            var bmp = new Bitmap(destImage.Width, destImage.Height, PixelFormat.Format24bppRgb);
            var bData = bmp.LockBits(new Rectangle(0, 0, destImage.Width, destImage.Height),
                                     ImageLockMode.WriteOnly,
                                     PixelFormat.Format24bppRgb);
            Marshal.Copy(destImage.Data, 0, bData.Scan0, destImage.Data.Length);
            bmp.UnlockBits(bData);

            bmp.Save("TestFinalRgb24ToYuv420.jpg");
        }