Home » Sharepoint 2010

How to Generate thumbnails for the Videos in the SharePoint Assets Library programmatically

Hi All,

I have a requirement in which I have to generate thumbnails for the Videos after they are uploaded in an Assets Library. Can anyone help how to accomplish this ? Thank you.


3 Answers Found


Answer 1

Sharepoint2010 currently does not provide thisoption and creating it would for yourself would be a overkill instead you can try third party solutions like one from bamboo



Answer 2

Hi Thanks for your reply. Thats really bad because its required everywhere. Is there anyway to do it through an Event receiver ??

Answer 3

yes you can but as i said problem would be in extracting the preview image from video not adding the preview image

following links can help in achieving that






i am trying to create a bunch of short how-to videos.  I am using Jing to capture my screen movements.  Jing saves the file as an mp4 - and if i click it it runs perfect (in win. media player).  However, if i upload the file to an asset library (or document library) - then when i click the hyperlink I get a SAVE | CANCEL dialog box.  Saving and then running will work - but is not particularly user friendly. 

Why will the file not just open in media player?  why does the dialog box that comes up not have a RUN option.  I did try converting the mp4 to .wmv file - those played fine (but were very blurry and unusable).  This seems to happen regarless of the browser i use.





I've got an asset library with a bunch of video's in it. The aim is to get the videos playable in the browser. I see two possible ways to do this ootb with SharePoint 2010:

a) create a corresponding publishing page for each video, add a media player web part and connect it to the video. As far as i can determine it appears as though you can't dynamically switch the source of the webpart so you need multiple webparts/pages to display all the videos, which i find abit messy.

b)use the option built into the asset library where when you hover over a video you get the option to play. This method fits perfectly however when i click play, the video player stretches the video and distorts it (and also makes it run more sluggishly), and i can't seem to find a way to tell it what size to play the video at. I've used a 'Video' content type and set the 'Frame Height' and 'Frame Width' fields however it doesn't change anything.

So there are 2 questions:

1) Is there any way to control the size of the player launched from the asset library?
2) Is it possible to dynamically change the source of media player webpart? e.g. webpart connection to an asset list or something along these lines?


Thanks in advance


Hi All,

I have a Silverlight MediaElement in which I play a Video from a SharePoint library. I need to show the thumbnail for the video in the MediaElemen. Can any1 pls help on how to show the thumbnail. Thank you.


I'm using the stock Lending Library template in an attempt to gauge if it will be feasible to eliminate the paperwork we do and set our loaner equipment to a fully digital stage. However, I'm having trouble.

After installing the template as a subsite to the "Service Desk" site, it all seems to be fine. I can create categories, add items, and the like. However, when I hit the "Check Out" link and actually check out an asset is where the issue begins.

After checking out the item, the item is not changed in availability (it is still marked as Available) and the link still says Check Out. However, when you click the item in the list to view it's details (it still says Check Out as a link and that it's Available), clicking the Check Out link on that details page returns that the asset is not available. So, it appears that it's updating the database properly, but not displaying the change properly.

I've got no idea where to even begin to fix this... Has anyone run into this before?



I have a asset library in SharePoint 2010. When I select an image and click "Edit Document" button in Ribbon Bar, it fail to show the image. An error "The document could not be opened for editing. A Microsoft SharePoint Foundation compatible application could not be found to edit the document". How can I display the image using office picture manager?





Hi guys,

I have Asset Library with Only Image content type and i have some items in library now i want to get all this item display into silverlight.

i mean i want to display image from library to image control in silverlight.

Please advise.



Is there a way that we can have the thumbnail view of the documents that are uploaded in SharePoint Document Library. We have thumbnail feature in Picture Library but can we have the same in Document Library too. Documents includes Words,Excel,PDF.

Any Suggestions Please 


Hi All,

I have created the Thumbnail view for the sharepoint picture library.
1. I want the custom view to be availiable for every picrture library automatically. When ever user create a picture library then that view will come automatically
2. Is there a way for Documents in Document library to get little preview in thumbnail images ( any Docs like pdf,.ppt,doc)

Any help is much appreciated.




If i use custom master pages. For some reason a user cannot view the thumbnail or filmstrip view;  only the details view will display. No errors are thrown when a user selects the filmstrip or thumbnail view, in fact nothing happens at all.

If the master page for the site is changed to default.master then the picture library functionality returns.

Anyone can help me in this. Thanks in advance.



I'd like to create a build time component that generates a list of all included assets. Is this possible?

If so, how can I do this?



Is there a way to programmatically add a new list item to a List or Document Library in SharePoint Workspace 2010 (formally known as Grove 2007)?

Documents maybe added to the SPW list while offline therefore it needs to be done via the SharePoint Workspace 2010 SDK rather than the SharePoint SDK.


OK - this seems to be to be a silly question, but i am going crazy.  I am simply trying to modify a view on a asset library full of video snippits.  I modify views all the time, but for some reason, each time i create a new (standard) view - no matter what columns i select or options i choose, i see the exact same view - horizontal list of thumbnails with file name beneath.  I am trying to get a nice vertical listing with name, title and a couple of custom columns so users can sort and filter easily -  but nothing works.  The 'ALL ASSETS' view works, but i can't seem to create a second view that does what i want.

Dataheet view works - but i am not certain why i should need to use a datasheet view.

is there something inherently different about an asset




All of a sudden I missing my Site Asset Library. I'm not sure what happened and I'm not sure how to get it back.

When I view all site content, I do not see Site Assets nor do I see an option for creating it.



HI Guys,

There are three content type associate with Asset library but now i want to create a list instance based on Asset Library but i dont want these three content type i want only the custom content type i have created.

