Fix for JoinImageSequence #281

This commit is contained in:
Malte Rosenbjerg 2022-04-15 12:55:34 +02:00
parent 003ee8a4c7
commit 9c0b2bdb44
2 changed files with 2 additions and 1 deletions

View file

@ -468,7 +468,7 @@ public void Video_Join_Image_Sequence()
} }
}); });
var outputFile = new TemporaryFile("out.mp4"); using var outputFile = new TemporaryFile("out.mp4");
var success = FFMpeg.JoinImageSequence(outputFile, images: imageSet.ToArray()); var success = FFMpeg.JoinImageSequence(outputFile, images: imageSet.ToArray());
Assert.IsTrue(success); Assert.IsTrue(success);
var result = FFProbe.Analyse(outputFile); var result = FFProbe.Analyse(outputFile);

View file

@ -325,6 +325,7 @@ public static bool JoinImageSequence(string output, double frameRate = 30, param
return FFMpegArguments return FFMpegArguments
.FromFileInput(Path.Combine(tempFolderName, "%09d.png"), false) .FromFileInput(Path.Combine(tempFolderName, "%09d.png"), false)
.OutputToFile(output, true, options => options .OutputToFile(output, true, options => options
.ForcePixelFormat("yuv420p")
.Resize(firstImage.Width, firstImage.Height) .Resize(firstImage.Width, firstImage.Height)
.WithFramerate(frameRate)) .WithFramerate(frameRate))
.ProcessSynchronously(); .ProcessSynchronously();