1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Frame doubling interpolation for 1080p x264 mkv's for superfluid 48 fps

Discussion in 'The HTPC, HDTV & Ultra High Definition section' started by nzweers, Feb 15, 2009.

  1. neograniceni

    neograniceni Member

    Messages:
    28
    Likes Received:
    0
    GPU:
    Nvidia 9400GT 1GB
    Your script looks/works very good, but it's still too smooth/soap for my taste, so I've fixed it to 90fps expecting to reject 30 frames on 60Hz refresh (i am also using Reclock by default). It looks excellent to me this way. Smooth where it needs to be smooth (camera panning), and slightly juddery exactly where it need to be juddery to prevent soap look (moving objects). I have Core i5 in my HTPC and Xeon W3520 (the same as i7 920) in the other machine I am currently working/testing on. 90fps with Your script loads this Xeon to 30-35% with HT enabled and 1920p most demanding MKV's I have. There is still enough CPU power left to rise MBlockFps mode, or lower blocksize, or do some additional deband/denoise/sharping. I wrote a script that detects 720p/1080p video and set the options according to video resolution and original framerate (23.976/24/25/50fps video to 50/75 fps, and 29.97/30/60fps video to 60/90fps). Thank you very much for your script, can't wait to return home to try all this stuff on i5. I am planning to change my i5 for i7 860 just 'coz of hyper-threading that really unload CPU usage for 30-35% using 8 virtual threads and 16 threads in SetMTMode. Finnaly something useful from HT and raw CPU power :)
     
  2. widezu69

    widezu69 Member

    Messages:
    40
    Likes Received:
    0
    GPU:
    GTX 780m 4GB
    Nice one. Here try this script and you are free to modify it your way, its your computer anyway.

    SetMemoryMax(1280)
    SetMTMode(5,8)
    ffdShow_source()
    SetMTMode(2)
    super=MSuper(pel=2, hpad=0, vpad=0)
    backward_1=MAnalyse(super, chroma=false, isb=true, blksize=32, blksizev=16, searchparam=0, plevel=2, search=3, badrange=(-24))
    forward_1=MAnalyse(super, chroma=false, isb=false, blksize=32, blksizev=16, searchparam=0, plevel=2, search=3, badrange=(-24))
    backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=16, blksizev=8, searchparam=0, search=3)
    forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=16, blksizev=8, searchparam=0, search=3)
    backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=8, blksizev=4, searchparam=0, search=3)
    forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=8, blksizev=4, searchparam=0, search=3)
    MBlockFps(super, backward_3, forward_3, num=60, den=1, mode=0)
    SetMTMode(1)
    GetMTMode(false) > 0 ? distributor() : last

    This one analyses frames 3 times/recalculates everything twice reducing blocksizes as it goes, reducing artefacts. Try it out.
     
  3. RamGuy

    RamGuy Master Guru

    Messages:
    211
    Likes Received:
    0
    GPU:
    nVIDIA GeForce GTX 580
    This might sound rather n00bish, but how do I managed to get this tweak working with CoreAVC 2.0 / CUDA for full GPU playback in Media Player Classic Home Cinema?

    Does CoreAVC and FFDShow somehow work together?
    That would be rather awkward as every MPC-HC CoreAVC guide I've read specifically tells me to block off FFDShow?


    Same goes for the DXVA I read, they also told me to block off FFDShow?
    So how am I exactly supposed to handle my MPC-HC settings? EVR Sync, EVR Pref? What to include, exclude and / or block of the external filters? Etc..


    I try to always keep my MPC-HC up to date with the latest complies from http://www.xvidvideo.ru/media-player-classic-home-cinema-x86-x64/

    I use it with the combination of MPC-HC x64 + K-Lite Mega Codec Pack (default) and CoreAVC 2.0 and manually updating FFDShow to latest x64 bit version + Avisynth x64 + MT + MVTools.



    So what exactly would be the best settings for me on my MacBook Pro 17" running Windows7 Ultimate 64-bit (Core i5-540M + GeForce G330M / 197.45)

    I mostly play 1080P raw Blu-Ray rips (those crazy 35-50GB) and some Lost / 24 720P episodes, all with MPC-HC.
     
  4. FULMTL

    FULMTL Ancient Guru

    Messages:
    6,704
    Likes Received:
    2
    GPU:
    AOC 27"
    kool stuff, finally got around to messing with this. The only problem I have right now is really just the iffy video seeking. If I choose a spot in the video, it will studder the first few seconds of that file and then maybe 5 seconds later it will show the proper part of the video. Sometimes the sound will not be synced up either ;/
     

  5. widezu69

    widezu69 Member

    Messages:
    40
    Likes Received:
    0
    GPU:
    GTX 780m 4GB
    Hi there, go here:

    http://forums.guru3d.com/showpost.php?p=3541170&postcount=169

    I wrote this guide to help people get everything to work properly. It contains ways of getting coreavc to work with ffdshow. Check it out. You won't be disappointed.
     
  6. widezu69

    widezu69 Member

    Messages:
    40
    Likes Received:
    0
    GPU:
    GTX 780m 4GB
    Yeah thats part of the way it works. I can't seem to get rid of it. Don't drag your seek bar, just click on the place you want. Because of the way Avisynth keeps the interpolted frames for the amount you specify in buffer back/ahead, it'll render them again on top of your newly selected video. What I do is just click somewhere and wait. If it is the wrong place, wait for it to finish stuttering usually does it for around 1 or 2 seconds, then wait some more and seek again. Getting it to work properly, check the next post, tis a guide.
     
  7. widezu69

    widezu69 Member

    Messages:
    40
    Likes Received:
    0
    GPU:
    GTX 780m 4GB
    Previous guide bumped to keep up with the thread.

    Here goes. This guide is for playback only. I'm sure other gurus here can alter this guide for VirtualDub and MeGUI etc, but not me. I recommend that you start with a clean palate. Uninstall all your codecs and players etc. and follow this guide.
    A great site is afterdawn.com it has all the latest and greatest that we need for this to work.

    For those who wish to dish a few bucks and have a nVidia card. Go out and buy CoreAVC and enable cuda in the settings. This will basically allow your GPU to do the x264/h.264/AVC decoding. Install it with the Haali options for the file types you wish to play.

    Download K-Lite Mega Codec pack and install ONLY Media Player Classic Regular NOTHING ELSE. This player gives me the least headaches when trying to get everything to work. Enable the internal subtitle renderer, all other options are optional for your liking but the subtitle renderer is required as the ffdshow subtitle renderer sometimes messes up everything whilst doing Avisynth operations. Also Make MPC the default player for all video types, reason being that the codec pack has some nice bonuses with file type icons that look pretty sweet. Once installed, open up MPC and enter the options window. Select your renderer as the Haali Renderer, then click the internal filters tab and uncheck everything in both columns. Apply and exit the player, don't attempt to play anything yet unless you've installed CoreAVC.

    (CoreAVC users) Play a h.264 encoded video. Hopefully your tray should have a green CoreAVC icon indicating cuda is in use. Start Task Manager and check, your CPU usage, it should be hovering at a very low usage indicating your GPU is doing all the work.

    Download and install Avisynth FIRST...

    THEN Download and install the newest ffdshow, during the installation, uncheck VFW and check all the Avisynth options. Install ffdshow with your required codecs. Launch ffdshow after the installation and do the audio settings for your speaker configuration. Disable the DXVA codec (its useless really as all other filters are then disabled including Avisynth. Make sure you enable all your needed codecs in the codecs tab.

    CoreAVC users must select the h.264 option in ffdshow as disabled and then enable RAW video to all supported. Then start MPC, options and click on external filters and add ffdshow as 'preferred'. This allows CoreAVC to do the decoding with the GPU, then passing the video to ffdshow for filtering using the CPU.

    Everyone should be able to play a video now. And onto customising we go. The ffdshow tabs on the left hand side also dictate the order the filters are applied to the video. If using interlaced video, arrange Deinterlacing furthest up, use Yadif without doubling framerate, next comes picture properties for altering colour etc. Then Avisynth. All other filters go underneath. Especially Resize, we don't want to waste CPU power by processing a large upscaled video when we can process a smaller video and then upscale it afterwards. In the Output tab check high quality conversion, in the rgb conversion tab, check the same and uncheck Dithering. Now we should have ffdshow configured apart from the Avisynth tab.

    To set up Avisynth, download:

    Working stable MT for mutithreading here: http://www.mediafire.com/file/nnbngf...isynth258MT.7z
    Put the avisynth.dll in your system32 folder or SysWOW64 (if using 64 bit) if you aren't prompted to replace the original your putting it in the worng place, put the other dlls in your plugins folder in the Avisynth directory replacing the originals.

    System dlls to stop ffdshow crashing here:
    http://www.megaupload.com/?d=SP5FE2KG
    Place them in your system32 or SysWOW64 folder. For some reason, without these, Avisynth+ffdshow=crash.

    Framedoubling plugin here:
    http://avisynth.org.ru/mvtools/mvtools2.html
    The link is at the bottom of the page. put it in your Avisynth plugins directory.

    Everything is in place, hopefully. Open up ffdshow and check the Avisynth tab. Uncheck add ffdshow video source, check YV12 only. Buffer back ahead varies with different people, best to keep this checked and start with 0/10 but experiment with 10/10 or 0/24 or whatever suits you.

    Now add this script to the box:

    SetMemoryMax(1280)
    SetMTMode(5,4)
    ffdShow_source()
    SetMTMode(2)
    super=MSuper(pel=1, hpad=0, vpad=0)
    backward_1=MAnalyse(super, chroma=false, isb=true, blksize=16, blksizev=16, searchparam=3, plevel=0, search=3, badrange=(-24))
    forward_1=MAnalyse(super, chroma=false, isb=false, blksize=16, blksizev=16, searchparam=3, plevel=0, search=3, badrange=(-24))
    backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=16, blksizev=8, searchparam=0, search=3)
    forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=16, blksizev=8, searchparam=0, search=3)
    backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=8, blksizev=8, searchparam=0, search=3)
    forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=8, blksizev=8, searchparam=0, search=3)
    MBlockFps(super, backward_3, forward_3, num=FramerateNumerator(last)*2, den=FramerateDenominator(last)*1, mode=0)
    SetMTMode(1)
    GetMTMode(false) > 0 ? distributor() : last

    For 60fps, change:
    MBlockFps(super, backward_2, forward_2, num=FramerateNumerator(last)*2, den=FramerateDenominator(last)*1, mode=0)
    to
    MBlockFps(super, backward_2, forward_2, num=60, den=1, mode=0)

    For the ultimate smoothness, make sure that num=x where x being a multiple of your monitor refresh rate. For example if you have 100hz monitor you want 50fps or 100fps. If you have a 120hz monitor you want 60fps or 120fps.

    For Quad-Core users, change SetMTMode(5,4) to SetMTMode(5,8)

    Changing mode=0 to mode=2 will reduce artefacts but to me its not perfectly smooth and it sucks cpu, I keep it on 0.

    Now for changing it for your liking, the lower the searchparam number, the less the artifacts but less smooth. You only need to change the first pair, as you can see, the second 2 searchparam's are 0 and they can stay like that. Also the plevel=0 can be changed up to plevel=2 for minimal artifacts but less smooth movement. If you think you still have enough cpu power, change pel=1 to pel=2 for better motion accuracy (this eats cpu like the effing cookie monster!).

    For the best enjoyment:artifact ratio, best keep the script as it is unless you have more power and you can apply the alternatives.

    I hope this helps. If you are kind enough, make me a small donation? Just PM me
     
    Last edited: May 1, 2010
  8. neograniceni

    neograniceni Member

    Messages:
    28
    Likes Received:
    0
    GPU:
    Nvidia 9400GT 1GB
    Well, after some hours of testing, I can confirm that rendering more frames than refresh rate is the best way to stay away of soap effect and artefacts, while keeping video much smoother in panning and moving than unprocessed 24p (and even my Toshiba Regza with 5:5 pulldown and smooth options processing 24p to 120Hz can't come any closer to smoothness than this). This method really pushes my movies watching experience to the next level. As I mentioned before, forcing 24p video to 75fps using 50Hz looks great, and forcing 24p video to 90fps on 60Hz TV looks even better. The whole idea is to render 1/2 of refreshrate frames more, and then reject 1/3 of them to achieve some judder. Well, You need some fast quad CPU to use this. On my Core i7 860 at stock speed (HT enabled) + Nvidia 9400GT Cuda using CoreAVC even most demanding MKV's in 1080p work with ~50% CPU usage. So basically You just need to set the framerate to 75 (for 50Hz TV) or 90 (for 60Hz TV) and set Reclock to Auto. It really looks great on my TV (using W7 x64 / MPC-HC / CoreAVC / ffdshow / Reclock / i7 860 / 9400GT / 4GB). So if You have enough horse power under the hood feel free to experiment. I would like to hear any comment/experience on this.
     
  9. RamGuy

    RamGuy Master Guru

    Messages:
    211
    Likes Received:
    0
    GPU:
    nVIDIA GeForce GTX 580
    I'm getting this "Script error: there is no function named 'SetMtmode' (ffdshow_filter_avisynth_script, line 1)
     
  10. firecutter23

    firecutter23 New Member

    Messages:
    7
    Likes Received:
    0
    GPU:
    Gigabyte GTX480 (finally)
    it worked very fine with me .. and i must say it ... this script rocks , i didnt think that it will work but it did !!! now all of my anime and movies are extremely smooth ... the best thing is the smoothness in my HD BBC documentry movies ... i have a windows 7 64-bit and it works like a charm ... maybe it will be pretty hard for newbies to accomplish this script .. but trust me .. its worth it .. nice one nzweers .. thanks .
     

  11. VzK

    VzK Member

    Messages:
    13
    Likes Received:
    1
    GPU:
    ATI HD5850 1GB GDDR5
    I've read all pages and I've tested it all.
    As long avisynth is enabled, MPC crashes every time I open a file.

    Man, I've been trying all sorts of stuff for a week and none seems to work...

    :cry:
     
  12. FULMTL

    FULMTL Ancient Guru

    Messages:
    6,704
    Likes Received:
    2
    GPU:
    AOC 27"
    Ok, after much more fiddling around I came to a conclusion that if the video is 720 or 1080 you should play at 48FPS or it will crash or freeze at 60FPS because your CPU usage is going above 86%. The CPU isnt getting hot on my PC because I have it watercooled, so Im not sure what the problem is? If you play a smaller "dvd quality" movie, then 60FPS is perfectly fine and the CPU usage floats halfway.

    I prefer 60FPS for anime because its typically less smooth than a live action movie, but majority of fansubs nowadays are 720P and pretty high quality. 48FPS doesnt seem to help anime much :( I can however find some of my old anime that is DVD quality and 60FPS looks pretty slick. So Im kind of stuck inbetween.

    It would be really great if this worked for DVD's though
     
  13. alexey77

    alexey77 New Member

    Messages:
    5
    Likes Received:
    0
    GPU:
    nvidia gtx
    Hi, im video smoothing fan :)

    Now im waitning for mirillis morion2 system.
    http://mirillis.com/picture2.html - there are some samples to download.

    Played a lot with avisynth and power dvd motionsomethin, but my conclusion is both are bad :/

    Powerdvd system does nothing :) really, it works only sometimes and does not work for HD :) BIG disapointment!

    Avisynth is much better, general image quality is quite good but it ruins all complicated logos/text in the video and sometimes produces quite strange/big artefacts.
    And seeking with BSplayer and mpc-hc is a nightmare, crashing or getting corrupted video :/
     
  14. Corrupt^

    Corrupt^ Ancient Guru

    Messages:
    6,868
    Likes Received:
    236
    GPU:
    ASUS 1080GTX STRIX
    Seeking with frame rate interpolation is just slow because it has to buffer all the frames.
     
  15. somebody2978

    somebody2978 Member

    Messages:
    42
    Likes Received:
    0
    GPU:
    ZOTAC GTX 650 Ti 2GB AMP!
    A question. Command pel=2 reduce the artefacts and keep smoothness?
     

  16. vurt

    vurt Master Guru

    Messages:
    257
    Likes Received:
    0
    GPU:
    1080ti Strix OC
    nvm...
     
    Last edited: Apr 30, 2010
  17. neograniceni

    neograniceni Member

    Messages:
    28
    Likes Received:
    0
    GPU:
    Nvidia 9400GT 1GB
    Remove SetMemoryMax(1280) and try again. I have a lot of problems using SetMemoryMax command on three different machines (crashing). Go to xvideo.ru and download/install some fresh ffdshow and mpc-hc builds. Also set EVR in MPC-HC, not EVR custom or sync !
     
  18. widezu69

    widezu69 Member

    Messages:
    40
    Likes Received:
    0
    GPU:
    GTX 780m 4GB
    Yeah pel controls the level of estimation. pel=1 is perpixel, pel=2 is half pixel. pel=2 reduces some blockiness on outlines and edges.

    It has no effect on smoothness.

    I will keep with thread updated with new scripts that are good to use.
     
  19. widezu69

    widezu69 Member

    Messages:
    40
    Likes Received:
    0
    GPU:
    GTX 780m 4GB
    Previous guide bumped to keep up with the thread.

    Here goes. This guide is for playback only. I'm sure other gurus here can alter this guide for VirtualDub and MeGUI etc, but not me. I recommend that you start with a clean palate. Uninstall all your codecs and players etc. and follow this guide.
    A great site is afterdawn.com it has all the latest and greatest that we need for this to work.

    For those who wish to dish a few bucks and have a nVidia card. Go out and buy CoreAVC and enable cuda in the settings. This will basically allow your GPU to do the x264/h.264/AVC decoding. Install it with the Haali options for the file types you wish to play.

    Download K-Lite Mega Codec pack and install ONLY Media Player Classic Regular NOTHING ELSE. This player gives me the least headaches when trying to get everything to work. Enable the internal subtitle renderer, all other options are optional for your liking but the subtitle renderer is required as the ffdshow subtitle renderer sometimes messes up everything whilst doing Avisynth operations. Also Make MPC the default player for all video types, reason being that the codec pack has some nice bonuses with file type icons that look pretty sweet. Once installed, open up MPC and enter the options window. Select your renderer as the Haali Renderer, then click the internal filters tab and uncheck everything in both columns. Apply and exit the player, don't attempt to play anything yet unless you've installed CoreAVC.

    (CoreAVC users) Play a h.264 encoded video. Hopefully your tray should have a green CoreAVC icon indicating cuda is in use. Start Task Manager and check, your CPU usage, it should be hovering at a very low usage indicating your GPU is doing all the work.

    Download and install Avisynth FIRST...

    THEN Download and install the newest ffdshow, during the installation, uncheck VFW and check all the Avisynth options. Install ffdshow with your required codecs. Launch ffdshow after the installation and do the audio settings for your speaker configuration. Disable the DXVA codec (its useless really as all other filters are then disabled including Avisynth. Make sure you enable all your needed codecs in the codecs tab.

    CoreAVC users must select the h.264 option in ffdshow as disabled and then enable RAW video to all supported. Then start MPC, options and click on external filters and add ffdshow as 'preferred'. This allows CoreAVC to do the decoding with the GPU, then passing the video to ffdshow for filtering using the CPU.

    Everyone should be able to play a video now. And onto customising we go. The ffdshow tabs on the left hand side also dictate the order the filters are applied to the video. If using interlaced video, arrange Deinterlacing furthest up, use Yadif without doubling framerate, next comes picture properties for altering colour etc. Then Avisynth. All other filters go underneath. Especially Resize, we don't want to waste CPU power by processing a large upscaled video when we can process a smaller video and then upscale it afterwards. In the Output tab check high quality conversion, in the rgb conversion tab, check the same and uncheck Dithering. Now we should have ffdshow configured apart from the Avisynth tab.

    To set up Avisynth, download:

    Working stable MT for mutithreading here: http://www.mediafire.com/file/nnbngfccnj2/avisynth258MT.7z
    Put the avisynth.dll in your system32 folder or SysWOW64 (if using 64 bit) if you aren't prompted to replace the original your putting it in the worng place, put the other dlls in your plugins folder (including MT) in the Program Files Avisynth directory replacing the originals.

    System dlls to stop ffdshow crashing here:
    http://www.megaupload.com/?d=SP5FE2KG
    Place them in your system32 or SysWOW64 folder. For some reason, without these, Avisynth+ffdshow=crash.

    Framedoubling plugin here:
    http://avisynth.org.ru/mvtools/mvtools2.html
    The link is at the bottom of the page. put it in your Avisynth plugins directory.

    Everything is in place, hopefully. Open up ffdshow and check the Avisynth tab. Uncheck add ffdshow video source, check YV12 only. Buffer back ahead varies with different people, best to keep this checked and start with 0/10 but experiment with 10/10 or 0/24 or whatever suits you.

    Now add this script to the box:

    SetMemoryMax(1280)
    SetMTMode(5,4)
    ffdShow_source()
    SetMTMode(2)
    super=MSuper(pel=1, hpad=0, vpad=0)
    backward_1=MAnalyse(super, chroma=false, isb=true, blksize=16, blksizev=16, searchparam=3, plevel=0, search=3, badrange=(-24))
    forward_1=MAnalyse(super, chroma=false, isb=false, blksize=16, blksizev=16, searchparam=3, plevel=0, search=3, badrange=(-24))
    backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, blksizev=8, searchparam=0, search=3)
    forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, blksizev=8, searchparam=0, search=3)
    MBlockFps(super, backward_2, forward_2, num=FramerateNumerator(last)*2, den=FramerateDenominator(last)*1, mode=0)
    SetMTMode(1)
    GetMTMode(false) > 0 ? distributor() : last

    For 60fps, change:
    MBlockFps(super, backward_2, forward_2, num=FramerateNumerator(last)*2, den=FramerateDenominator(last)*1, mode=0)
    to
    MBlockFps(super, backward_2, forward_2, num=60, den=1, mode=0)

    For the ultimate smoothness, make sure that num=x where x being a multiple of your monitor refresh rate. For example if you have 100hz monitor you want 50fps or 100fps. If you have a 120hz monitor you want 60fps or 120fps.

    For Quad-Core users, change SetMTMode(5,4) to SetMTMode(5,8)

    Changing mode=0 to mode=2 will reduce artefacts but to me its not perfectly smooth and it sucks cpu, I keep it on 0.

    Now for changing it for your liking, the lower the searchparam number, the less the artifacts but less smooth, anything higher than 2 gives nice smoothness. Also the plevel=0 can be changed up to plevel=2 for minimal artifacts but less smooth movement. If you think you still have enough cpu power, change pel=1 to pel=2 for better motion accuracy, it reduces some artefacts with no affect on smoothness (this eats cpu like the effing cookie monster!).

    For the best enjoyment:artifact ratio, best keep the script as it is unless you have more power and you can apply the alternatives.

    I hope this helps. If you are kind enough, make me a small donation? Just PM me
     
    Last edited: May 19, 2010
  20. allesclar

    allesclar Ancient Guru

    Messages:
    5,613
    Likes Received:
    84
    GPU:
    GeForce GTX 1070
    any chance of getting this to work on windows 7 64 at all?
     

Share This Page