New: Picture and Video thumbnail rework in MP2 (1 Viewer)

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Hi all,

    while I was trying to bring more graphics to MP2 skins, I had to find out that video thumbs are not working at all.

    So I did some investigation and found that Microsoft provides some shell interfaces to query it's thumbnail cache. The shell APIs got improved in Win7, so I decided to use the Windows® API Code Pack for Microsoft® .NET Framework - Home library to access them.

    Features:
    • Get thumbnails from pictures and videos
    • Get different resolution thumnbail (32,96,256,1024 width/height max)
    • Use the same cache as the Windows Explorer.

    This means, all media items (picture and video) can be shown in MP2 gui in 4 different resolutions and are based on Win7 standard libraries/API.

    I already modifed "NewSkin" to use thumbs in Local Media Navigation, see attached pictures.

    Comments and ideas are welcome, code you can find in branch 20110417-Thumbnail_Rework

    Morpheus
     

    Attachments

    • 01_image_thumbs.jpg
      01_image_thumbs.jpg
      137 KB
    • 02_video_thumbs.jpg
      02_video_thumbs.jpg
      149 KB
    • 03_video_thumbs_shell_default.jpg
      03_video_thumbs_shell_default.jpg
      172.2 KB
    • 04_audio_picture_s.jpg
      04_audio_picture_s.jpg
      220.3 KB
    • 05_audio_picture_m.jpg
      05_audio_picture_m.jpg
      195.4 KB
    • 06_audio_picture_l.jpg
      06_audio_picture_l.jpg
      192.7 KB
    • 07_video_s.jpg
      07_video_s.jpg
      194.6 KB
    • 08_video_m.jpg
      08_video_m.jpg
      211.2 KB
    • 09_video_l.jpg
      09_video_l.jpg
      205.7 KB
    • 10_folder_m.jpg
      10_folder_m.jpg
      130.9 KB
    • 11_folder_l.jpg
      11_folder_l.jpg
      128 KB

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: New: Picture and Video thumbnail rework in MP2

    Yes it can - works fine here (MP1 recorded tv shows have thumbs in win7 explorer)
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Are those thumbnails generated at the media import time (in background) or just when they are needed? In MP1 it is giving quite bad user experience when we generate those only when they are needed for the 1st time.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #5
    AW: New: Picture and Video thumbnail rework in MP2

    My current version does load the thumnbnails synchronous on usage from skin (slow on first time), but I already implemented the asynch way.

    There is only a small issue I have to solve, when the Image has a Source (thumb) and a FallbackSource (default image). In Asynch loading there is a "refresh" missing to tell the image that the Source is ready and the FallbackSource should not be used any longer.

    The thumbnail cache is in Vista+ no longer stored inside the media folder, but in User\ProgramData\Microsoft\Explorer (or sth. like this) on the client PC.

    The API does offer some flags, to decide if only cached images should be returned, or also to create new ones.

    I think about the server implementation, and if we should pass the thumbs from "Server->Server ThumbCache->Client" or if the "Client->Client ThumbCache->Dokan mounted Server file" is the better way.
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    46
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    AW: New: Picture and Video thumbnail rework in MP2

    Morph, do you know MP2's AsyncThumbnailGenerator? That would be the right place to query the MS API for thumbnails. IIRC, the Image classes in the SkinEngine already query AsyncThumbnailGenerator and know how to handle the asynchronous callbacks/refresh.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #7
    AW: New: Picture and Video thumbnail rework in MP2

    I used exactly this interface and implementation, but replaced the ThumbnailBuilder, which i.e. used the MediaPlayer for videos, that doesn't work.

    My issue with asynch loading is, that the FallbackSource "wins" here, maybe also because of the recent bugfix (set source=null if not allocated). This is maybe the only problem...

    What do you think about the preferred storage and acessibility of thumbs?

    "Server->Server ThumbCache->Client"
    "Client->Client ThumbCache->Dokan mounted Server file" (currently I do this, only using local folders now)
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #8
    AW: New: Picture and Video thumbnail rework in MP2

    Update:
    My asynchronous implementation did work correctly, but the Image allocation was broken for this case by the recent bugfix (which I suggested :oops:).
    So loading is now smooth, thumbs are shown as soon as they are available.

    Now I want to reach the following:
    • A proper fix of FallbackSource handling considering 2nd point
    • The Image should show the "FallbackSource" as long as the thumbnail ("Source") is created asynchronously. Once it is finished, the "Source" should be shown.

    I think this was intended in some way, but current situation isn't working this way.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #9
    AW: New: Picture and Video thumbnail rework in MP2

    I have added some new screenshots! They show to use of different thumbnail/icon resolutions and the new feature to switch between the layouts :D
     

    Bleazle

    Portal Pro
    July 14, 2007
    1,122
    257
    Pukekohe
    Home Country
    New Zealand New Zealand
    Are those thumbnails generated at the media import time (in background) or just when they are needed? In MP1 it is giving quite bad user experience when we generate those only when they are needed for the 1st time.

    +1 - I agree, it is a very bad user experience. It would be much better if there was an option to generate thumbs for Pictures from MPConfig rather than having to wait for them to be generated in MP. Maybe this could be developed as a plugin?
     

    Users who are viewing this thread

    Top Bottom