Spirton The Cam & Klaus Show

19May/10524

Convert videos to 60fps (Updated 03 Apr 2012)

Sections:

Introduction:

Many of the latest models of LCD TVs now include an extra frames feature, usually either 120Hz or 240Hz. This just means they take the source video, which is usually between 24-30FPS, and add fake frames between the real frames that make the motion look much more smooth.

A lot of people don't realise this, but a lot of TVs made before this feature was introduced are actually capable of displaying 50FPS and 60FPS, and of course most LCD monitors display 60FPS as well.

The PS3 also serves up content at 60FPS and 50FPS, which opens up possibilities for people who, like me, use their PS3 as a media server.

This tutorial will allow you to convert videos of any framerate to higher framerates; 25FPS becomes 50FPS and 24/30FPS becomes 60FPS.

This script offers greater quality than any televisions I have seen.

I'm sure many people will want to see how well this script works, so here's a comparison:
Original File
Converted File

Purpose:

This post provides instructions on how to easily convert any video to 60FPS, which allows you to take advantage of this feature of modern TVs on your computer monitor or TV without actually buying anything.

Step 1:

The files needed for this step are found in this zip folder (~6MB).

Run and install the file AviSynth_110525.exe.
It is an early version of AviSynth 2.6 that is more stable and faster for multithreading than 2.5 releases.

After that is installed, paste the files avisynth.dll and fftw3.dll into your System32 (for 32-bit OS) or SysWOW64 folder (for 64-bit OS) which are usually in C:\Windows\.

Download and install MeGUI, run it, let it update all the things it wants to and import all of the presets.

Close MeGUI and extract the tools folder over the top of your MeGUI tools folder, which for most people will be C:\Program Files\MeGUI\tools\.

Step 2:

Download and install MKVToolnix.
When that is installed, run MKVMerge (Start Menu -> All Programs -> MKVToolnix -> MKVMerge GUI).
While in the program, push ctrl+p (or go to File -> Options) and tick the option Disable header removal compression for audio and video tracks by default, then click the OK button and close the program.

You will also need codecs installed. If you don't already have them I recommend K-Lite Mega Codec Pack.

Step 3:

Start MeGUI again. You should be left with a window that looks similar to this:

Step 4:

Push ctrl+r, or go to Tools -> AVS Script Creator.
Now you should see something like this:

Step 5:

Click the Config button next to Avisynth profile.
It should look like this:

Step 6:

Click the New button down the bottom and type 60FPS in the name box, so it should look like this:

Step 7:

Now for the script that will do the actual 60FPS conversion.
Just copy and paste the one of the following codes into the text input area.
There is one script for speed and one for quality. Personally I use the quality script.

Quality:

Setmemorymax(512)
SetMTMode(3)
PluginPath = "C:\Program Files\MeGUI\tools\avisynth_plugin\"
LoadPlugin(PluginPath+"mvtools2.dll")
LoadPlugin(PluginPath+"RemoveGrainSSE3.dll")
Import(PluginPath+"InterFrame.avsi")
<input>.ConvertToYV12()
SetMTMode(2)
<deinterlace>
<crop>
<denoise>
<resize>
InterFrame(FlowPath=PluginPath)

Speed:

Setmemorymax(512)
SetMTMode(3)
PluginPath = "C:\Program Files\MeGUI\tools\avisynth_plugin\"
LoadPlugin(PluginPath+"mvtools2.dll")
Import(PluginPath+"InterFrame.avsi")
<input>.ConvertToYV12()
SetMTMode(2)
<deinterlace>
<crop>
<denoise>
<resize>
InterFrame(Preset="Very Fast", FlowPath=PluginPath)

Important note #1: Make sure the path on the third line is correct.
If you are running Windows from a drive letter other than C: or you are running 64-bit Windows, you will need to modify the paths.

Important note #2: If you know how many threads your CPU can run, you can increase the speed of the script by changing the second digit on the second line to 1.8 times the number of threads.
For example, if your CPU supports 4 threads, 1.8x4 is 7.2, and you round down to 7, so the second line would be: SetMTMode(2,7).
If you don't know the number of threads, try using a search engine to find your CPU specs, usually it will be easy to find.

Important note #3: If you have a recent video card in your computer, you can increase the speed of the script (with slight - usually unnoticeable - quality loss) by adding ", GPU=true" to the script.
So InterFrame(FlowPath=PluginPath) would turn into InterFrame(FlowPath=PluginPath, GPU=true)

So now your window should look similar to this:

Step 8:

Click the Extra Setup tab and make sure "Prefer DSS2 over DirectShowSource" is checked.

