FFmpeg.NET
FFmpeg.NET copied to clipboard
GetThumbnailAsync doesn't handle croping and scaling in the same task
Given a crop and resize applied to a 640x480 video:
var conversionOptions = new ConversionOptions
{
CustomHeight = 100,
CustomWidth = 100,
SourceCrop = new CropRectangle {Width = 480, Height = 480}
};
await engine.GetThumbnailAsync(mediaFile, outputFile, conversionOptions)
I would expect both the crop and the resize would be applied.
But only the crop is applied.
I suspect this is because the above results in:
ffmpeg.exe -y -ss 1.0 -i input.mov -vframes 1 -filter:v "crop=480:4809::" -vf "scale=100:100" output.jpg
Rather than:
ffmpeg.exe -y -ss 1.0 -i input.mov -vframes 1 -filter:v "crop=480:4809::, scale=100:100" output.jpg
With the filters appended together, see https://stackoverflow.com/questions/22523006/how-to-use-filter-and-vf-command-on-ffmpeg