I know how to do this in browser interface but i want to do in VS2010.

I Know i have to create listinstace item type i did that then i dont know what i have to do in order to hide all out of box content types associate with asset library.

Please assist me with this


The upload of large files > 100 MB fails with the "Upload Multiple Documents / Drag & Drop"-Feature, where it is no problem to upload the failed files as single file via Upload Document - "Browse..." with filesize up to 2GB.

Any workaround or configuration tricks known?

(Windows Server 2008 R2, SQL Server 2008 R2, SharePoint Server 2010)



I try explain: I have a JPG image (img A).

This A.jpg has contents -colors, it's a picture of persons- and a one more little white rectangle (color white; the head of person is a white rectangle). I need get the position of rectangle in A.jpg.

Then, I have another B.jpg image, more little; and I'll generate thumbnail of B.jpg , with Rectangle dimensions (of white rectangle in A.jpg).

Finally, I'll generate new image: C.jpg, will has A.jpg, and B.jpg in rectangle of A.jpg.

any suggestions, any sample code ? I use vs 2008, .net 3.5, GDI+ only.





I'm working on a project where the client will be putting all their document templates in a sentral document library and this library will then be used as a source of document templates in Word as described in this article: http://technet2.microsoft.com/Office/en-us/library/1f04f451-8537-4434-8789-ad54dca7652b1033.mspx?mfr=true

The templates that come with Office all have descriptions and thumbnails generated that make it easier to identify the right template when choosing from the list of templates, and you can ofcourse generate your own thumbnails for custom templates, but I would like to know if there is a way of generating images from say a Word document programmatically? (Ie. not by pressing print screen and then dumping the image in an image editor)

I've found a few programs out there that generate thumbnail images from pdf documents, but nothing from office documents. Does anybody know a way to do this? I suppose I could convert the document to pdf and use on of these tools to generate image from the pdf, but this seems a bit inefficient... The best scenario would be if there is somebody out there who have made this functionality so I can just add a .dll to my project in VS and handle everything in code, but so far I haven't seen any such software...


I try to create a dual video player with VB 2010. 

With that I have 2 forms, 1 main form (with all the controls and it should contain a preview screen of what is being displayed on the second form.

And a second form (with a windows media player component).

Now the main form should have (as told) a preview screen of what is shown on the second screen, I want to know if it is possible to have is as the windows 7 taskbar thumbnail (when preview the mediaplayer).

Thanks for any replies.



I am creating an upload control that will be used to upload videos.

I am trying to get a thumbnail from any frame of the video being uploaded and save as thumbnail.

does anyone have any idea where i can find some info on this.




I get the following error:

A first chance exception of type 'System.ArgumentException' occurred in System.Drawing.dll

A first chance exception of type 'System.ArgumentException' occurred in App_Web_u9x47ohz.dll

I am uploading images and also generate the thumbnail using the following methods:

Protected Sub btnUploadPhotos_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUploadPhotos.Click

div5.Visible = True

Dim uploadFilCol As HttpFileCollection = Request.Files
For i As Integer = 0 To uploadFilCol.Count - 1
Dim file As HttpPostedFile = uploadFilCol(i)
Dim fileExt As String = Path.GetExtension(file.FileName).ToLower()
Dim fileName As String = Path.GetFileName(file.FileName)
If fileName <> String.Empty Then
If fileExt = ".jpg" OrElse fileExt = ".gif" OrElse fileExt = ".bmp" OrElse fileExt = ".jpeg" OrElse fileExt = ".png" Then
file.SaveAs(Server.MapPath("~/uploads/") & fileName)

generateThumbnail((Server.MapPath("~/uploads/") & fileName), Path.GetFileNameWithoutExtension(file.FileName))
' Add the to DB

If i = 0 Then
Image1.ImageUrl = "~/uploads/" & fileName
End If
If i = 1 Then
Image2.ImageUrl = "~/uploads/" & fileName
End If
If i = 2 Then
Image3.ImageUrl = "~/uploads/" & fileName
End If
If i = 3 Then
Image4.ImageUrl = "~/uploads/" & fileName
End If
If i = 4 Then
Image5.ImageUrl = "~/uploads/" & fileName
End If
If i = 5 Then
Image6.ImageUrl = "~/uploads/" & fileName
End If
If i = 6 Then
Image7.ImageUrl = "~/uploads/" & fileName
End If
If i = 7 Then
Image8.ImageUrl = "~/uploads/" & fileName
End If
If i = 8 Then
Image9.ImageUrl = "~/uploads/" & fileName
End If
If i = 9 Then
Image10.ImageUrl = "~/uploads/" & fileName
End If
End If
Catch ex As Exception
Throw ex
End Try
End If
End Sub

Public Sub generateThumbnail(ByVal imageLocation As String, ByVal imageName As String)

Dim image As System.Drawing.Image = System.Drawing.Image.FromFile(imageLocation)
Dim srcWidth As Integer = image.Width
Dim srcHeight As Integer = image.Height
Dim thumbWidth As Integer = 132
Dim dest As String = Server.MapPath("~/uploads/" & imageName & "_thumb.jpg").ToString
Dim thumbHeight As Integer = (srcHeight \ srcWidth) * thumbWidth
Dim bmp As New Drawing.Bitmap(thumbWidth, thumbHeight)

Dim gr As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(bmp)
gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
gr.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality
gr.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High

Dim rectDestination As New System.Drawing.Rectangle(0, 0, thumbWidth, thumbHeight)
gr.DrawImage(image, rectDestination, 0, 0, srcWidth, srcHeight, GraphicsUnit.Pixel)



End Sub

Any help be much appreciated :)



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure