Avisynth Script for doubling video frame rates - Page 15 - AVS Forum | Home Theater Discussions And Reviews
Forum Jump: 
Reply
 
Thread Tools
post #421 of 1969 Old 07-03-2010, 04:42 PM
Member
 
Join Date: Feb 2006
Posts: 82
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 11
Quote:
Originally Posted by neograniceni View Post

Be sure to use this avisynth.dll instead of the version from.....

what i really care in your post is that you are better to point the original link (http://forum.doom9.org/showthread.php?t=144852) to respect the original author.
PetitDragon is offline  
Sponsored Links
Advertisement
 
post #422 of 1969 Old 07-03-2010, 11:17 PM
Member
 
neograniceni's Avatar
 
Join Date: Jan 2008
Posts: 20
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by PetitDragon View Post

what i really care in your post is that you are better to point the original link (http://forum.doom9.org/showthread.php?t=144852) to respect the original author.

Thanks for the original link 'coz I really don't know/could not remember where I got that "working" avisynth.dll from. Respect to the original author and my apologies, I'll change links through my posts to include the original site.
neograniceni is offline  
post #423 of 1969 Old 07-03-2010, 11:34 PM
Senior Member
 
johnifehr's Avatar
 
Join Date: May 2008
Posts: 459
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by neograniceni View Post

For those who want to experiment with and meets the following requirements: Core i5/i7, 50Hz/60Hz capable TV, MPC-HC set to use EVR renderer and to automatically switch to 50Hz for 23.976/24/25fps video, and 60Hz for 29.97/30fps video. Reclock set to auto is also recommended. CoreAVC with Nvidia CUDA capable gfx card is also recommended. Be sure to use avisynth.dll from this link instead of the version from avisynth page (to avoid possible MPC-HC freezing problems). Set ffdshow AviSynth buffer to 0/16 or 0/12 if You have problems with 0/16. You can also comment/remove the line SetMemoryMax(1280) to avoid possible ffdshow freezings in some cases.

So, here is the script I use for a couple of months now on my Core i7 860 based HTPC + Toshiba Regza 37Z3030DG LCD TV. It works and looks really really good. The idea is to interpolate 23.976/24fps videos to 75fps for 50Hz display output ((HD) movies), and 29.97/30fps videos to 60fps for 60Hz display output (TV shows, concerts etc.). I found 75fps movies with 50Hz TV output have more cinematic look (much less soap/handycam look) than those interpolated just to double or to the same framerate as the output frequency is (60fps/60Hz or 50fps/50Hz). Artefacts are also reduced. It's due to some slight judder introduction that makes movies look more cinematic / less soapy. The script has two sections; the first interpolates videos with less than or equal to 1400 horiz. pixels (usually 720p, DVDs, SD), and the second one interpolates videos larger than 1400 pix. horiz. (usually 1080p). The difference is only in MBlockFps mode=2 parameter (higer values utilise more CPU, but look better). But you are free to change everything else according to your needs and/or the abilities of your system.



SetMemoryMax(1280)
SetMTMode(2,16)
ffdShow_source()
Width <= 1400 ? Eval("""
super=MSuper(pel=2, hpad=8, vpad=8,rfilter=3,levels=0)
backward_vec1=MAnalyse(super,chroma=false, isb=true, blksize=16, blksizev=16, searchparam=0, plevel=0,levels=0,search = 5)
forward_vec1=MAnalyse(super,chroma=false, isb=false, blksize=16, blksizev=16, searchparam=0, plevel=0,levels=0,search = 5)
backward_re = MRecalculate(super,chroma=false, backward_vec1,blksize=8, blksizev=8, thSAD=200, searchparam=0,search = 5)
forward_re = MRecalculate(super,chroma=false, forward_vec1,blksize=8, blksizev=8, thSAD=200, searchparam=0,search = 5)
Framerate == 50 || Framerate == 75 ||Framerate <= 28 ? MBlockFps(super,backward_re, forward_re, num=75, den=1, mode=2) : last
(Framerate > 28 && Framerate <=30) || Framerate == 60 ? MBlockFps(super,backward_re, forward_re, num=60, den=1, mode=2) : last
distributor()
"""): last
Width > 1400 ? Eval("""
super=MSuper(pel=2, hpad=8, vpad=8,rfilter=3,levels=0)
backward_vec1=MAnalyse(super,chroma=false, isb=true, blksize=16, blksizev=16, searchparam=0, plevel=0,levels=0,search = 5)
forward_vec1=MAnalyse(super,chroma=false, isb=false, blksize=16, blksizev=16, searchparam=0, plevel=0,levels=0,search = 5)
backward_re = MRecalculate(super,chroma=false, backward_vec1,blksize=8, blksizev=8, thSAD=200, searchparam=0,search = 5)
forward_re = MRecalculate(super,chroma=false, forward_vec1,blksize=8, blksizev=8, thSAD=200, searchparam=0,search = 5)
Framerate == 50 || Framerate == 75 ||Framerate <= 28 ? MBlockFps(super,backward_re, forward_re, num=75, den=1, mode=0) : last
(Framerate > 28 && Framerate <=30) || Framerate == 60 ? MBlockFps(super,backward_re, forward_re, num=60, den=1, mode=0) : last
distributor()
"""): last



For TVs not capable to work at 50hz You can replace the following lines;

Framerate == 50 || Framerate == 75 ||Framerate <= 28 ? MBlockFps(super,backward_re, forward_re, num=75, den=1, mode=2) : last

and

Framerate == 50 || Framerate == 75 ||Framerate <= 28 ? MBlockFps(super,backward_re, forward_re, num=75, den=1, mode=0) : last

with

Framerate == 90 ||Framerate <= 28 ? MBlockFps(super,backward_re, forward_re, num=90, den=1, mode=2) : last

and

Framerate == 90 ||Framerate <= 28 ? MBlockFps(super,backward_re, forward_re, num=90, den=1, mode=0) : last

But You really need Core i7 with hyperthreading or overclocked Core i5 to do this for heavy 1080p movies and stay below 70% CPU usage.

What would I have to change for a 60hz Projector/tv? just Framerate == 60
johnifehr is offline  
 
post #424 of 1969 Old 07-03-2010, 11:41 PM
Member
 
neograniceni's Avatar
 
Join Date: Jan 2008
Posts: 20
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by johnifehr View Post

What would I have to change for a 60hz Projector/tv? just Framerate == 60

See "For TVs not capable to work at 50hz You can replace the following lines" in my post.
neograniceni is offline  
post #425 of 1969 Old 07-04-2010, 06:36 AM
Newbie
 
OriONCoL's Avatar
 
Join Date: Jul 2010
Posts: 1
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Hello i have this problem!

When i open a video comes this
"Scrip error: there is no function name 'Msuper' (ffdshow_filter_avisynth_script, line 5)

Help please...

btw if u can do a "for dummies" guide... i'll be very thankful!
OriONCoL is offline  
post #426 of 1969 Old 07-04-2010, 05:59 PM
Senior Member
 
SubJunk's Avatar
 
Join Date: May 2010
Posts: 339
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 3 Post(s)
Liked: 10
Quote:
Originally Posted by widezu69 View Post

Hello again, I've been testing encoding movies into 60fps and trying to minimise the artefacts and found that MFlowFps doesn't go smooth enough. Just tested numerous different scripts on the opening scene of Sherlock Holmes where the camera pans over the bricks on the ground and they were still stuttery. So back to MBlockFps.

Did you try testing without the first SetMTMode to see if that fixes the smoothness? I found that using MT before the input is loaded causes problems like weird frame skipping and that might be what happened with your test.
SubJunk is offline  
post #427 of 1969 Old 07-05-2010, 04:24 AM
Member
 
neograniceni's Avatar
 
Join Date: Jan 2008
Posts: 20
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by OriONCoL View Post

Hello i have this problem!

When i open a video comes this
"Scrip error: there is no function name 'Msuper' (ffdshow_filter_avisynth_script, line 5)

Help please...

btw if u can do a "for dummies" guide... i'll be very thankful!


--- Ingredients ---

1. Download and install Avisynth

2. Download and install ffdshow
Select "Select Components / AviSynth script serving" and "Application plugins / AviSynth" during installation

3. Download and install MPC-HC 32-bit

4. Download MVTools2
Extract mvtools2.dll to Avisynth's plugin folder
("c:\\Program Files\\AviSynth 2.5\\plugins\\" on 32-bit Win or "c:\\Program Files (x86)\\AviSynth 2.5\\plugins\\" on 64-bit Win)

5. Download modified avisynth.dll and copy it over the existing one in "\\Windows\\System32\\" folder (32-bit Win), or "c:\\Windows\\SysWOW64\\" folder (64-bit Win)

6. Download and install Reclock (optional)

7. Download and install CoreAVC (optional - useful for Nvidia card due to CoreAVC's CUDA support) - NOT FREE !!!

8. Download and install Haali Media Splitter (it is also included in CoreAVC package, so you could install it from there)


--- Recipe ---

We need to configure ffdshow, MPC-HC, Reclock (and CoreAVC if you plan to use it - and you should if you own some Nvidia CUDA aware gfx card)

1. Run ffdshow Video decoder configuration from the Start menu. Under the Codecs section do as follows: disable H.264/AVC if you use Nvidia gfx, otherwise leave it as it is. Set MPEG2 to libmpeg2. Set AviSynth to AviSynth. Set RAW video to all supported. Go to the AviSynth section; check AviSynth, uncheck Add ffdshow video source, set 3:2 Pulldown to Ignore pulldown, uncheck YUY2, RGB24 and RGB32, set Buffer back/ahead to 0/16 for quad core CPU with hyperthreading (or 0/12 for dual/quad core CPU without hyperthreading, or experiment with something else in case of troubles). Copy/past my script (or any other script you find here) into the script editor. You can also enable subtitles under the Subtitles section and adjust font charset, size, weight, size etc. I suggest using ffdshow subtitles instead of MPC-HC's for maximum control and customization.

2. Run MPC-HC from the Start menu, select View/options and do as follows: under the Player section disable "Store to .ini" file (very important for correct and fast MPC-HC startup). Under the Formats section click the Video button at the bottom right, then click Apply. If you don't want to use MPC-HC's subtitles module (and plan to use ffdshow for subtitles) go to the Playback section and uncheck "Auto-load subtitles". Go to the Output section an check EVR under DirectShow video. Also select Reclock as an Audio Renderer (optional, recommended to avoid video skippings). If you plan to use my script with fixed 60Hz display/TV you can leave the options from the Fullscreen section as they allready are by defaults. In that case you will also need to modify my script as stated below "For TVs not capable to work at 50hz You can replace the following lines;" line (see my previous posts). If your TV is 50Hz capable go to the Fullscreen section and check "Use autochange", also check "Restore resolution on program exit", and set as follows: 23.50-24 Hz, 24.50-25Hz and 23.976Hz (24P) to your TV's max. (native) resolution and 50Hz frequency. For 29.50-30Hz and 29.97Hz (NTSC) set your TV's max. (native) resolution and 60Hz frequency. Go to the Internal Filters section. Uncheck Matroska Source Filters. Uncheck "H264/AVC (DXVA)" and "H264/AVC (FFmpeg)". Go to the External Filters section. Click Add Filter... and search for ffdshow Video Decoder. Select it, then click OK. Repeat the same for Core AVC Video Decoder (if you want to use it as H264 decoder). Also highlight both the filters as preferred.

3. (optional) Run Configure CoreAVC from the Start menu (if you have it installed), be sure to check on "Prefer CUDA acceleration". You can also play with Input/Output levels later during video playback if you find video black level somewhat screwed up.

4. (optional) Run Configure Reclock from the Start menu. Configure it according to your needs. Be sure to uncheck VSYNC Correction under the Advanced settings tab. Start to play some video and during playback left click on Reclock's system tray icon. Set Media adaptation to Auto (best), also check Locked. Don't worry about "Cannot sync the CINEMA video to your hardware..." message.

That's all folks, apologies for my lame english, enjoy and peace be with you.
neograniceni is offline  
post #428 of 1969 Old 07-05-2010, 09:29 PM
Senior Member
 
SubJunk's Avatar
 
Join Date: May 2010
Posts: 339
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 3 Post(s)
Liked: 10
After some more tests I've determined that the cause of the occasional glitches (sometimes encoded videos would go back 1 frame instead of forward, so you get 2 repeated frames) is DirectShowSource. This isn't actually news since DirectShowSource is not frame-accurate, but I only just found out.
It can be fixed by using DirectShowSource2 (DSS2) instead, which is very easy, it's just a tickbox in MeGUI.

This means that I can go back to fully using MT in my scripts. I was using it before on everything except the input, but the input makes a big difference. In my tests I have found a roughly 2x speed increase with my new script compared with the one I had previously published.

I also updated all the DLLs and removed redundant ones, check the changelog
SubJunk is offline  
post #429 of 1969 Old 07-09-2010, 05:32 PM
Senior Member
 
SubJunk's Avatar
 
Join Date: May 2010
Posts: 339
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 3 Post(s)
Liked: 10
After some more testing I've found that the accuracy is increased greatly by using framerates that are directly divisible by the original one, instead of just using 60FPS for everything.
So this means for 23.976FPS content you convert to 71.928FPS, for 25FPS you convert to 75FPS, and for 29.97FPS you convert to 59.94FPS.
It makes it more accurate because it makes the original frames synchronise more often, which eliminates some need for interpolation.
For example, when you convert, as we have previously been doing, from 23.976 (the most common framerate) to 60FPS you only get a synchronisation (almost) every 5 frames, which means 4/5 frames are interpolated and therefore less accurate. But if you convert 23.976 to 71.928 you synchronise every 3 frames for a much better 2/3 real/interpolated ratio.

I have tested these new FPS on my 60Hz monitor via MPC and VLC, and TV via PS3 Media Server, and they all look great and play as smoothly as before. If your monitor supports 75Hz they will look even better

There's a simple addition to the AviSynth scripts which allows for the different framerates, meaning it's all automatic.
Just replace this line (or the similar line) in your script:

Code:
MFlowFps(super, backward_3, forward_3, num=60, den=1)
With these lines:

Code:
Framerate < 26 && Framerate > 24 ? \\
        MFlowFps(super, backward_3, forward_3, num=75, den=1) : \\
Framerate < 24 && Framerate > 23 ? \\
        MFlowFps(super, backward_3, forward_3, num=72000, den=1001) \\
: \\
        MFlowFps(super, backward_3, forward_3, num=60000, den=1001) \\
And of course if you use MBlockFps instead of MFlowFps, replace those, the parameters should be the same
SubJunk is offline  
post #430 of 1969 Old 07-10-2010, 11:07 AM
Senior Member
 
widezu69's Avatar
 
Join Date: Feb 2010
Posts: 319
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by SubJunk View Post

After some more testing I've found that the accuracy is increased greatly by using framerates that are directly divisible by the original one, instead of just using 60FPS for everything.
So this means for 23.976FPS content you convert to 71.928FPS, for 25FPS you convert to 75FPS, and for 29.97FPS you convert to 59.94FPS.
It makes it more accurate because it makes the original frames synchronise more often, which eliminates some need for interpolation.
For example, when you convert, as we have previously been doing, from 23.976 (the most common framerate) to 60FPS you only get a synchronisation (almost) every 5 frames, which means 4/5 frames are interpolated and therefore less accurate. But if you convert 23.976 to 71.928 you synchronise every 3 frames for a much better 2/3 real/interpolated ratio.

I have tested these new FPS on my 60Hz monitor via MPC and VLC, and TV via PS3 Media Server, and they all look great and play as smoothly as before. If your monitor supports 75Hz they will look even better

There's a simple addition to the AviSynth scripts which allows for the different framerates, meaning it's all automatic.
Just replace this line (or the similar line) in your script:

Code:
MFlowFps(super, backward_3, forward_3, num=60, den=1)
With these lines:

Code:
Framerate < 26 && Framerate > 24 ? \\
        MFlowFps(super, backward_3, forward_3, num=75, den=1) : \\
Framerate < 24 && Framerate > 23 ? \\
        MFlowFps(super, backward_3, forward_3, num=72000, den=1001) \\
: \\
        MFlowFps(super, backward_3, forward_3, num=60000, den=1001) \\
And of course if you use MBlockFps instead of MFlowFps, replace those, the parameters should be the same

Thanks Sub that makes a lot of sense. Cheers for that.
widezu69 is offline  
post #431 of 1969 Old 07-11-2010, 04:42 AM
Newbie
 
Dezeer's Avatar
 
Join Date: May 2010
Posts: 7
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Is there any way you guys could improve the script for scenes like below? There is the created frame and both before and after frame. That kind of artifacting makes space scifi, when shootings happen, just weird when there is those light-balls that turn into lightning.







Also: solid text and logos jumps around in fast scenes.

There is also some artifacting happening sometimes around slowly moving objects (hands, head), it's like this bubble that comes either before or after the movement.
Dezeer is offline  
post #432 of 1969 Old 07-11-2010, 06:11 AM
Senior Member
 
SubJunk's Avatar
 
Join Date: May 2010
Posts: 339
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 3 Post(s)
Liked: 10
Quote:
Originally Posted by Dezeer View Post

Is there any way you guys could improve the script for scenes like below? There is the created frame and both before and after frame. That kind of artifacting makes space scifi, when shootings happen, just weird when there is those light-balls that turn into lightning.







Also: solid text and logos jumps around in fast scenes.

There is also some artifacting happening sometimes around slowly moving objects (hands, head), it's like this bubble that comes either before or after the movement.

This latest change I posted about the framerates should make those things better than before.
Other than that, I don't think there are any more possible improvements, not that I can think of.
Widezu and I have tested all the parameters of all the functions and chosen the best values for them, so until there is a newer version of mvtools released (or another similar library to replace it) I don't think it will get better.
SubJunk is offline  
post #433 of 1969 Old 07-11-2010, 10:00 AM
Senior Member
 
widezu69's Avatar
 
Join Date: Feb 2010
Posts: 319
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Guide from previous posts updated to keep up with this thread. Also has some alterations including new scripts etc.

Noobs guide for those new to this. I recommend you download all plugins linked on this page. Even if you have used previous ones with other scripts, the ones on this page are guaranteed to be up to date.

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.

Step 1:
a) Download K-Lite Mega Codec pack version 5.0.0 not the later versions and install ONLY Media Player Classic Regular, not Home Cinema. This player gives me the least headaches when trying to get everything to work. Also, if you didn't choose the CoreAVC option, install all the Haali options (splitter/renderer etc); CoreAVC users already had this option during setup. The next step is to enable MPC as the default player for all videos, this should be done already but can be customised in the setup (this also gives some nice file type icons). 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.
b) Once installed, open up MPC and enter the options window from the tools drop down. Click on the Output tab on the left of the options window and 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.

Step 1b (CoreAVC users):
To setup CoreAVC, open the decoder properties from the star menu, set deblocking to skip always, deinterlacing to None and check Prefer Cuda, Prefered decoder and use tray, apply and close.
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.

Step 2:
Download and install Avisynth.

Step 3:
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.

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

Step 4:
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. The higher up you drag them, the sooner they are applied to the video. For example if you have picture properties on top of resize, ffdshow will adjust the video picture before resizing the video. If using interlaced video, arrange Deinterlacing furthest up, use Yadif without doubling framerate, next comes picture properties for altering colour etc. Other filters you wish to use. Then Avisynth. The only exception is that resize must go under Avisynth (unless your downscaling to a smaller resolution), 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.

Step 5:
To set up Avisynth, download:

a) Working stable MT for mutithreading here:
http://www.mediafire.com/file/nnbngf...isynth258MT.7z
Put the avisynth.dll in your C:/Windows/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 located in your Avisynth directory in Program Files (or Program Files (x86) for 64 bit users) replacing the originals.

