Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suggest using "DexterLib" library to do this. I have used this library to generate thumbnails of video clips in hosted environment, and it works like a charm.</p> <p>Here is what you need. </p> <ol> <li><p>Add a reference to "DexterLib" library to your project. </p></li> <li><p>Add a reference to the following libraries:</p> <pre><code>using System.Drawing.Imaging; using System.Runtime.InteropServices; using DexterLib; </code></pre></li> <li><p>Use the following code to grab a frame and generate a thumbnail:</p> <pre><code>try { MediaDetClass loMD = new MediaDetClass(); loMD.Filename = lsServerPath; loMD.CurrentStream = 0; loMD.WriteBitmapBits(0, 150, 150, lsFBitmapName); System.Drawing.Image loImg = System.Drawing.Image.FromFile(lsFBitmapName); loImg.Save(lsFJpegName, ImageFormat.Jpeg); loImg.Dispose(); System.IO.File.Delete(lsFBitmapName); } catch (Exception loEx) { // Means media not supported } </code></pre></li> </ol> <p>The "WriteBitmapBits" method takes in the "Stream Time, Width, Height and FileName" for your video in that order as input parameter which you then use to save the thumbnail as JPG. Let me know if you have any additional questions. If you want to see it in action you can take a look at an Open Source Portal Project I have here: </p> <p><a href="http://digioznetportal.svn.sourceforge.net/viewvc/digioznetportal/digioznetportal_1.1/DigiOz%20.NET%20Portal%201.1/trunk/" rel="nofollow">http://digioznetportal.svn.sourceforge.net/viewvc/digioznetportal/digioznetportal_1.1/DigiOz%20.NET%20Portal%201.1/trunk/</a></p> <p>Click on "Download GNU Tarball" link to download the whole source code, then take a look at the "controls/VideoUpload.ascx.cs" and step through that code to see how it works. </p> <p>I hope this helps. </p> <p>Thanks, Pete</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload