locked
Capture Frame RRS feed

  • Question

  • How can I capture one frame from 3 frames/second video  using c#. Please help me with this..
    Sunday, December 16, 2012 1:39 PM

Answers

    • Proposed as answer by Jason Dot Wang Tuesday, December 18, 2012 7:31 AM
    • Marked as answer by Jason Dot Wang Monday, December 24, 2012 9:39 AM
    Sunday, December 16, 2012 1:53 PM
  • Besides advice from Ken, if you have  Expression Encoder SDK, you can use it's API.

    Screen capture in version 3 can be done with following code.

    private void SaveImageFrom(TimeSpan location, string videoFile, string imageFile)
    {
        Uri uri = new Uri(videoFile);
    
        MediaItem item = new MediaItem(uri.LocalPath);
    
        Bitmap image = item.MainMediaFile.GetThumbnail(location, item.VideoSize);
    
        image.Save(imageFile, ImageFormat.Png); 
    }



    • Edited by MasaSam Sunday, December 16, 2012 2:43 PM
    • Proposed as answer by Jason Dot Wang Tuesday, December 18, 2012 7:31 AM
    • Marked as answer by Jason Dot Wang Monday, December 24, 2012 9:39 AM
    Sunday, December 16, 2012 2:42 PM
  • Thank you MasaSam, for the information. I have version 4 in my computer. its 

    using.microsoft.expression.encoder---> this is the header. 

    Thank you

    • Proposed as answer by Jason Dot Wang Tuesday, December 18, 2012 7:31 AM
    • Marked as answer by Jason Dot Wang Monday, December 24, 2012 9:39 AM
    Monday, December 17, 2012 6:20 AM
  • You can do same with the version 4.0, if you look at the product directory there should be Samples folder that includes samples how to use version 4 SDK.

    I think it might include sample of how to create thumbnails.

    • Proposed as answer by Jason Dot Wang Tuesday, December 18, 2012 7:31 AM
    • Marked as answer by Jason Dot Wang Monday, December 24, 2012 9:39 AM
    Tuesday, December 18, 2012 6:37 AM

All replies

    • Proposed as answer by Jason Dot Wang Tuesday, December 18, 2012 7:31 AM
    • Marked as answer by Jason Dot Wang Monday, December 24, 2012 9:39 AM
    Sunday, December 16, 2012 1:53 PM
  • Besides advice from Ken, if you have  Expression Encoder SDK, you can use it's API.

    Screen capture in version 3 can be done with following code.

    private void SaveImageFrom(TimeSpan location, string videoFile, string imageFile)
    {
        Uri uri = new Uri(videoFile);
    
        MediaItem item = new MediaItem(uri.LocalPath);
    
        Bitmap image = item.MainMediaFile.GetThumbnail(location, item.VideoSize);
    
        image.Save(imageFile, ImageFormat.Png); 
    }



    • Edited by MasaSam Sunday, December 16, 2012 2:43 PM
    • Proposed as answer by Jason Dot Wang Tuesday, December 18, 2012 7:31 AM
    • Marked as answer by Jason Dot Wang Monday, December 24, 2012 9:39 AM
    Sunday, December 16, 2012 2:42 PM
  • Thank you MasaSam, for the information. I have version 4 in my computer. its 

    using.microsoft.expression.encoder---> this is the header. 

    Thank you

    • Proposed as answer by Jason Dot Wang Tuesday, December 18, 2012 7:31 AM
    • Marked as answer by Jason Dot Wang Monday, December 24, 2012 9:39 AM
    Monday, December 17, 2012 6:20 AM
  • You can do same with the version 4.0, if you look at the product directory there should be Samples folder that includes samples how to use version 4 SDK.

    I think it might include sample of how to create thumbnails.

    • Proposed as answer by Jason Dot Wang Tuesday, December 18, 2012 7:31 AM
    • Marked as answer by Jason Dot Wang Monday, December 24, 2012 9:39 AM
    Tuesday, December 18, 2012 6:37 AM