My guide to elminating juddering/stuttering play back (plus an upscale guide!) | Page 5

Discussion in 'MediaPortal 1 Talk' started by FireAza, May 22, 2012.

  1. FireAza

    FireAza Portal Pro

    Joined:
    June 30, 2011
    Messages:
    50
    Likes Received:
    10
    Ratings:
    +10 / 0
    Hey Scythe42, just a quick question for you. You previously recommended that for the SD profile, blur should be performed before resizing. I'm just wondering what the theory is on that. To me, it seems odd that you would want to make the original video blurry before blurring it further when you resize it. If you were blurring it AFTER, that makes sense to me, since this would help to "soften up" the picture that results from the resize, making it less blocky.


     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Scythe42
    • Premium Supporter

    Scythe42 Retired Team Member

    Joined:
    June 20, 2009
    Messages:
    2,065
    Likes Received:
    2,632
    Gender:
    Male
    Occupation:
    Professional Hacker
    Location:
    Berlin
    Ratings:
    +2,724 / 1
    Home Country:
    Germany Germany
    Show System Specs
    In fact what feels natural to you is illogical...

    Looks like you are misunderstanding "blocky" with aliasing. Resizing never makes the picture more blocky...

    Scaling introduces three types of artficats:
    • blurriness
    • aliasing
    • ringing
    And these are the ones you want to limit.

    With blurring before resizing you reduce the original artifacts in the SD source and also limit the aliasing the resizing operation introduces. And to reduce the blurriness a resizing operation introduces (resizing itself is a kind of noise reducer) you want to sharpen the result a bit. This approach also reduces the ringing.

    Sharpening (in itself a noise introducer) should also be performed on 1080p scene rips as well to reduce the compression artifacts, but only a tiny amount. For original blurays there isn't much you can do, so leave them untouched. For xvid, don't blur but deblock (very agressive blurring...) to make them at least a bit watchable.

    Blurring after resizing just makes the picture even more blurry and does nothing to the picture quality. In fact you even lose more details and put way more stress on your GPU/CPU for a worse result. The same detail loss happens if you blur the original image too much.

    Try it for yourself in Photoshop for example or read any book ever published on digital image post-processing...

    PS: Usually for SD sources scaled up to 1080p it would be better to scale the picture up to 2x1080, do the sharpening and then scale it down to 1x1080p. This will be even nicer for SD sources.
     
    Last edited: July 1, 2012
    • Like Like x 1
  4. FireAza

    FireAza Portal Pro

    Joined:
    June 30, 2011
    Messages:
    50
    Likes Received:
    10
    Ratings:
    +10 / 0
    Technology makes my head spin sometimes ;) You clearly know what you're talking about, so I'll take your word for it :)

    Your PS is an interesting point, guides I'd read said to scale the image past 1920x1080, which is what I originally had in my SD profile, but you suggested to scale to 1920x1080 instead. So, uh, should I be blurring then upscaling to 1920x1080 like I am now, or would resizing 2x1080, sharpening and resizing again be better? Wait, does ffdshow even have the ability to add a second resize?
     
    Last edited: July 1, 2012
  5. Scythe42
    • Premium Supporter

    Scythe42 Retired Team Member

    Joined:
    June 20, 2009
    Messages:
    2,065
    Likes Received:
    2,632
    Gender:
    Male
    Occupation:
    Professional Hacker
    Location:
    Berlin
    Ratings:
    +2,724 / 1
    Home Country:
    Germany Germany
    Show System Specs
    You can do upscale, sharp, downscale with avisynth inside ffdshow. If you use avisynth then turn off resizing and sharpening in ffdshow!

    Here are some avisynth scripts for 2.60. Don't use the 2.58, as it does process chunks and not the full picture and can introduce artifacts at the end of the chunk in some cases. If you have stability problems, use 2.58 anyway. Up to you. 2.60 is known to have issues with m2ts files.

    Notes:
    • Make sure you have LimitedSharpenFaster and/or LSFMod scripts installed for Avisynth (check the Doom9 posts for more).
    • To switch from LimitedSharpenFaster to LSFMod, just add # before the first and remove the # before the later (LSFMod is better, but requires more power).
    • Uncheck "Add ffdshow video source" in Avisynth
    • Only check "YV12" under "Input Color Space" in Aviynth
    • Check "Buffer Back/Ahead" and put "0" and "10" into the fields
    • Replace the "4" in "SetMTMode(3,4)" with the number of threads the CPU can handle (0 = auto)
    • Replace "SetMTMode(2)" with "MTMode(3)" after "ffdshow_source()" if you have stability issues
    • Replace "SetMemoryMax(512)" with "SetMemoryMax(1024)" and use "0" and "15" for "Buffer Back/Ahead" if you see glitches with LSFMod.
    • The ss_x and ss_y in LimitedSharpernFaster and LFSMod is the scaling of the current picture that should be done inside the sharpening. I used 2.0 for SD sources and 1.0 for HD sources.
    • You might want to try 1.5 for HD sources sharpening, though. (and this is where the 1.5 original comes from, you used for you initial scripts. They were intended for Avisynth Sharpening and NOT for scaling, as the Avisynth scripts do upscale, sharpen, downscale). Adjust the scripts as needed! Read the Avisynth Wiki! Not providing any support here if you modify these scripts.
    • Note Avisynth require a more powerful CPU than native ffdshow but provides better results!
    1080p
    Code (Text):
    1.  
    2. SetMemoryMax(512)
    3. SetMTMode(3,4)
    4. ffdshow_source()
    5. SetMTMode(2)
    6. LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=20)
    7. #LSFMod(defaults="slow",ss_x=1.0,ss_y=1.0,strength=40)
    8. SetMTMode(1)
    9. GetMTMode(false) > 0 ? distributor() : last
    10.  
    720p
    Code (Text):
    1.  
    2. SetMemoryMax(512)
    3. SetMTMode(3,4)
    4. ffdshow_source()
    5. SetMTMode(2)
    6. dispWidth = 1920
    7. dispHeight = 1080
    8. mWidth = float(last.width)
    9. mHeight = float(last.height)
    10. ratio = (mWidth/mHeight)
    11. newHeight= round((dispWidth/ratio)/2)*2
    12. newHeight > dispHeight ? Eval("""
    13. newHeight=dispHeight
    14. newWidth=round((newHeight*ratio)/2)*2
    15. """) : Eval("""
    16. newWidth=dispWidth
    17. """)
    18. spline64resize(newWidth,newHeight)
    19. LimitedSharpenFaster(ss_x=1.0,ss_y=1.0,strength=45)
    20. #LSFMod(defaults="slow",ss_x=1.0,ss_y=1.0,strength=80)
    21. SetMTMode(1)
    22. GetMTMode(false) > 0 ? distributor() : last
    23.  
    DVD, XVid, h246
    Code (Text):
    1.  
    2. SetMemoryMax(512)
    3. SetMTMode(3,4)
    4. ffdshow_source()
    5. SetMTMode(2)
    6. dispWidth = 1920
    7. dispHeight = 1080
    8. mWidth = float(last.width)
    9. mHeight = float(last.height)
    10. ratio = (mWidth/mHeight)
    11. newHeight= round((dispWidth/ratio)/2)*2
    12. newHeight > dispHeight ? Eval("""
    13. newHeight=dispHeight
    14. newWidth=round((newHeight*ratio)/2)*2
    15. """) : Eval("""
    16. newWidth=dispWidth
    17. """)
    18. spline64resize(newWidth,newHeight)
    19. LimitedSharpenFaster(ss_x=2.0,ss_y=2.0,strength=45)
    20. #LSFMod(defaults="slow",ss_x=2.0,ss_y=2.0,strength=80)
    21. SetMTMode(1)
    22. GetMTMode(false) > 0 ? distributor() : last
    23.  
     
    Last edited: July 1, 2012
  6. FireAza

    FireAza Portal Pro

    Joined:
    June 30, 2011
    Messages:
    50
    Likes Received:
    10
    Ratings:
    +10 / 0
    Hi there, sorry for the late response, I'm only just now getting around to trying it out :D

    I've installed what I thought was AviSynth 2.6.0 (got it from HERE, but the installer installed it to a directory called "AviSynth 2.5"! Did I get the right version and they forgot to update the version number in the installer or something?

    Where you say "To switch from LimitedSharpenFaster to LSFMod, just add # before the first and remove the # before the later" you mean add a # in front of "LimitedSharpenFaster(ss_x=2.0,ss_y=2.0,strength=45)" and remove the # in front of "LSFMod(defaults="slow",ss_x=2.0,ss_y=2.0,strength=80)" right?

    Okay, I'm getting an error when I play a video that says "Script error: there is no function named 'SetMTMode' (ffdshow_filter_avisynth_script, line 2)". Now, I'm assuming that's because I haven't installed the "require filters" listed on the LSFmod wiki pages. So, starting with MaskTools... Uh, what exactly am I suppose to be installing? I've got a zip file with a whole bunch of stuff in it, including some dlls. I thought all AVISynth scripts had a .avs extension?
     
    Last edited: July 12, 2012
  7. kirk1

    kirk1 Portal User

    Joined:
    March 10, 2008
    Messages:
    39
    Likes Received:
    7
    Gender:
    Male
    Occupation:
    Web Content Developer
    Location:
    Adelaide
    Ratings:
    +7 / 0
    Home Country:
    Australia Australia
    Show System Specs
    Thank you all so much for this thread!!!

    I had some major issues with dropped frames on HD channels and when returning to live TV from watching a movie on all channels. The picture was jittering bad and I had played around with all the refresh rate settings.

    Now all that appears fixed. I can still see the odd dropped frame on a slow pan but not even a tenth of how it was.

    One thing though using the 'shift + 1' option it shows a lot of dropped frames. I can notice when I bring up the tool the screen noticeably drops frames, the same happens when bringing up the mini guide. I can live with this, but I wouldn't mind being able to use the diagnostic tool to get an accurate idea of dropped frames.

    Again thanks for all the hard work and the education!!!
     
  8. FireAza

    FireAza Portal Pro

    Joined:
    June 30, 2011
    Messages:
    50
    Likes Received:
    10
    Ratings:
    +10 / 0
    Quick question: are the dropped frames you're getting only on live TV or also when you're using My TV Series or Moving Pictures or something? I don't use live TV, so all my tweaks are geared towards getting local media to play ball.
     
  9. kirk1

    kirk1 Portal User

    Joined:
    March 10, 2008
    Messages:
    39
    Likes Received:
    7
    Gender:
    Male
    Occupation:
    Web Content Developer
    Location:
    Adelaide
    Ratings:
    +7 / 0
    Home Country:
    Australia Australia
    Show System Specs
    Just checked on Moving Pictures and it doesn't get many dropped frames at all, watched for a few minutes and the drop frames count didn't move. It must have dropped a few when the file opened as it stayed at 10 the whole time.

    My issue appears to be strictly Live TV, but I can say the tweaks have made a lot of difference to the picture clarity and overall 'smoothness'. As I said though it is hard for me to tell how many dropped frames I am getting from within media portal as any overlay (including the diagnostic tool) creates visible dropped frames.

    For now I am happy this is the best I have ever had my live tv or downloaded media look.

    If you know of any 3rd party software or if there is a log that will display dropped frames let me know I'd be more than happy to further investigate if your interested.

    Edit:

    Further investigation on the Live TV dropped frames, it's not the overlay it is anything in MediaPortal that is left open. For example if I go from Moving Pictures to Live TV using the Live TV button on my remote I will get dropped frames. If I go to live TV via the MediaPortal menu (closing Moving Pictures) I don't get visable dropped frames. A bit off topic but seeing I mentioned it earlier ;)
     
    Last edited: July 13, 2012
  10. Scythe42
    • Premium Supporter

    Scythe42 Retired Team Member

    Joined:
    June 20, 2009
    Messages:
    2,065
    Likes Received:
    2,632
    Gender:
    Male
    Occupation:
    Professional Hacker
    Location:
    Berlin
    Ratings:
    +2,724 / 1
    Home Country:
    Germany Germany
    Show System Specs
    @FireAza: I'll create a small attachment for you with all the AVISynth stuff when I have time plus the the matching ffdshow profiles for you to play with... Might need a few days as I don't have them live and need to dig through my backups...
     
  11. kirk1

    kirk1 Portal User

    Joined:
    March 10, 2008
    Messages:
    39
    Likes Received:
    7
    Gender:
    Male
    Occupation:
    Web Content Developer
    Location:
    Adelaide
    Ratings:
    +7 / 0
    Home Country:
    Australia Australia
    Show System Specs
    I spoke too soon ...... the ffdshow profiles were a little resource hungry to run SD profile so I had to disable the filters only leaving the blur filtering, I felt that gave the best results.

    TV still is dropping frames, but the picture looks better than it did before the tweaks. There is also some tearing on the very top of the screen. not very noticable but enough to annoy me. I fixed this by using the TV's 16:9 overscan to cut out the tearing.

    Previously I was using MC7 and on reflection I was probably having some dropped frame issues on Live TV too. Maybe it is reception or hardware issues?
     
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!