TV Thumbnailer - Custom Rec TV Thumbs / Better h264 support (1 Viewer)

kiwijunglist

Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    I'll include this function in the next update in a couple of days, as soon as I learn how to do it :D[DOUBLEPOST=1351342110][/DOUBLEPOST]Have you tried the script? If so...
    Is it correctly creating thumbnails on new tv recordings?
    Did the drag a single .ts file to create a thumbnail work?
    Were there any problems?
    Are you using XP/Vista/Win7, 32bit or 64bit?

    I think I may have left a user pause at the end of the script unintentionally before I uploaded it, so will sort that out as well.
     
    Last edited:

    mr viggo

    MP Donator
  • Premium Supporter
  • March 1, 2008
    500
    68
    Home Country
    Sweden Sweden
    I have tried the script and manually made 3-4 thumbs in my recordings folder with drag and drop method. On my client, I've successfully updated these thumbs with the client script. So it works, but haven't tried recording anything yet and see if it works that way but I assume it does.

    The thumbs are however either perfect, bad AR or interlaced. Guess it has to do with ffmpeg
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    When I've written the script for you I can batch process all my tv recordings and see if I can improve on the ffmpeg result. It's currently set to produce a thumbnail with a fixed aspect ratio, as I believe that when the thumbnail is displayed in the skin it gets stretched to a certain size regardless of it's AR. All my channels + recordings are widescreen.
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    I have tried the script and manually made 3-4 thumbs in my recordings folder with drag and drop method. On my client, I've successfully updated these thumbs with the client script. So it works, but haven't tried recording anything yet and see if it works that way but I assume it does.

    The thumbs are however either perfect, bad AR or interlaced. Guess it has to do with ffmpeg

    can you send a sample video that created an ugly interlaced thumbnail and also sample video that had bad AR to sendspace.com ... , maybe record a short segment, if needed you can change the screenshot delay from 720 seconds (default) to a shorter period of time so you can process a shorter sample video if needed, instructions on how to change the 720 seconds are in the wiki.
     

    mr viggo

    MP Donator
  • Premium Supporter
  • March 1, 2008
    500
    68
    Home Country
    Sweden Sweden
    I've noticed that the win7 picture viewer shows the thumbs with bad AR but the skin shows them correctly (avalon). Some recorded SD has an interlaced thumb, but I can't tell by looking in MP, only when the pic is maximized on the whole screen.

    Will try to find a ts cutter and ul soon.
    Alla presidentens män - Viasat Film Classic - 2012-09-08.jpg
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    @mr viggo - updated version to v2012.10.28 with ability to batch process all tv recordings. To install completely delete all the old files then extract the .zip
     
    Last edited:

    Dadeo

    Docs Group Manager
  • Premium Supporter
  • November 26, 2006
    5,340
    3,321
    Himalayas, India
    Home Country
    Canada Canada
    Hey kiwijunglist - nice work!

    It might be nice to mention in first post that your plugin is a script that depends on ComSkipLauncher plugin? I know it is clear iif you read the whole Wiki page and in subsequent posts, but at first I wondered why this was not in MP Downloads Repository.

    Second question - why is it under 'New Zealand' in Wiki and called NZTV Thumbnailer Script but TV Thumbnailer [AddOn] here? Can't I use it for recordings outside NZ? ;)

    I have no objection to you adding it to the Extensions section of Wiki. We can even add a Scripts or Add-ons section if you hesitate to list it under TV-Server plugins. However imo if it is listed in forum under MP Plugins, no reason not to do the same in Wiki ;)
     
    Last edited:

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    It started out as a plugin for just NZers but it seems people from other countries have problems with thumbnail generation as well. I just do a major revision so will be tidying things up a bit more and you are right maybe it would be better under tvserver plugins. it's a bit wierd because normally MP Client generates thumbs not tvserver, although I think generating thumbnails for tvserver recordings should be the job of the tvserver and then the client grabs them from the tvserver.
     
    Last edited:

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    I'll move the files into repsoitory soon and delete them from the wiki.
     

    gonzo90017

    Portal Pro
    September 3, 2012
    238
    26
    25
    Home Country
    United States of America United States of America
    I can't get it working. I followed the instructions in the wiki. But when I click on Test I only see the cmd window very briefly. I checked the log files but they are empty.
    Code:
    timeout 780 /nobreak
    @echo off
     
    echo ______________________________________________________________________________________________ >> Thumbs_TVServerGenerated.log
    echo. >> Thumbs_TVServerGenerated.log
    echo Started: %time% %date% >> Thumbs_TVServerGenerated.log
    echo. >> Thumbs_TVServerGenerated.log
     
    REM ######################################
    REM # Turn the command line arguments into a
    REM # single string called path_and_filename
    REM ######################################
     
    SET AA=%~1
    SET AB=%~2
    SET AC=%~3
    SET AD=%~4
    SET AE=%~5
    SET AF=%~6
    SET AG=%~7
    SET AH=%~8
    SET AI=%~9
    SHIFT
    SHIFT
    SHIFT
    SHIFT
    SHIFT
    SHIFT
    SHIFT
    SHIFT
    SHIFT
    SET AJ=%~1
    SET AK=%~2
    SET AL=%~3
    SET AM=%~4
    SET AN=%~5
    SET AO=%~6
    SET AP=%~7
    SET AQ=%~8
    SET AR=%~9
    set "path_and_filename=%AA% %AB% %AC% %AD% %AE% %AF% %AG% %AH% %AI% %AJ% %AK% %AL% %AM% %AN% %AO% %AP% %AQ% %AR%"
     
     
    REM ######################################
    REM # Split path_and_filename into the following variables
    REM # filepath, filename, showname, channelname
    REM ######################################
     
    for %%F in ("%path_and_filename%") do (
      set "fileName=%%~nF"
      set "filePath=%%~dpF"
    )
     
    for %%F in ("%filePath%..") do set "fileGrandparentFolder=%%~nF"
     
    for /f "tokens=1,2 delims=-" %%a in ("%filename%") do set showname=%%a&set channelname=%%b
     
    set showname=%showname:~0,-1%
    set channelname=%channelname:~1,-1%
     
    REM If the recordings are not in the main rec folder then the channel name is incorrectly
    REM parsed as the first 3 digits of the year and it needs to be taken
    REM from the grandparent_folder name of the .ts file
     
    set ThreeDigitYear=%date%
    set ThreeDigitYear=%ThreeDigitYear:~-4%
    set ThreeDigitYear=%ThreeDigitYear:~0,-1%
     
    if "%channelname%"=="%ThreeDigitYear%" (
        set channelname=%filegrandparentfolder%
        ) ELSE (
        rem do nothing
        )
     
     
    REM ######################################
    REM # WRITE SOME INFORMATION TO THE LOG FILE
    REM ######################################
     
    echo Arguments        : %path_and_filename% >> Thumbs_TVServerGenerated.log
    echo Path            : %filepath% >> Thumbs_TVServerGenerated.log
    echo Filename        : %filename% >> Thumbs_TVServerGenerated.log
    echo TV Channel      : %channelname% >> Thumbs_TVServerGenerated.log
    echo Showname        : %showname% >> Thumbs_TVServerGenerated.log
    echo MP TV Rec Thumbs : %ALLUSERSPROFILE%\Team Mediaportal\Mediaportal\Thumbs\TV\Recorded\ >> Thumbs_TVServerGenerated.log
    echo. >> Thumbs_TVServerGenerated.log
     
    echo Arguments        : %path_and_filename%
    echo Path            : %filepath%
    echo Filename        : %filename%
    echo TV Channel      : %channelname%
    echo Showname        : %showname%
    echo MP TV Thumbs    : %ALLUSERSPROFILE%\Team Mediaportal\Mediaportal\Thumbs\TV\Recorded\
    echo.
     
    echo TV SHOW THUMBS >> Thumbs_TVServerGenerated.log
    dir /b .\show_thumbs\*.jpg >> Thumbs_TVServerGenerated.log
    echo. >> Thumbs_TVServerGenerated.log
    echo CHANNEL THUMBS >> Thumbs_TVServerGenerated.log
    dir /b .\channel_thumbs\*.jpg >> Thumbs_TVServerGenerated.log
    echo. >> Thumbs_TVServerGenerated.log
     
     
    REM ######################################
    REM # CHECK THE TV RECORDING EXISTS
    REM ######################################
     
    if EXIST "%path_and_filename%" (
      rem file exists
      ) ELSE (
      echo. ERROR %path_and_filename% - FILE DOES NOT EXIST!!>> Thumbs_TVServerGenerated.log
      echo. >> Thumbs_TVServerGenerated.log
      echo ABORTING... >> Thumbs_TVServerGenerated.log
      echo. >> Thumbs_TVServerGenerated.log
      echo ERROR - %path_and_filename% - No such file!
      echo.
      goto endofbatfile
      )
     
     
    REM ######################################
    REM # Use a predefined tvshow thumbnail
    REM # If available
    REM ######################################
     
    if EXIST ".\show_thumbs\%showname%.jpg" (
      echo Creating thumbnail using %showname%.jpg >> Thumbs_TVServerGenerated.log
      copy /y ".\show_thumbs\%showname%.jpg" "%filepath%\%filename%.jpg"
      copy /y ".\show_thumbs\%showname%.jpg" "%ALLUSERSPROFILE%\Team MediaPortal\MediaPortal\thumbs\tv\Recorded\%filename%.jpg"
      copy /y ".\show_thumbs\%showname%.jpg" "%ALLUSERSPROFILE%\Team MediaPortal\MediaPortal\thumbs\tv\Recorded\%filename%L.jpg"
      goto almostdone
      )
     
     
     
     
     
    REM ######################################
    REM # Use a predefined tvchannel thumbnail
    REM # If available
    REM ######################################
     
    if EXIST ".\channel_thumbs\%channelname%.jpg" (
      echo Creating thumbnail using %channelname%.jpg >> Thumbs_TVServerGenerated.log
      copy /y ".\channel_thumbs\%channelname%.jpg" "%filepath%\%filename%.jpg"
      copy /y ".\channel_thumbs\%channelname%.jpg" "%ALLUSERSPROFILE%\Team MediaPortal\MediaPortal\thumbs\tv\Recorded\%filename%.jpg"
      copy /y ".\channel_thumbs\%channelname%.jpg" "%ALLUSERSPROFILE%\Team MediaPortal\MediaPortal\thumbs\tv\Recorded\%filename%L.jpg"
      goto almostdone
      )
     
     
    REM ######################################
    REM # Since there are no available tvshow or
    REM # tvchannel thumbs, use ffmpeg to create
    REM # A thumbnail @ 720 seconds
    REM ######################################
     
    echo Creating Thumbnail using ffmpeg >> Thumbs_TVServerGenerated.log
     
     
    ffmpeg.exe -ss 720 -itsoffset -5 -i "%path_and_filename%" -vframes 1 -y "%filepath%%filename%.jpg"
     
    copy /y "%filepath%%filename%.jpg" "%ALLUSERSPROFILE%\Team MediaPortal\MediaPortal\thumbs\tv\Recorded\%filename%.jpg"
    copy /y "%filepath%%filename%.jpg" "%ALLUSERSPROFILE%\Team MediaPortal\MediaPortal\thumbs\tv\Recorded\%filename%L.jpg"
     
     
    :almostdone
     
     
    REM ######################################
    REM # Run COMSKIP ON THE .TS RECORDING NOW
    REM # JUST REMOVE ALL OF THE REM STATMENTS
    REM # IN THE LINE BELOW AND CHANGE THE
    REM # PATH TO COMSKIP
    REM ######################################
     
    echo. >> Thumbs_TVServerGenerated.log
    echo Running comskip... >> Thumbs_TVServerGenerated.log
    C:\MediaWah\Programs\comskip\comskip.exe -t "%path_and_filename%"
     
     
    REM ######################################
    REM # CLOSE THE LOG FILE
    REM ######################################
     
    echo. >> Thumbs_TVServerGenerated.log
    echo Finished: %time% %date% >> Thumbs_TVServerGenerated.log
    echo. >> Thumbs_TVServerGenerated.log
     
     
    :endofbatfile
     
    pause
     
    Last edited:

    Users who are viewing this thread

    Top Bottom