[Videos] Thumbnail generation (1 Viewer)

kiwijunglist

Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,750
    New Zealand
    New Zealand New Zealand
    Country flag
    Hi @Paranoid Delusion @infinite.loop

    Does MP still use mtn.exe / movie thumbnailer?

    I find MP fails to create thumbnails for approximately half of my h264 .ts tv recordings.
    mtn was last updated in 2008 so it uses ffmpeg based on 2008 version (The project was abadoned)

    However the source files are still on source forge, and I wonder if it was recompiled with the latest version of ffmpeg it would run a lot better?

    http://moviethumbnail.sourceforge.net/

    http://sourceforge.net/projects/moviethumbnail/

    There is also this:
    http://sourceforge.net/tracker/?func=detail&aid=3470571&group_id=201133&atid=976337
    (but i think it is for Linux)
     
    Last edited:

    infinite.loop

    Retired Team Member
  • Premium Supporter
  • December 26, 2004
    16,163
    4,133
    127.0.0.1
    Austria Austria
    Country flag
    Yes mp still uses mtn. There was a discussion to replace it with an other tool, but that fails even more often. We could simply use the windows internal thumb generator, but this means droping winxp support and we need an developer willing to code that. This is more work than it sounds because the windows system only provides one thumb, so without further changes this would mean a reduced functionality.
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,750
    New Zealand
    New Zealand New Zealand
    Country flag
    Yeah I just found a discussion about it here, as well as some patches @pilehave
    https://forum.team-mediaportal.com/threads/recording-thumbnails-resolved-d.98024/

    It would be quite easy to just use ffmpeg to grab 4 images and then use a command line tool like imagemagick to combine the 4 images into a single thumbnail image. You just need to find the video file length (time) and then use

    ffmpeg.exe -i [videofilename.ts] – ss [videolengthoftime/6] – t [totalvideolengthoftime/6] -f image2 – sameq -vcodec mjpeg thumb-%03d.jpg

    then you use imagemagick to combine the 4 images into one (can't remember the command needed)

    Alternatively you could use this
    http://code.google.com/p/ffmpegthumbnailer/wiki/FFMpegThumbnailer
    but I think it is probably faster to directly invoke ffmpeg
     
    Last edited:

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,750
    New Zealand
    New Zealand New Zealand
    Country flag
    I've looked into this a bit further

    I would be able to code a replacement for mtn.exe using ffmpeg to grab screenshots and an imagemagick script (open source, freeware) to combine the screenshots into a final thumbnail.

    Advantages
    Works with h264 because I would use latest ffmpeg build
    thumb01.jpg

    I could add the option to superimpose the tv channel image from the \thumbs\tv\logos folder into the corner of the thumbnail
    I could add the option to have the date written into the image
    thumb02.jpg

    I could add the option to have the show name written onto the image
    thumb04.jpg



    With a Little help from others
    Could probably have the option to look up the recordded show name on thetvdb, if exists use the fanart image to create the thumbnail
    thumb03.jpg

    Could probably have the option to look up the recorded show name on thetvdb, if exists use the fanart image and banner image to create a thumbnail
    thumb05.jpg

    Could probably have the option if the tv recording has season + episode + showname information, then look up the tvdb and grab the episode image from there and use that
    thumb06.jpg


    Disadvantage
    mtn has several features such as discarding a frame if it is blurry / too dark, I don't know how to code for this.


    I definitely wouldn't be able to code any of this into an actual patch, but I could present it as a simple script / set of commands or .bat file that could be easily incorporated by someone that wanted to patch the changes into mediaportal. Imagemagick commandline tool gives the abliity to combine images, alter images and add text to images, I used it to write a script that makes custom disc images for the dvdart plugin so pretty sure I could do this as well.
     
    Last edited:

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,750
    New Zealand
    New Zealand New Zealand
    Country flag
    I'll work on adding some of the above features into my tv thumbnailer script/plugin and if it is successful someone can consider if it would be worth swaping out mtn.exe for ffmpeg and imagemagick. https://forum.team-mediaportal.com/...tom-rec-tv-thumbs-better-h264-support.113415/

    I've also tried to contact the mtn.exe author to see if he would consider one last update of mtn.exe to incorporate a newer version of ffmpeg.
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,750
    New Zealand
    New Zealand New Zealand
    Country flag
    So I played around with adding channel logos and text onto the thumbnails, but in the GUI it looks bad, so I think it is kind of pointless.

    Jay_UK has made an mtn.exe replacement that uses ffmpeg and the montage command from imagemagick to create a thumbnail, it get's behind mtn's problem of not being able to handle some h264 recordings. It's kind of a hack because it just mimics the input arguments that were given by MP to the original mtn.exe and creates the thumbnail that way.

    https://forum.team-mediaportal.com/...better-h264-support.113415/page-3#post-927456

    also it currently doesn't have any smart logic like the original mtn had.
    eg. discarding blurry / dark frames. also it grabs screen shots at a set time frame of 720+20seconds per additional screenshot requested in mp config, so can fail on shorter recordings (i think mtn used percentage base markers to decide where to stop).

    With regards to using the recording's show name (+/- episode details) to look for online images, that is miles beyond what I can do, so I guess this is as far as the solution gets for now.
     
    Last edited:

    Users who are viewing this thread

    Similar threads

    Top Bottom