Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetThumbnailAsync doesn't handle croping and scaling in the same task #39

Open
NorfAlrin opened this issue Mar 10, 2020 · 1 comment
Open

Comments

@NorfAlrin
Copy link

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

@AaaBin
Copy link

AaaBin commented Dec 6, 2024

I found that VideoSize = VideoSize.Custom should be used to specify a custom size, even when cropping is not enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants