AVS Forum banner

Avisynth Script for doubling video frame rates

510K views 2K replies 168 participants last post by  Bahn Yuki 
#1 ·
Ok folks, I've been getting a lot of responses and questions to the way I achieve the "motion morphing, 120hz" look on my videos from a PC rather than letting a new LCD screen do the work. Not only do I feel the results are better than the TVs, but depending on your hardware, you'd be saving a lot of $$$. Now my friend Kevin wrote this script after I told him I wanted to buy a 120hz projector. He advised me to wait until he could find a software solution, and sure enough he did with some plugins and tinkering around. I'm going to paste you folks right here the settings I'm using. I hope it makes sense to some of you out there. Also I'd like to mention I'm using a e6300@2.8ghz to get very nice results in MPC. Also I am using the Haali splitter on the 720p MKVs. Boy do they look great. If any of you folks have better hardware, or tinker around with this script and find BETTER results, please let us all know!

Grab MVtools Here
Grab Avisynth MT Here



SetMtmode(2,10)

source=ffdshow_source()

source=changefps(source,source,true)

# assume progressive PAL 25 fps or NTSC Film 23.976 source

backward_vec = source.MVAnalyse(blksize=16, isb = true, chroma=false, pel=1, searchparam=1, idx=1)

# we use explicit idx for more fast processing

forward_vec = source.MVAnalyse(blksize=16, isb = false, chroma=false, pel=1, searchparam=1, idx=1)

source.MVFlowFps(backward_vec, forward_vec, num=2*FramerateNumerator(source), \\

den=FramerateDenominator(source), mask=0, idx=1)

distributor()
 
See less See more
#427 ·

Quote:
Originally Posted by OriONCoL /forum/post/18861527


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.
 
#428 ·
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
 
#429 ·
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:
Code:
MFlowFps(super, backward_3, forward_3, num=60, den=1)
With these lines:

Code:
Code:
Framerate  24 ? \\
        MFlowFps(super, backward_3, forward_3, num=75, den=1) : \\
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
 
#430 ·

Quote:
Originally Posted by SubJunk /forum/post/18885153


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:
Code:
MFlowFps(super, backward_3, forward_3, num=60, den=1)
With these lines:

Code:
Code:
Framerate  24 ? \\
        MFlowFps(super, backward_3, forward_3, num=75, den=1) : \\
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.
 
#431 ·
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.
 
#432 ·

Quote:
Originally Posted by Dezeer /forum/post/18889991


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.
 
#433 ·
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:
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:
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:
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:
Code:
Framerate = 24 ? \\
        MBlockFps(super, backward_3, forward_3, num=72, den=1) : \\
Framerate  24 ? \\
        MBlockFps(super, backward_3, forward_3, num=75, den=1) : \\
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.
 
#434 ·

Quote:
Originally Posted by SubJunk /forum/post/18890099


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.
 
#435 ·
@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)?
 
#436 ·

Quote:
Originally Posted by soulkeeper /forum/post/18893435


@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.
 
#440 ·

Quote:
Originally Posted by widezu69 /forum/post/18890733


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.
 
#441 ·

Quote:
Originally Posted by Dezeer /forum/post/18891273


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.
 
#442 ·

Quote:
Originally Posted by SubJunk /forum/post/18893667


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)
 
#443 ·
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.
 
#444 ·

Quote:
Originally Posted by jack-bauer /forum/post/18894410


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.
 
#445 ·

Quote:
Originally Posted by widezu69 /forum/post/18894568


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
 
#446 ·
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.
 
#447 ·

Quote:
Originally Posted by jack-bauer /forum/post/18894822


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.
 
#448 ·

Quote:
Originally Posted by widezu69 /forum/post/18894084


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
 
#449 ·
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
 
#450 ·
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.
 
#451 ·
I've done a lot of testing of high-action scenes and it seems like pel=2 delivers better quality than pel=4 in general.

Also, I discovered by accident that blksize supports the value 32 as well (despite what the documentation says) and I found that it makes rather large improvements to high-motion scenes. So my new script recommendation is this:

Code:
Code:
super      = MSuper(pel=2, hpad=0, vpad=0, rfilter=4)
backward_1 = MAnalyse(super, chroma=false, isb=true,  blksize=32, searchparam=3, plevel=0, search=3, badrange=(-24))
forward_1  = MAnalyse(super, chroma=false, isb=false, blksize=32, searchparam=3, plevel=0, search=3, badrange=(-24))
backward_2 = MRecalculate(super, chroma=false, backward_1, blksize=16, searchparam=1, search=3)
forward_2  = MRecalculate(super, chroma=false, forward_1,  blksize=16, 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)
MFlowFps(super, backward_3, forward_3, num=60, den=1)
Attached are comparisons. They are of two consecutive, interpolated frames. So you can see the newer script reduces the tearing significantly.

The script used in the "old" images (so NOT RECOMMENDED) is:

Code:
Code:
super      = MSuper(pel=4, hpad=0, vpad=0, rfilter=4)
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=1, search=3)
forward_2  = MRecalculate(super, chroma=false, forward_1,  blksize=8, blksizev=8, searchparam=1, search=3)
backward_3 = MRecalculate(super, chroma=false, backward_2, blksize=4, blksizev=4, searchparam=0, search=3)
forward_3  = MRecalculate(super, chroma=false, forward_2,  blksize=4, blksizev=4, searchparam=0, search=3)
MFlowFps(super, backward_3, forward_3, num=60, den=1)
so you can see what has changed



 
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top