mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
parent
50f353aac7
commit
e2e5ddddb9
1 changed files with 25 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue