Added Video_TranscodeInMemory test

This commit is contained in:
Максим Багрянцев 2020-04-28 22:54:39 +03:00
parent 883185b5ec
commit 8cc1791d25

View file

@ -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);
}
}
}
}