[Videos] - Thumbnail generation

Discussion in 'Improvement Suggestions' started by kiwijunglist, October 25, 2012.

  1. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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: October 25, 2012
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. infinite.loop
    • Team MediaPortal

    infinite.loop Retired Team Member

    Joined:
    December 26, 2004
    Messages:
    16,163
    Likes Received:
    3,861
    Gender:
    Male
    Location:
    127.0.0.1
    Ratings:
    +4,154 / 7
    Home Country:
    Austria Austria
    Show System Specs
    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.
     
  4. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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: October 25, 2012
  5. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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: October 27, 2012
    • Like Like x 3
  6. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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.
     
  7. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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: November 1, 2012
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!