b) System dlls to stop ffdshow crashing here:
http://www.megaupload.com/?d=SP5FE2KG
Place them in the same folder you placed the avisynth.dll. For some reason, without these, Avisynth+ffdshow=crash.

c) 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.

Step 6:
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, it shouldn't really affect video playback from avi or mkv files but does affect playback from discs; I have it on 0/20. The following script is based on Domas' (big thanks to him) script with a few of my adjustments mainly for speed optimisations as I haven't a very meaty computer.

Now add this script to the box:

Code:
SetMTMode(1,0)
ffdShow_source()
SetMTMode(2)
super=MSuper(pel=1, hpad=0, vpad=0, rfilter=4)
backward_1=MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1=MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=8, searchparam=0, search=3)
forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=8, searchparam=0, search=3)
MBlockFps(super, backward_3, forward_3, num=60, den=1, mode=0)
SetMTMode(1)
GetMTMode(false) > 0 ? distributor() : last
This script is optimised for reasonably powered computers with a decent Core 2 Duo processor playing 720p. If you have a Core 2 Quad, i5 or lower level i7, try this script:

Code:
SetMTMode(1,0)
ffdShow_source()
SetMTMode(2)
super=MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
backward_1=MAnalyse(super, chroma=false, isb=true, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1=MAnalyse(super, chroma=false, isb=false, blksize=16, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=8, searchparam=1, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=8, searchparam=1, search=3)
backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
MBlockFps(super, backward_3, forward_3, num=60, den=1, mode=0)
SetMTMode(1)
GetMTMode(false) > 0 ? distributor() : last
If you believe you have the ultimate processor, try this script:

Code:
SetMTMode(1,0)
ffdShow_source()
SetMTMode(2)
super=MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
backward_1=MAnalyse(super, chroma=false, isb=true, blksize=8, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1=MAnalyse(super, chroma=false, isb=false, blksize=8, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=4, searchparam=1, search=3)
forward_2 = MRecalculate(super, chroma=false, forward_1, blksize=4, searchparam=1, search=3)
backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, searchparam=0, search=3)
forward_3 = MRecalculate(super, chroma=false, forward_2, blksize=4, searchparam=0, search=3)
MBlockFps(super, backward_3, forward_3, num=60, den=1, mode=0)
SetMTMode(1)
GetMTMode(false) > 0 ? distributor() : last
The pel=x number dictates the accuracy of the estimation values being 1, 2 and 4. If you have less than 60% cpu usage but are still unable to move up to the next script, increase the pel value. Vice versa for freeing up some cpu without changing scripts. Overall, cpu usage should not go over 80~85% otherwise frames will get dropped.

The num=xx value is the outputed framerate. For most people, 60 is the best, some people have different monitors so always set it to a multiple of your monitors refresh rate.

Finally:
The script produces an infamous "soap opera" effect because it looks like the stuff seen on tv played at 50i. Some people, like me get used to it after a while, some people don't. If you are after smooth motion but still with that filmic look, replace the third last line in the script with these lines:

Code:
Framerate = 24 ? \\
        MBlockFps(super, backward_3, forward_3, num=72, den=1) : \\
Framerate < 26 && Framerate > 24 ? \\
        MBlockFps(super, backward_3, forward_3, num=75, den=1) : \\
Framerate < 24 && Framerate > 23 ? \\
        MBlockFps(super, backward_3, forward_3, num=72000, den=1001) \\
: \\
        MFlowFps(super, backward_3, forward_3, num=60000, den=1001) \\
As I only have a 60Hz monitor, I could not test these with other refresh rates.

Credit goes to Bahn Yuki the starter of this thread, Domas4 the original creator of the scripts and collaboration with SubJunk to find the best parameters. Of course we cannot forget the developers of MT and mvtools2 who helped make this possible.

Enjoy, and if this has helped you, I could do with a little donation to help towards my operation in a few months. Just pm me.
widezu69 is offline  
post #434 of 1969 Old 07-11-2010, 12:35 PM
Newbie
 
Dezeer's Avatar
 
Join Date: May 2010
Posts: 7
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by SubJunk View Post

This latest change I posted about the framerates should make those things better than before.
Other than that, I don't think there are any more possible improvements, not that I can think of.
Widezu and I have tested all the parameters of all the functions and chosen the best values for them, so until there is a newer version of mvtools released (or another similar library to replace it) I don't think it will get better.

Well there were (is) a Yushko script that used masktools and mvtools. It worked (what I can pick up from framepictures) by dissolving the two frames and making so the next frame, but it had the same problem as Splash PRO that when too much artifacting was happening it just copied the same frame.

It would need some really high understanding from the computer that what is really moving and what is staying still (background, background objects and people and moving objects).

The current scripts makes just good doubling, but then there are those fast scenes that is the achilles heel.
Dezeer is offline  
post #435 of 1969 Old 07-12-2010, 02:05 AM
Member
 
soulkeeper's Avatar
 
Join Date: Dec 2006
Location: caldera!
Posts: 83
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Liked: 11
@widezu69
i'll try your last script asap!thanks for all your effort and all other people here!

I'll also try replacing the line with new lines to avoid soap effect as you suggest..

what about the blksizev you had in your other scripts?

also,in your first scripts you had only two pair of lines (backward-forward 1 and 2)...what exactly is better adding 3rd pair of line (backward-forward 3)?
soulkeeper is offline  
post #436 of 1969 Old 07-12-2010, 03:08 AM
Senior Member
 
widezu69's Avatar
 
Join Date: Feb 2010
Posts: 319
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by soulkeeper View Post

@widezu69
i'll try your last script asap!thanks for all your effort and all other people here!

I'll also try replacing the line with new lines to avoid soap effect as you suggest..

what about the blksizev you had in your other scripts?

also,in your first scripts you had only two pair of lines (backward-forward 1 and 2)...what exactly is better adding 3rd pair of line (backward-forward 3)?

I realised that if you got rid of blksizev, it will default to whatever blksize is. The first pair of lines focuses on movement and motion, second pair deals with the haloing effect generated around items on the screen that are moving against the background and the third helps with haloing around the boarders of the image when the camera pans. During my tests, with 2 pairs of lines there would still be a large amount of blocking artefacts but with three, they are greatly reduced.
widezu69 is offline  
post #437 of 1969 Old 07-12-2010, 04:47 AM
Member
 
soulkeeper's Avatar
 
Join Date: Dec 2006
Location: caldera!
Posts: 83
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Liked: 11
@widezu69

Thanks!

One more thing for now...
What about the "badrange=(-24)" at the end of the 1st pair you removed?
soulkeeper is offline  
post #438 of 1969 Old 07-12-2010, 05:01 AM
Senior Member
 
widezu69's Avatar
 
Join Date: Feb 2010
Posts: 319
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Um...its still there, I haven't removed it...
widezu69 is offline  
post #439 of 1969 Old 07-12-2010, 05:14 AM
Member
 
soulkeeper's Avatar
 
Join Date: Dec 2006
Location: caldera!
Posts: 83
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 2 Post(s)
Liked: 11
Oops..you're right...
soulkeeper is offline  
post #440 of 1969 Old 07-12-2010, 05:56 AM
Senior Member
 
SubJunk's Avatar
 
Join Date: May 2010
Posts: 339
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 3 Post(s)
Liked: 10
Quote:
Originally Posted by widezu69 View Post

If you are after smooth motion but still with that filmic look...

I'm not sure what you mean by this. Did you find that the divisible framerates had some kind of negative effect, is that why they're not in your script by default?

Also, I recommend you update the DLLs in your guide, please feel free to use the ones in mine. I've had users report greater stability with them compared to yours.
SubJunk is offline  
post #441 of 1969 Old 07-12-2010, 06:01 AM
Senior Member
 
SubJunk's Avatar
 
Join Date: May 2010
Posts: 339
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 3 Post(s)
Liked: 10
Quote:
Originally Posted by Dezeer View Post

Well there were (is) a Yushko script that used masktools and mvtools. It worked (what I can pick up from framepictures) by dissolving the two frames and making so the next frame, but it had the same problem as Splash PRO that when too much artifacting was happening it just copied the same frame.

It would need some really high understanding from the computer that what is really moving and what is staying still (background, background objects and people and moving objects).

The current scripts makes just good doubling, but then there are those fast scenes that is the achilles heel.

In my opinion the current script is very accurate, but of course the more pixels you have in the video, the more accurate it will be. I would recommend a minimum of 1280x720 source video for the best interpolation.
I will definitely keep watching for improvements to the libraries and any other possible improvements.
SubJunk is offline  
post #442 of 1969 Old 07-12-2010, 08:31 AM
Senior Member
 
widezu69's Avatar
 
Join Date: Feb 2010
Posts: 319
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by SubJunk View Post

I'm not sure what you mean by this. Did you find that the divisible framerates had some kind of negative effect, is that why they're not in your script by default?

Also, I recommend you update the DLLs in your guide, please feel free to use the ones in mine. I've had users report greater stability with them compared to yours.

When encoding, the outputted video is nice and smooth because the video has been processed slowly. During realtime playback, because of the framerate and refresh rate differences, there is a small amount of film stutter. It is also up to other users to try out new dll's currently the ones I've listed are the most stable ones for me (tested on a few computers)
widezu69 is offline  
post #443 of 1969 Old 07-12-2010, 09:51 AM
Member
 
jack-bauer's Avatar
 
Join Date: Sep 2008
Location: Versailles, France
Posts: 172
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Hi everybody,

Very interesting thread, thank to all of you.

Still I have a more general question about using AVIsynth in real time playback: I have a mid-power configuration and I have run into stutering/hanging problems when trying to use AVIsynth scripts inside ffdshow for on-the-fly processing.

As far as I could see, it depends on picture size, i.e. pixel count. For example the frame interpolation script works very well with a 640x480 pixel movie. It works also with 720p movies, as long as the ratio is 1.35:1 (about 700Kpixels). But it fails if given a 1280x720 pixel movie (about 920Kpix). Apparently, CPU usage is not the determining factor (around 60% when the script works, 70% when it fails, never coming close to 100%).

I am using AMD Athlon II X2 240 @ 2.8 GHz and 1Gb DDR2 RAM.

A I am considering upgrading my PC, I desperatly need an answer to this basic question:

What is the bottleneck element for AVIsynth in realtime playback and how can I monitor it?

- CPU power (not likely)
- Number of cores
- RAM speed
- RAM size
- other...

Thanks. Jack.
jack-bauer is offline  
post #444 of 1969 Old 07-12-2010, 10:28 AM
Senior Member
 
widezu69's Avatar
 
Join Date: Feb 2010
Posts: 319
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by jack-bauer View Post

Hi everybody,

Very interesting thread, thank to all of you.

Still I have a more general question about using AVIsynth in real time playback: I have a mid-power configuration and I have run into stutering/hanging problems when trying to use AVIsynth scripts inside ffdshow for on-the-fly processing.

As far as I could see, it depends on picture size, i.e. pixel count. For example the frame interpolation script works very well with a 640x480 pixel movie. It works also with 720p movies, as long as the ratio is 1.35:1 (about 700Kpixels). But it fails if given a 1280x720 pixel movie (about 920Kpix). Apparently, CPU usage is not the determining factor (around 60% when the script works, 70% when it fails, never coming close to 100%).

I am using AMD Athlon II X2 240 @ 2.8 GHz and 1Gb DDR2 RAM.

A I am considering upgrading my PC, I desperatly need an answer to this basic question:

What is the bottleneck element for AVIsynth in realtime playback and how can I monitor it?

- CPU power (not likely)
- Number of cores
- RAM speed
- RAM size
- other...

Thanks. Jack.

Hi, I assume you are using script number 1 from my guide (as well as following it as accurately as you can). Your RAM may be a bit limited as well as a bit slow being DDR2.

Try adding this line at the beginning of your script:

SetMemoryMax(512)

On my system (I have Core 2 Duo @ 2.93GHz) sometimes, it struggles a bit with full 720p video. A RAM upgrade is the best bet I think.
widezu69 is offline  
post #445 of 1969 Old 07-12-2010, 11:19 AM
Member
 
jack-bauer's Avatar
 
Join Date: Sep 2008
Location: Versailles, France
Posts: 172
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by widezu69 View Post

Hi, I assume you are using script number 1 from my guide (as well as following it as accurately as you can). Your RAM may be a bit limited as well as a bit slow being DDR2.

Try adding this line at the beginning of your script:

SetMemoryMax(512)

On my system (I have Core 2 Duo @ 2.93GHz) sometimes, it struggles a bit with full 720p video. A RAM upgrade is the best bet I think.

Thanks for your answer widezu69. I'll try that.

I am upgrading next week and I am considering this rig:

- AMD phenom II X6 1090T @3.2GHz (roughly equivalent to Intel Core i7 K 875 @ 2.93GHz)
- 4Go DDR3 RAM PC12800.

Do you think this will do ? Any comment as to use AMD instead of Intel ?
Jack
jack-bauer is offline  
post #446 of 1969 Old 07-12-2010, 12:04 PM
Senior Member
 
widezu69's Avatar
 
Join Date: Feb 2010
Posts: 319
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
THe 1090T is a good shout. 6 cores @3.6 turbo will provide ample power. 4GB is good plus its ddr3. I don't really have experience with AMD processors but if your not upgrading your motherboard, then the 1090T provides good backward compatibility. I was going to suggest an i7 but some of them run on triple channel which so there could be problems.
widezu69 is offline  
post #447 of 1969 Old 07-12-2010, 02:37 PM
Member
 
neograniceni's Avatar
 
Join Date: Jan 2008
Posts: 20
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by jack-bauer View Post

Thanks for your answer widezu69. I'll try that.

I am upgrading next week and I am considering this rig:

- AMD phenom II X6 1090T @3.2GHz (roughly equivalent to Intel Core i7 K 875 @ 2.93GHz)
- 4Go DDR3 RAM PC12800.

Do you think this will do ? Any comment as to use AMD instead of Intel ?
Jack

Can't speak much about AMD, but I did some tests with Core i7 920/x58/tripple channel DDR3, hyperthreading on/off, Nvidia CUDA (CoreAVC). Tested also Core i5 750 and 860. The conclusion is that Avisynth/mvtools2 work much better with HT enabled CPU's, which means more cores more juice. There is ~30-35% less CPU usage using 8 virtual cores (hyperthreading) compared to only 4 physical (i7 860/920). First I bought i5 750 for my HTPC, but had to replace it soon for some hyperthreading capable i7 'coz it was simply not strong enough to cope with some heavy 1080p MKVs. Didn't want to O/C it due to it's heat dissipation (HTPC case) using low RPM silent cooler. i7 860 is faster and cooler than i7 920, and it works with cheaper dual channel DDR3 / P/H55 chipset combo. So I replaced i5 750 for i7 860. And that works fantastically for both 720p and 1080p MKVs interpolating them to 75/90fps 1920x1080 TV res. Can even use some denoise/sharpening ffdshow filters with 720p without beating ~50-60% CPU usage wall. CUDA helps a lot. So, I would say more CPU threads (cores) the better result would be.
neograniceni is offline  
post #448 of 1969 Old 07-12-2010, 04:34 PM
Senior Member
 
SubJunk's Avatar
 
Join Date: May 2010
Posts: 339
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 3 Post(s)
Liked: 10
Quote:
Originally Posted by widezu69 View Post

When encoding, the outputted video is nice and smooth because the video has been processed slowly. During realtime playback, because of the framerate and refresh rate differences, there is a small amount of film stutter.

Oh I hadn't noticed. It makes sense, though. So we have to choose between accuracy and smoothness yet again
SubJunk is offline  
post #449 of 1969 Old 07-13-2010, 01:56 AM
Member
 
jack-bauer's Avatar
 
Join Date: Sep 2008
Location: Versailles, France
Posts: 172
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Thank you for your analysis.

Still I am a bit confused that all I have to do to make this script work best is buying the most powerfull system (not a bad thing though) and pray.

In normal playback I can have an idea of the margins I have left, simply by looking at the CPU usage. This does not seem to be the case with realtime AVIsynth. The process may fail before using the CPU at full power. Should I run into some stuttering, synchro issues, etc.. I will not be able to tell where it comes from.

I am using a 3D stereo rig and realtime AVIsynth will be used extensively for color correction as well as frame interpolation.
http://www.avsforum.com/avs-vb/showt...9#post18859059

At first, I am going to use it for 2x720p side-by-side movies but I am looking forward to playing 2x1080p as well. Thats a challenge. So I am looking for a means to evaluate the margins I have left on the system, some kind of speed meter, AVIsynth side. Any idea?

I know I could reencode the file in 48fps but I'd rather not do that.

Second point: You guys are using Intel instead of AMD CPUs. I understand Intel is definitely best when it comes to high end/high price CPUs. But if you want to get the best price/power tradeoff you would stay in the range where AMD begings to popup, say core i7 960.
http://www.cpubenchmark.net/high_end_cpus.html

Is there a real reason why I should take Intel vs AMD in that performance range? As far as I can see, AMD is much less expensive than Intel for the same performance. Still many of you prefer Intel, which is not a logical move. Any comment ?

Jack
jack-bauer is offline  
post #450 of 1969 Old 07-13-2010, 02:51 AM
Senior Member
 
widezu69's Avatar
 
Join Date: Feb 2010
Posts: 319
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
It is because that these scripts perform well with hyper-threading. As the MT function allows the user to dictate how many threads to use and therefore a quad core i7 cpu with HT can be specified to produce 8 threads. Therefore the script will think that it is running on 8 cores. Thus a massive boost in performance.
widezu69 is offline  
Sponsored Links
Advertisement
 
Reply Home Theater Computers



Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off