locked
How to Grab Video Thumbnail RRS feed

  • Question

  • Hi,

    I've noticed when you try to extract the "picture" property from video file it gives you a url (a url for thumbnail). When you bind/pass it to a Image element, It shows correct image. But when you try to copy that url and simply paste it in browser it prompt you to download a video file with the original file name (say - testVideo.wmv). Now, if you rename that file to *.jpg (say testVideo.jpg) it can be opened normally. (If I am not mistaken then previously it was working fine).

    My intention is to grab that thumbnail and us it in WP7 project. But currently I don't see any provision to grab thumbnail and store in your local storage (IsolatedStorage).

    Also, If I try to use that url in BackgroundAgent (for WP7) it throws an error - Incorrect format.
     
    Thanks and Regards

    Nishant Rana

    Wednesday, January 4, 2012 2:56 AM

Answers

  • Hi Nishant,

    I think you can just download using the LiveConnectClient.DownloadAsync and save it as videoname_thumbnail.jpg.

     

    Thanks,

    Lin

    Thursday, January 5, 2012 5:47 PM
    Moderator

All replies

  • http://forums.create.msdn.com/forums/ is the correct forum for this question.
    Regards!!! Navdeep Bawa
    Thursday, January 5, 2012 12:01 AM
    Moderator
  • Srry Navdeep, I've marked ur answer as unanswered.

    Since I still belive this problem has less to do with WP7 platform rather its more specific to Live SDK. As I mentioned previously when we copy the URL and paste it PC's web browswer it prompt to download a "*.wmv" file insted of "*.jpg".

    I duly understand there might be some internal machanism provided in Image or similar control (for Silverlight, WPF etc) to handel the situation. If you have a url something like this http://storage.live.com/**********/y1m8_rW1JH4dNQDJBvFVGBcorO_DErBvGWwKH9Tw3_GMhxMevjBy_efhs6CxrrGMnflenrsakeV2iFD6-0NgM8XMg.jpg

    Which is ending with .jpg format we can use it with LiveConnectClient to download the content. But the URL what we recevie (using "picture" property of a skydrive video file) for video thumbnail cases is something like:

    "http://storage.live.com/*******************-g77ozLBGckq4sKRyEKWLhVnA4ev91WGGPT5pYnLt9_yeVeUI9M/1m14sballet.wmv:Thumbnail"

    Which is not in correct format i.e. it should be somehting ending with *.jpg. Neither we have something like content property for Thumbnail so that we can download it as a stream and use it. Like we do in sample provided for WP7

    I belive unless we don't have a correct URL we can't download the video thumbnail in either of the platform i.e. PC, Mobile, Browser.

     

    Thanks and Regards

    Nishant Rana

    Thursday, January 5, 2012 5:06 AM
  • Hi Nishant,

     With the :Thumbnail Url, you should be able to treat it as an image to download or render it on each platform. On web, you can create a <img src="http://....:Thumbnail' /> tag to show the image.

     

    Thanks,

    Lin

    Thursday, January 5, 2012 8:36 AM
    Moderator
  •  On web, you can create a <img src="http://....:Thumbnail' /> tag to show the image.

     


    Thanks Lin !!

    As I mention previously it works perfectly fine when we set it as a source for a image element or so. But my intention is to download and save it directly in my local storage rather rendering it first to some Image element or other.

    If you got a full url with *.jpg extension then you can download it as stream using either LiveConnectClient or some normal WebClient service based on the platform you use.

    Is this possible with this special URL?

     

    Thanks and Regards

    Nishant Rana


    • Edited by nishantcop Thursday, January 5, 2012 9:38 AM edit
    Thursday, January 5, 2012 9:38 AM
  • Hi Nishant,

    I think you can just download using the LiveConnectClient.DownloadAsync and save it as videoname_thumbnail.jpg.

     

    Thanks,

    Lin

    Thursday, January 5, 2012 5:47 PM
    Moderator
  • Hi Lin,

    Srry I didn't try using it previously. It worked well with LiveConnectClient.

     

    But I (every WP developer) will prefer to use it with BackGroundTransfer i.e. the most apt for mobile platform. Using these URLs with BackGroundTransfer throws exception. So a need of proper URL is still required. 

    Consider a case when you are downloading a big long video and you receive a call then your download will be interrupted. Else if LiveConnectClient can internally support BackgroundTransfer then it would be the best.

     

    Thanks again for your help !!

     

    Regards

    Nishant Rana


    • Edited by nishantcop Monday, January 9, 2012 2:32 AM
    Sunday, January 8, 2012 2:26 PM