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

Set thumbnail size #99

Open
arc95 opened this issue Apr 8, 2019 · 1 comment
Open

Set thumbnail size #99

arc95 opened this issue Apr 8, 2019 · 1 comment

Comments

@arc95
Copy link

arc95 commented Apr 8, 2019

Hi. Thanks for this great library. I need to get a 700px X 480px thumbnail from a video. Here's my code:

var outputFile = new MediaFile{Filename = outputPath};

using (var engine = new Engine())
{
	engine.GetMetadata(inputFile);
	engine.ConversionCompleteEvent += (o, e) =>
	{
		// Code to handle completion.
	};

	var options = new ConversionOptions { Seek = TimeSpan.FromSeconds(1), 
              CustomWidth = 700, CustomHeight = 480};
	engine.GetThumbnail(inputFile, outputFile, options);
}

This produces a snapshot but it's 352x240 (the size of the video. How do you set the thumbnail size? Thanks.

@arc95 arc95 changed the title Set thumbnail custom size Set thumbnail size Apr 8, 2019
@ahmad-rzk
Copy link

I faced the same issue here, after looking around in the code I found out that customWidth/Height properties where intended to be used with videos only when its size set to custom.

I created a PR #114 to use these properties for the thumbnail size as well.

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