Trying to make some manipulation with frames using ImageMagick lib on .net (resizing + composing with other image), but faced with incorrect "re-assembling" video, output video coming with some artifacts.
So, as a sample of mp4 short file we have : mp4 (130kb) : https://c2n.me/4eU1Twz.mp4
first frame is :
second frame is :
and all next frames with similar artifacts.
Code to get frames and save them to disk :
string incomingFilePath = AppContext.BaseDirectory + "test.mp4";
using (var videoFrames = new MagickImageCollection(incomingFilePath, MagickFormat.Mp4))
{
for (var i = 0; i < _incomingImageFrames.Count; i++)
{
_incomingImageFrames[i].Write(AppContext.BaseDirectory + Guid.NewGuid() + ".png");
}
}
In case i am trying to "re-assemble" images to mp4 (with some modifications, using composing() method and etc), i am getting video with artifacts. Sample from output .mp4 :
So need to fix it somehow, but not sure why. Can anyone help me with it?