You might also want to choose your preferred resizer. For aspect-ratio changes (like from 720x576 to 720x480) a neutral filter like Spline36 will be nice. For actual resizing (like from 1920x1080 to 1280x720) a sharp filter like Spline64 will be best. I usually just leave it on Spline64.

Now it should look something like this:

Then just click the Update button then the OK button

Step 9:

Now we're back to the AviSynth script creator window and now that we have our 60FPS AviSynth template made and selected, it's time to choose which video we want. Just click the ... button next to Video Input up the top of the window and find your video, then click Open.
A window will pop up to give you 3 buttons, click "DirectShowSource".
A window will pop up to show you the video, you can just close that.
Now you should see something like this:

Step 10:

Click the Save button. The video preview window might pop up again, you can close it again.

Step 11:

Now is the time when you need to choose the quality of the video and audio.

If you don't know what to do here, something quick and easy is to just use CRF, which means you let the codec decide on the bitrates itself. So you can click the "Config" button next to the "Encoder settings" dropdown when you have a x264 option selected, then just enter a number between 16-20 in the "Quality" input box. 16 means your video will be almost exactly the same quality as the source, while 20 will look good too while taking up less space. Personally I use 16 for everything because why not? :)

So when you have your quality, click Enqueue in the Video encoding section.

Step 12:

Now your video is ready for conversion.
Now just go to the Queue tab and click Start down the bottom, then wait for it to finish.

Step 13:

The final step is to add your audio and/or subtitles from the original file to the converted file. This process uses muxing, not conversion, so there is no quality loss.
For this we will use the program we installed earlier, MKVMerge.
So run that and drag the converted file into that program, then do the same with the original file. If you can't drag them on, you can use the add button instead.
Now you have several items in the Tracks, chapters and tags section. You just need to untick the ones you don't want. Usually you will want to leave them all selected except for the original video track, as I've done in the following example:

Finally, set the Output filename down the bottom of the window and click Start muxing.
When that is done, you have your final video!

Final Thoughts:

This might seem like a long process, but actually it is only long once. Since we have now made templates, the process for the videos from now on will be much faster; instead of entering the script each time, now you can just make sure your 60FPS AviSynth script is selected.

This file can now be played just like any other video. I personally watch videos on my TV which is linked up to my computer using the awesome, free program called PS3 Media Server, and that handles these 60FPS videos perfectly with no configuration.

Any comments are appreciated. If you can think of an improvement to the script, or to the process, or if you just found it useful and want to say thanks, please do leave a comment. I would love to know that it's being used.

If you want to donate to me, you can do so here:


FAQ:

  • How can I fix an error like "can't load avss.dll"?
    This means your computer is missing Haali Media Splitter. You can download it here or as part of a K-Lite Codec Pack (I use Mega) and the error should go away after you install it.
  • How can I fix random crashing of vfw4x264.exe?
    This probably means you are encoding a file using an input mode other than DSS2, which can happen if the clip is .m2ts or .dga (blu-ray) or another uncommon format.
    You can fix it by changing the 2 in the second line of the script to either 3, 4, 5 or just removing that line (try them in that order, since the options get progressively slower)
  • The option "Prefer DSS2 over DirectShowSource" is disabled.
    This probably means your codecs aren't configured properly.
    You can fix it by uninstalling any codecs you have, restarting your computer, installing a K-Lite Codec Pack, and restarting your computer again.

Thanks:

Widezu69 for providing the original AviSynth script that I used as a base.
Fizick for MVTools, the library that does all the work, and SVP for the modifications to MVTools that make it even better for our purposes.
Everyone on various forums for their feedback, this is really a community effort.

Changelog:

03/04/2012:

  • Updated InterFrame to 1.14
  • Updated SEt's Avisynth MT to 2.6 (2012.03.31) which is faster and more stable
  • Updated the link to MKVToolnix to 5.4.0
  • Improved instructions slightly

25/02/2012:

  • Script stability improvements
  • Updated the link to MKVToolnix to 5.3.0 from 5.0.1

29/02/2012:

  • Updated InterFrame and its dependencies to 1.13 from 1.12.2 (Changelog) which improves speed and ATI GPU compatibility

