开发者

generating thumbnail image for video

开发者 https://www.devze.com 2022-12-31 10:14 出处:网络
I am using VSTS 2008 + C# + .Net 3.5 on Windows 7. I want to use Expression Encoder 3 to generate thumbnail image for video (wmv format) every 30 seconds -- e.g. for a 5 minut开发者_如何学Pythones vid

I am using VSTS 2008 + C# + .Net 3.5 on Windows 7. I want to use Expression Encoder 3 to generate thumbnail image for video (wmv format) every 30 seconds -- e.g. for a 5 minut开发者_如何学Pythones video, there will be 10 thumbnails which reflects video at the time of 0 second, 30 second, 1 minute, 1 minute and 30 seconds, etc.

Any reference code?


Using the SDK you could try using the GetThumbnail method:

var video = new MediaItem(filePath);
using (var bitmap = video.MainMediaFile.GetThumbnail(
    new TimeSpan(0, 0, 5), 
    new System.Drawing.Size(640, 480)))
{
    // do something with the bitmap like:
    bitmap.Save("thumb1.jpg");
}
0

精彩评论

暂无评论...
验证码 换一张
取 消