Replacement MTN (Thumbnailer) for H264 content (2 Viewers)

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,984
    5,663
    France - IDF
    Home Country
    France France
    For me,
    a video file : 720x576 native
    if set width 1920 for 2 rows =Movie is scaled to 1920x1536
    for 2 rows = 1920x3072 resized to width set in config (width = 600 for quality) = 600x960 final output
     

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi there,

    So assuminng 2 rows x 1 column.

    Based upon the four scenarios:

    Width is not specified (and video resolution known):
    Video source is set to 720x576
    Thumbnail is set to 720x576
    Tile size will be (720/1)x(576/2) = 720x288
    With this, the overall thumbnail aspect ratio and size is set to match the source
    Once I produce the thumb, MePo does its magic and resizes it according to its own settings

    Width is specified - lets assume 1920 (and video resolution known):
    Video source is 720x576
    Thumbnail is set to the specified width (height is calculated by using the specified width divided by the (video width/video height)
    Tile size will be (1920/1)x((1920/(720/576))/2) = 1920x768
    With this, the overall thumbnail aspect ratio and size is set to match the source
    Once I produce the thumb, MePo does its magic and resizes it according to its own settings

    Width is not specified (and video resoluton not known):
    Thumbnail width is set to 1270 (height is calculated by using the specified width divided by 1.7777)
    Tile size will be (1270/1)x((1270/1.7777)/2) = 1270x357
    With this, the overall thumbnail aspect ratio and size is set to match the source
    Once I produce the thumb, MePo does its magic and resizes it according to its own settings

    Width is specified - lets assume 1920 (and video resolution not known):
    Thumbnail width is set to the specified width - lets assume 1920 (height is calculated by using the specified width divided by 1.7777)
    Tile size will be (1920/1)x((1920/1.7777)/2) = 1920x540
    With this, the overall thumbnail aspect ratio and size is set to match the source
    Once I produce the thumb, MePo does its magic and resizes it according to its own settings

    Obviously if the source is smaller than the specified tile size, then FFmpeg will need to enlarge it.

    I am more than happy to change the logic/mathematics if people feel the above is not correct. But like I said above, the height is halving to maintain the overal AR, therefore the individual tiles AR must change. If you want to keep the tiles AR, then the thumbs AR will change. Which is the best way ??

    J.
     

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi guys,

    A new release (V60) and source code are on the post first.

    This release is still written in VB.Net - I had hoped to have it ported to C# tonight, but I'm a few hours behind schedule (C# is done, just need to test)

    Please check the changlelog on post 1 for updates :)

    J.
     

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi there,

    The issue will be the same... I haven't changed that part of it.

    I am still struggling to understand how you think it should work??

    Can you please explain (again) to me what/how you expect it to work??

    I am not looking to do much more work on this program, instead I am looking to start work on the MePo code itself and see if I can further improve the great work Homey/Sebastiii have done.

    Thanks,

    J.
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,984
    5,663
    France - IDF
    Home Country
    France France
    Hi Jay, i think is better you test thumbnail me, is better of explain use MTN !

    For me,
    a video file : 720x576 native
    if set width 1920 for 2 rows =Movie is scaled to 1920x1536
    for 2 rows = 1920x3072 resized to width set in config (width = 600 for quality) = 600x960 final output

    tM scale auto width of thumb
    Formule : thumb width = (FinalWidth - Gap) / n° column
    FFMPEG must extract format video
    Width set : 600 / video format : 720x576 / GAP = 1

    thumb view 1 column x 2 rows
    thumb extract : 720x576
    THUMB SET :
    width for one thumb = 600 - 1x2x1(GAPx2xN°column) / 1 = 598
    Height for one thumb = ((598x576)/720) - 1x2x1(GAPx2xN°column) = 476,4
    output for one thumb 598x476 without GAP / 600x478 with GAP
    COMPIL SET
    Final for 2 column : 598x952 without GAP / 600x956 with GAP

    MP make thumb from it, and leave file in storage ...

    with this, aspect ratio is respected !
     
    Last edited:

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Azzurro,

    I have slightly enhanced my MTN to implement what I think you are after.

    It now supports two modes:

    Thumbnail Aspect Ratio (default option)
    In this mode, the final thumbnail aspect ratio will match the source/video aspect ratio. This will mean the individual tile images may be distorted to ensure the overal AR is maintained for the thumbnail. The final thumbnail size should be quite consistant as it will be based on video aspect ratios (16:9, 4:3, etc)

    Tile Aspect Ratio (custom option)
    In this mode the final thumbnail aspect ratio will not match the source/video aspect ratio. Instead the individual tile image(s) aspect ratios are maintained. This may mean the overall thumbnail AR (dimensions) will be way off. I'm not sure how well MePo will handle it. In this mode having a large differential between rows and columns will make the overall thumbnail size "interesting".

    To change from the default mode, to the TileAR mode, create a reg key call "keeptilear" and set it to "1" (or specify "-keeptilear") as a commandline option.

    Let me know how you get on :D

    Please see post one for the updated version (v61)

    J.
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,984
    5,663
    France - IDF
    Home Country
    France France
    Hi Jay, Test V61
    - For use MTN, MP must be have Admin Right, without this problem ! ( maybe my PC, tested on other)
    - Format is OK, movie have "good size" but i don't understand, why you divided height by number or rows ? aspect ratio is not good !
    - i think your output file have 100% quality of jpeg ! and 32bit color (24bit for TM)

    i can't post MP thumb, problem with forum !?! i made ZIP
     

    Attachments

    • TM 100%.jpg
      TM 100%.jpg
      375.3 KB
    • TM 80%.jpg
      TM 80%.jpg
      61.2 KB
    • MP.zip
      436 KB
    Last edited:

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi there,

    I need to have the mtn_replacement.log file - this will give me the info to see what is happening.

    I haven't even looked at JPG colour depth - Is this an issue??

    J.
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,984
    5,663
    France - IDF
    Home Country
    France France
    it's only a problem for size ko! i don't know what is better !
    i must remake test for file ...
     
    Last edited:

    Users who are viewing this thread

    Top Bottom