03/11/2011:

  • Updated InterFrame and its dependencies to 1.12.2 from 1.12 (Changelog) which improves speed by up to 15%
  • Updated AviSynth DLL (SEt's MT Build) to 2011.09.13 from 2009.09.19 which increases stability and fixes bugs
  • Updated the link to MKVToolnix to 5.0.1 from 4.6.0

12/09/2011:

  • Updated InterFrame to 1.12 from 1.11 (Changelog)
  • Rolled back to previous AviSynth version because the newer one was causing crashes
  • Link to latest MeGUI installation package directly since they don't seem to be releasing installers anymore

22/07/2011:

  • Updated SEt's AviSynth DLL to 2011.07.19 from 2009.09.19
  • Updated AviSynth to 2.6 Alpha 3 from 2.6 Alpha 2

05/07/2011:

  • Updated InterFrame to 1.11 from 1.10 (Changelog)

04/07/2011:

  • Updated Step 9 because of an extra window added by MeGUI (thanks to Sko for the reminder)
  • Updated sample videos

18/06/2011:

  • Updated InterFrame to 1.10 from 1.8.1 (Changelog)
  • Updated sample videos

20/05/2011:

  • Updated InterFrame to 1.8.1 from 1.7.1 (Changelog)

03/05/2011:

  • Wrote version information to avisynth.dll to fix software conflicts

30/04/2011:

  • Updated InterFrame to 1.7.1 from 1.7 (Changelog)
  • Updated the thanks section to include SVP

29/04/2011:

  • Fixed a mistake in the guide (Thanks Sebastian)

28/04/2011:

  • Updated InterFrame to 1.7 from 1.6 (Changelog)

22/04/2011:

  • Added a new note below the scripts explaining how to increase the encoding speed

20/04/2011:

  • Updated InterFrame to 1.6 from 1.5.1 (Changelog)
  • Changed the guide so that it muxes audio and/or subtitles, whereas before it always converted audio and ignored subtitles
  • Changed a lot of text and some images in the guide to be easier to follow
  • Added donation link

13/04/2011:

  • Updated InterFrame to 1.5.1 from 1.5 (Changelog)

12/04/2011:

  • Updated the scripts to disable GPU-acceleration by default since it causes errors for people with older or no video cards.

11/04/2011:

  • Updated InterFrame to 1.5 from 1.3.1 (Changelog)
  • Updated the scripts and made them more simple
  • Added new video samples

09/04/2011:

  • Slightly changed the scripts to fix a colorspace bug

01/04/2011:

  • Updated InterFrame to 1.3.1 from 1.2 (Changelog)
  • Updated the video samples

24/03/2011:

  • Updated InterFrame to 1.2 from 1.1 (Changelog)
  • Updated Speed script to work with InterFrame update

22/03/2011:

  • Updated InterFrame to 1.1 from 1.0.2 (Changelog)
  • Updated scripts to work with InterFrame update

21/03/2011:

  • Updated InterFrame to 1.0.2 from 1.0 (Changelog)
  • Updated MVTools2 to 2.5.11.2b from 2.5.11.1b (Changelog)

19/03/2011:

  • Updated FAQ with links and more correct and specific answers

18/03/2011:

  • I'm releasing the script as an AviSynth plugin called InterFrame so I've added that to this guide

17/03/2011:

  • Removed unnecessary file (mt.dll) and updated guide and scripts accordingly

16/03/2011:

  • Increased quality of the scripts by improving the detection of scene-changes

25/02/2011:

  • Increased quality of Quality script

23/02/2011:

  • Increased quality of scripts

22/02/2011:

  • Improved accuracy of the Quality script with little performance impact
  • Updated file package to include fftw, a requirement of the improved accuracy setting
  • Updated file package to include Builds.txt which contains the versions and links to the files in the package
  • Added a menu at the top of the post to make it easier to see which sections there are and jump to them

10/02/2011:

  • Updated introduction section

03/01/2011:

  • Updated MVTools from 2.5.11b to 2.5.11.1b
  • Re-introduced divisible framerates, which increases interpolation accuracy and speed

17/11/2010:

  • Minimised artifacts in Quality script with no performance hit (maybe a bit faster, too)
  • Moved resize to above the interpolation after testing that showed it is more accurate at 720p than 1080p

08/11/2010:

  • Updated AviSynth from 2.5.8 to 2.6 after tests which found it is more stable for multithreading.
  • Improved instructions, fixed typos, restructured steps.

27/10/2010:

26/10/2010:

  • Updated MVTools from 2.5.10.1b to 2.5.11b.

13/10/2010:

  • Increased the interpolation strength of the scripts. It can cause errors, (stripes and cross-like patterns may cause glitches), but it is better than before for general use.

08/10/2010:

  • Added a common question to the FAQ; "Prefer DSS2 over DirectShowSource" is disabled.

20/07/2010:

  • Increased accuracy of the Quality script
  • Corrected minor language errors

17/07/2010:

  • The value of blksize will now automatically change based on input resolution, which hopefully provides the most accurate settings for all inputs
  • Added the ConvertToYV12 function, just meaning MeGUI doesn't need to keep adding it all the time

16/07/2010:

15/07/2010:

  • Input uses SetMTMode 2 now instead of 1, since 1 can cause quality problems for .avi files.

13/07/2010:

  • Reverted to always using 60FPS. Using divisible framerates did provide increased accuracy with technically the same level of smooth motion, but monitors and televisions can't display those exact framerates anyway which results in less visible smoothness. Thanks to Widezu for pointing this out.

12/07/2010:

  • Added to the FAQ
  • Minor wording changes

10/07/2010:

  • Increased accuracy of both scripts by allowing for different framerates depending on the input. See here for more details.
    The videos still play perfectly on 60Hz and 75Hz monitors/TVs, so don't worry about that.

06/07/2010:

  • Increased speed by roughly 100% for both scripts
  • Updated DLL package:
    • Removed DirectShowSource.dll
    • Removed TCPDeliver.dll
    • Updated mvtools2.dll from 2.5.10b to 2.5.10.1b
    • Updated mt.dll
    • Updated avisynth.dll
  • Fixed a bug that would very infrequently cause a backwards frame
  • Note: Users of previous scripts will need to make sure they have selected "Prefer DSS2 over DirectShowSource" in the AviSynth configuration settings (under the Extra Setup tab)
  • Updated instructions and wording throughout the whole article, to keep it current with these latest changes and make it easier to follow.
  • Added instructions on how to make MeGUI update to the latest releases
  • Added basic instructions on video encoding quality

02/07/2010:

  • Added new sample videos (original, speed and quality)

01/07/2010:

  • Increased accuracy in the Quality script

25/06/2010:

  • Added a new script with improved quality

16/06/2010:

  • Improved speed slightly
  • Fixed a crash

15/06/2010:

  • Updated script for increased accuracy

05/06/2010:

  • Fixed a bug with resizing

04/06/2010:

  • Merged both scripts since the high quality one produced choppier motion
  • Fixed a bug that stopped functions like crop and resize from working
  • Fixed a bug that caused random crashes on very high-quality videos

26/05/2010:

  • Updated high quality script since last version had problems

24/05/2010:

  • There are now 2 scripts; one for quality and one for speed. Both are good.
  • Updated Step 2 for better compatibility
  • Removed code formatting since it was confusing to copy/paste

23/05/2010:

  • Removed need to change script depending on your CPU and improved quality

21/05/2010:

  • Small change to script

20/05/2010:

  • Fixed an error with the DLL files
Comments (524) Trackbacks (0)
  1. and also i forgot to ask that should i put the new version 2 .dll files just into avisynth plugin folder or like the version 1 i also should put them in my sys32 or syswow64 too and if yes, all of them or which one?
    thanks again
    sed

  2. @Sed: 2.0 is not recommended for use yet so it isn’t in this guide. When it is good enough I will update the guide for it.

  3. OK, thanks, actually i did play around with it for a while and i got it working, and right now i am doing my first conversion with 2 (just a test) on a file that i did before with one, its not finished yet, as for being faster, cant say if its faster, as for quality, i just have to wait and see and compare it with the one i did with 1 to be able to say, but i did notice something that made me happy and that’s when i was trying to do some split and joint with 1 it was almost always MeGui crush but so far it did not (don’t know for sure if it has some thing to do with interFrame 1 and or 2 or it was a bug in my system that its not there anymore), anyway i want to really thank you for your hard work (it took me almost 3 months to get comfortable with MeGUI and then i found out about interFrame and another month to get hang of this, but i am really happy as i am finding my way to build a big collection of 60FPS movies, again thanks to you guys.

    Sed

  4. Hi Subjunk,

    I get a AviSynth Script Error: There is no function named “SetMTmode” I’m kind of a newbie but would like to code some of my 30fps AVI and other video files to 60fps

  5. @Derfu: Make sure you follow step 1 fully and it will fix that error

  6. Thank Subjunk =)

    MKVMerge will not mux wmv to the new mkv. Is there any way around this? or some other software to aid this mux? Thank you in advance

  7. @Derfu: Yeah WMV is a pain in the butt, try to avoid it :) You can try ctrl+f7 in MeGUI which will work for some files, if that doesn’t work it’s probably best just to convert the audio in MeGUI. You can convert it to FLAC which is lossless so it’s kindof the same as muxing :)

  8. @Subjunk

    I have yet to try ctrl+f7 but will do so later. What would be the script to convert it to FLAC?

    Also, I have done a couple converts to 60fps but have not seen any or much difference at all to the original source. Am I missing something here? I do notice when I do download some 60fps torrents that those videos have movement that look real smooth, so far my conversion isn’t producing the smoothness I read other users are experiencing. Is there something wrong with my script.

    Here is the script I’m using.

    Setmemorymax(1024)
    SetMTMode(2,7)
    PluginPath = “C:\Program Files (x86)\MeGUI\tools\avisynth_plugin\”
    LoadPlugin(PluginPath+”mvtools2.dll”)
    LoadPlugin(PluginPath+”RemoveGrainSSE3.dll”)
    Import(PluginPath+”InterFrame.avsi”)
    .ConvertToYV12()
    SetMTMode(2)

    InterFrame(FlowPath=PluginPath)

  9. @derfu: For the FLAC conversion you can just use MeGUI.
    For extra smoothness you can use the smooth tuning, like:
    InterFrame(FlowPath=PluginPath, Tuning=”Smooth”)

    Plus your script is old, I suggest updating it based on the guide

  10. @SubJunk

    I’m quite new and don’t understand the software too much. Can you let me know how to do the FLAC conversion using MeGUI.

    Can you give me a script that you use for your upconversion as a template for me to try.

  11. Also want to thank you SubJunk for your quick replies. Great job on this also!

  12. @derfu: For the audio conversion, in the main window of MeGUI there is the video section then an audio section below it. Just load your file with the Audio Input option, then choose FLAC in the Encoder settings then click Queue and start the job like with videos.

    Bringing your script up to date would be:

    Setmemorymax(512)
    SetMTMode(3,7)
    PluginPath = “C:\Program Files (x86)\MeGUI\tools\avisynth_plugin\”
    LoadPlugin(PluginPath+”mvtools2.dll”)
    LoadPlugin(PluginPath+”RemoveGrainSSE3.dll”)
    Import(PluginPath+”InterFrame.avsi”)
    <input>.ConvertToYV12()
    SetMTMode(2)
    InterFrame(FlowPath=PluginPath)

  13. Hi SubJunk,
    I want to rotate video. How could I do it with avisynth script?

  14. @Jet: Looks like there is a plugin called Rotate: http://avisynth.org.ru/rotate/rotate.html
    I don’t want to get into the habit of giving general Avisynth support though so if you have more questions like that I suggest using a forum like Doom9 :)

  15. @subjunk
    Thank you for all your help. I have converted a few videos successfully and it has been fun testing this. I recently ran into a problem doing a 1440 x 1080 res wmv. It would process that video about 60% and stop. Any idea why this process is stopping. There was also a mpg4 video that had this problem occur.

  16. @Derfu: I’m glad it’s working now. Sounds like an FTV video, sometimes codecs for WMV and MP4 do weird things and re-installing or configuring codecs fixes it.

  17. when i use megui to make 60fps video,original video is MP4 format,and transform it become 60fps video successfully,but the video before two seconds is the same like the first frame,the same pictuer will lasts two second,other was normal like original vieo without any error,when i transform original video that is avi format is normal use same parameter is normal,i don’t koow where is error,following is my AVS Script:
    Setmemorymax(512)
    SetMTMode(3)
    PluginPath = “C:\Program Files\MeGUI\tools\avisynth_plugin\”
    LoadPlugin(PluginPath+”mvtools2.dll”)
    LoadPlugin(PluginPath+”RemoveGrainSSE3.dll”)
    Import(PluginPath+”InterFrame.avsi”)
    DirectShowSource(“E:\BTOB – Insane (HD 1080p).mp4″, fps=23.976, audio=false, convertfps=true).AssumeFPS(24000,1001).ConvertToYV12()
    SetMTMode(2)
    #deinterlace
    #crop
    LoadPlugin(“C:\Program Files\MeGUI\tools\avisynth_plugin\Convolution3DYV12.dll”)
    Convolution3D(“movielq”) # Heavy Noise
    #resize
    InterFrame(FlowPath=PluginPath)

  18. @klys: Try following Step 8 fully :)

  19. my computer keeps crashing after i choose ” directshowsource” in step 9..what should i do?

  20. Can you please tell me what you mean by “extract the tools folder over the top of your MeGUI tools folder”?

  21. Just to take the contents of the zip file from the guide and put them into the MeGUI tools folder

  22. Can there be a way to do this with FFMpeg?

  23. FFmpeg can take AviSynth scripts instead of video input so yes :)

  24. What is the script to do it on live in ffdshow video decoder?…
    i put the script of the guide and show syntax error mesage..

    sorry my english


Leave a comment

(required)

No trackbacks yet.