From e2e5ddddb95c945afbdabe9c68c99e482fcda02f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC=20=D0=91=D0=B0=D0=B3?= =?UTF-8?q?=D1=80=D1=8F=D0=BD=D1=86=D0=B5=D0=B2?= Date: Tue, 28 Apr 2020 22:54:39 +0300 Subject: [PATCH] Added Video_TranscodeInMemory test Former-commit-id: 8cc1791d25c32ff48d3dfa58d5eaa86c858052f1 --- FFMpegCore.Test/VideoTest.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/FFMpegCore.Test/VideoTest.cs b/FFMpegCore.Test/VideoTest.cs index 25ff2f6..1c8ae3f 100644 --- a/FFMpegCore.Test/VideoTest.cs +++ b/FFMpegCore.Test/VideoTest.cs @@ -666,5 +666,30 @@ public void Video_UpdatesProgress() output.Delete(); } } + + [TestMethod] + public void Video_TranscodeInMemory() + { + using (var resStream = new MemoryStream()) + { + var reader = new StreamPipeDataReader(resStream); + var writer = new RawVideoPipeDataWriter(BitmapSource.CreateBitmaps(128, PixelFormat.Format24bppRgb, 128, 128)); + + var container = new ArgumentContainer + { + new InputPipeArgument(writer), + new VideoCodecArgument("vp9"), + new ForceFormatArgument("webm"), + new OutputPipeArgument(reader) + }; + + Encoder.Convert(container); + + resStream.Position = 0; + var vi = VideoInfo.FromStream(resStream); + Assert.AreEqual(vi.Width, 128); + Assert.AreEqual(vi.Height, 128); + } + } } }