locked
Can we use the Expression Encoder Object model to generate thumbnails when encoding videos? RRS feed

  • Question

  • Wanted to quickly check whether the Encoder object model has APIs for generating thumbnails for the encoded video (don't have the necessary software on this machine yet to check)
    Wednesday, May 14, 2008 4:44 AM

Answers

  • Yes you can get the thumbnail from a video frame using code something like the following, which gets the thumbnail for the file at the time of 5 seconds. You can also just use the time that Encoder determines has a good thumbnail if you so desire.

    MediaItem fileInfo = new MediaItem(@"C:\myvideo.wmv");  
     
    Bitmap bitmap = fileInfo.GetThumbnail(new TimeSpan(0, 0, 5), new Size(640, 480));  
     

    Regards
    Dean.

    Wednesday, May 14, 2008 6:56 AM

All replies

  • Yes you can get the thumbnail from a video frame using code something like the following, which gets the thumbnail for the file at the time of 5 seconds. You can also just use the time that Encoder determines has a good thumbnail if you so desire.

    MediaItem fileInfo = new MediaItem(@"C:\myvideo.wmv");  
     
    Bitmap bitmap = fileInfo.GetThumbnail(new TimeSpan(0, 0, 5), new Size(640, 480));  
     

    Regards
    Dean.

    Wednesday, May 14, 2008 6:56 AM
  •  thanks dean!
    Thursday, May 15, 2008 4:17 AM