[Approved] Auto create Video thumbs (1 Viewer)

Migue

Retired Team Member
  • Premium Supporter
  • January 27, 2006
    381
    305
    Florida
    This patch enables the auto-creation of thumbnails for My Videos if they don't already exist using the MediaPortal.Util.VideoThumbCreator.CreateVideoThumb() method and caching them on the "Thumbs\Videos" folder.
    It does this only if the "auto create TV recordings thumb" option is checked on the "General - Thumbnails" section of the configuration program. The text was modified to reflect this and the "clear recorded tv thumbs" behavior modified to also delete the video thumbs.
    Additionally, if the aforementioned method fails (usually due to incompatible video formats that mtn.exe can't handle such as RealMedia files, or due to lack of write access on the folder where the video is located), there is an attempt to extract the thumbnail using the MediaPortal.Util.ThumbnailExtractor.GetThumbnail() method for Windows versions earlier than Vista. For Vista and newer I added a slightly modified version of this code: http://mattolenik.spaces.live.com/blog/cns!ECC4D3AB87790CFF!117.entry
    Feedback appreciated! :)

    P.S. - This is the patch I posted here: https://forum.team-mediaportal.com/...my-videos-thumbnail-support-58027/#post422608
    but all cleaned-up, following the coding standards(I hope) and without cluttering the configuration program.

    EDIT: SORRY, I just noticed that I was setting the low-quality thumbnail to item.ThumbnailImage and item.IconImageBig instead of the higher-quality one. I re-uploaded the patch with the changes. :oops: :sorry:
     

    Attachments

    • Autocreate Video thumbnails (using SVN22555).patch
      30.8 KB

    infinite.loop

    Retired Team Member
  • Premium Supporter
  • December 26, 2004
    16,163
    4,133
    127.0.0.1
    Home Country
    Austria Austria
    Sounds like a nice change.
    I hope that a developer will soom have time to review it. :)

    :D
     

    Gixxer

    Retired Team Member
  • Premium Supporter
  • August 18, 2007
    1,383
    41
    39
    Spain
    Home Country
    Spain Spain
    the patch is working and creating the thumbs but when i hit F3 to see the details, no image is shown. i tried this with a film ive got the movie info but with no thumb.

    mediaportal log says...

    2009-05-30 19:35:29.277826 [Info.][MPMain]: image has no extension:unknown
     

    Migue

    Retired Team Member
  • Premium Supporter
  • January 27, 2006
    381
    305
    Florida
    No, the patch was never meant for videos on the database. Having said that, I see how it would be nice to show the thumb if there's no cover/manually set image for the movie, so I'm looking into it =)
     

    Gixxer

    Retired Team Member
  • Premium Supporter
  • August 18, 2007
    1,383
    41
    39
    Spain
    Home Country
    Spain Spain
    No, the patch was never meant for videos on the database. Having said that, I see how it would be nice to show the thumb if there's no cover/manually set image for the movie, so I'm looking into it =)

    great, i know that it was not the initial objective, but there is always place for suggestions.

    let see how it turns out.:D
     

    Migue

    Retired Team Member
  • Premium Supporter
  • January 27, 2006
    381
    305
    Florida
    Here it is. You need to apply the patch in the first post first.
     

    Attachments

    • Show thumb on imdb info view (using SVN22555).patch
      30.8 KB

    -Manfred-

    Retired Team Member
  • Premium Supporter
  • May 15, 2007
    728
    343
    Home Country
    Finland Finland
    Couple of notes after this was implemented:
    1. if thumb doesn't exist and file is image file (.iso) what happens? Now it seems that mtn is running in background constantly
    2. thumb creation ongoing while playing video -> low spec htpc and video will stutter as mtn can take almost all all cpu cycles

    Should these take into account?
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    1. if thumb doesn't exist and file is image file (.iso) what happens? Now it seems that mtn is running in background constantly

    Too bad if MTN is containing such bad code. It could cause similar issues with broken AVIs etc. We should have some sort of blacklist that would list all files that are taking more than 10 seconds (or something similar) to generate the thumbnail. Also blacklisting should be done by the file extension.

    2. thumb creation ongoing while playing video -> low spec htpc and video will stutter as mtn can take almost all all cpu cycles

    Thumbnail generation should be paused when video playback is started.

    ...now, did this patch get integrated with too big haste? :p
     

    Users who are viewing this thread

    Top Bottom