Spirton The Cam & Klaus Show

19May/10833

Convert videos to 60fps (Updated 05 Mar 2014)

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 new, interpolated frames between the original frames that make the motion look much more smooth.

High framerate (HFR at 48fps) was used in The Hobbit and will be used in upcoming films like the Avatar sequels and X-Men: Days of Future Past, which will use HFR at 60fps, so why not watch all your movies at higher framerates?

A lot of people don't realise this, but 99% 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.

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

Note: This can now be done in realtime using Universal Media Server!

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.exe.
It is an early version of AviSynth 2.6 that is more stable and faster for multithreading than 2.5 releases.

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

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 following code into the text input area.

Setmemorymax(512)
SetMTMode(3,4)
PluginPath = "C:\Program Files (x86)\MeGUI\tools\avisynth_plugin\"
LoadPlugin(PluginPath+"svpflow1.dll")
LoadPlugin(PluginPath+"svpflow2.dll")
Import(PluginPath+"InterFrame2.avsi")
<input>.ConvertToYV12()
SetMTMode(2)
<deinterlace>
<crop>
<denoise>
<resize>
InterFrame(Cores=4)

Important note #1: Make sure the path on the third line is correct.
For example, if you are running 32-bit Windows, you will need to modify the path to "Program Files" instead.

Important note #2: You should change the number "4" in the script (on lines 2 and 13) to your number of CPU cores. If you don't know how many cores your CPU has just Google your CPU and you should be able to find the specs somewhere.

Important note #3: If you have a recent video card in your computer, you can increase the speed of the script by adding ", GPU=true" to the script.
So InterFrame(Cores=4) would turn into InterFrame(Cores=4, GPU=true)

So now your window should look similar to this (with different text):

Step 8:

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

Optional tip #1: 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 Spline36. Make sure to untick the checkbox on the option after you change the default resizer, otherwise it will always be used by default which is often unnecessary.

Optional tip #2: I recommend changing the "MOD value used for resizing" to mod4. This gives the best balance between compatibility (a lot of devices like PS3 don't have good mod2 support) and aspect ratio accuracy (the higher the MOD value, the more likely the aspect ratio is to be skewed more heavily).

Now it should look something like this:

Step7rev3

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 Queue 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:

05/03/2014:

  • Updated MeGUI instructions and screenshots
  • Updated the link to MKVToolnix to 6.8.0
  • Added more notes about some options

09/01/2014:

  • Updated MeGUI instructions

16/12/2013:

  • Updated InterFrame to 2.5.1 which is better quality, more stable and supports more video cards.
  • Updated the link to MKVToolnix to 6.6.0
  • Updated instructions

10/01/2013:

  • Updated Introduction section

24/12/2012:

  • Updated InterFrame to 2.3.0 which is faster, better quality, supports more video cards and has lower memory usage.
  • Updated the link to MKVToolnix to 5.9.0
  • Simplified instructions

27/06/2012:

  • Updated InterFrame to 2.1.0 which is much faster, better quality, etc.
  • Updated SEt's AviSynth MT to 2.6 (2012.05.16)
  • Include the new AviSynth DLL in the installer to make things easier to set up
  • Updated the link to MKVToolnix to 5.6.0
  • Simplified instructions

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 (833) Trackbacks (0)
  1. hi guru(subjunk)
    big fun all the way from africa kenya thanks alot for the script and the lesson..m new to the script thing so i was thing if i gave u all the infor abt my rig ud help me with an exact script on how it should b..m using am runin a windows 8 core i3 4gb ram gtx 650 and no access to the net mostly..please help

  2. @ABU JAY Hi :) For you I would recommend using the default script, with GPU=true added. So like this:

    InterFrame(Cores=4, GPU=true)

  3. thanx subjunk
    will update and see how it work was also having the problem with the Prefer DSS2 over DirectShowSource” is disabled will try the above solution to c if it work

  4. Is there anyway to optimize the script for 16mm film? (what i’m doing is similar to what the BBC does on the Doctor Who DVD’s)

  5. i tried the script again but when i click the save button i get this error load plugin unable to load c: program files x86\megui\ tool\aviysnth_plugin\svpflow1.dll” error=0x7e….please subjunk help me hi

  6. sorry Subjunk… can you tell me how to achieve the minimum distorsion possible? i use overridearea=0, Tuning=smooth but the are still lots of artifacts… i don’t care about time for encoding, i will achieve the best possible quality

  7. @Nathan I’m not sure about that

    @Abu jay It might mean you’re on a 32-bit Windows, please see the first note in Step 7

    @Z-machine95 Artifacts are unavoidable, but they are in the eye of the beholder – some people notice certain types of artifacts while others notice other types. In terms of what produces the best quality frame-by-frame, the default settings are the best, but even though tuning=”Smooth” produces more artifacts it can seem better quality because they can be less noticeable to some people. But if you have tried all the combinations of things and don’t like any of them, maybe this script isn’t for you :)

  8. hello, can you update this tutorial for latest megui? the avisynth profile settings is different now.

  9. Hi there, fella

    I tried the steps really carefully the other night, but then I seemingly hit a brick wall when a dialog box popped up, warning me about this:

    “unable to load c:\program files\megui\tools\avisynth_plugin\spvflow1.dll”

    This happened whenever I tried to save my 60FPS DirectShowSource preview.

    I’m hoping you could suggest a viable solution.

  10. It’s impossible, I’ve tried everything but still get “No function SetMTMode” on my face. :(

  11. hi man i cant get audio working can you tell me how do i get audio to work ,many thaks :::)

  12. @Rizki Fachriansyah Did you check that svpflow1.dll exists in “Program Files” and not “Program Files (x86)”?

    @Bruno S. Melo This probably means you’re using a different version of AviSynth than the one provided by the guide

    @edwin That is covered in Step 13 :)

  13. @XLAWS I’ve updated it, thanks for pointing that out :)

  14. thx for your posting!

    Please, can you tell me good setting for i7-4770 8gbRAM GTX660 ?

    i want my video be a very smooth 60fps one.

  15. Having problems selecting “Prefer DSS2 over DirectShowSource”; the box is grayed out so i can’t check it. Any suggestions?
    PS. great job. I have it working on an older PC (Vista) but want to get it working on my newer win 7 PC.

  16. @ray if you install the latest K-Lite Mega Codec Pack it should make that option available. If it doesn’t, you can make sure that when you install K-Lite that it is using Haali for something. It should by default though.

  17. @subjunk, Still having problems. I’ve uninstalled everything (ie the package you have set up). I disabled WMP, WMC and all codecs that came stock with Win7 (through reg changes). Then i reinstalled everything (your package) and still no luck. I even tried doing some of the tweaks that came with k-lite.

    ps i’m using a acer aspire 1430- no powerhorse but works fine for now.

  18. @SubJunk, After getting really frustrated, i went back through the install on K-lite and found Haali was not done correctly so i redid everything and it works…. Thanks Again and one more question are you still seeing a small amount of juddering when aspect rations change during film playback…. I noticed it on Black Hawk Down.

  19. I tried playing with the crf from 16 up to 20 but I can’t get a smooth encoding on fast scenes. Specifically with the Transformers Dark of the Moon where the soldiers were gliding through the buildings at the last part of the movie. Any solution to this?

  20. Hmmm, can I use this trick to get a slow-mo?
    Like, convert a video to 120fps, then reconvert it to play @30, for a cheap 4:1?

  21. @Jorge You can try using different settings like the smooth tuning and things

    @Joern Yeah you can :)

  22. Bruno S. Melo I had the same problem. Make sure that avisynth.dll is not located in the MeGUI folder. If it is delete it. MeGUI needs to load the avisynth.dll that is installed by the avisynth.exe provided by SubJunk, which isn’t happening if a different version of avisynth.dll is located in the MeGUI folder.

  23. Hi, thanks for all your work on this. I was wondering if there is a way to use ffdshow or some other set of codecs rather than the k-lite stuff. I was very careful to try to get a valid copy of it but still ended up with a lot of browser redirects after installation. Their website kind of screams malware from it’s design. I guess some people have been ok with it but it seems like there are a lot of people who have problems with it. In any case thanks again for your article.

    morris

  24. @Morris Beverly Sure, you can use any codecs you want. I only recommend K-Lite because I’ve had the most success with it personally. Their website’s addition of the new download mirrors is a bit strange I agree, but I guess they are receiving some kind of incentives to use the mirror instead of their own site like they used to do. For the record, it’s not malware despite the unfortunate design.

  25. Thanks for the quick reply. I’ve been trying other codecs with no luck though. This morning I re-installed ffdshow-tryouts (the latest version) and still got the “can’t render, you probably don’t have the right codecs” dialog. I’m trying to convert h264 video in an mp4 container if that makes a difference. Of course the videos in question play fine in all the media players I’ve tried on my machine. Is there an option to choose a decoder that I’m missing or something like that?

    thanks, morris

  26. Hi there subjunk, I have a bit of a question. I had to reinstall everything a while ago, due to getting a new windows, but the problem I have now, is that when I convert something, it also compresses the videos, and causes a loss of quality. For example, A law and order svu video would have been around 2.5gb at 1080p first, yet now they are being compressed to about 1gb at 1080p. I can;t for the life of me figure out what the problem is, and I am hoping you have an idea. I followed your instructions. The thing is, I have more than enough space on my hard drive, and I like the good quality. Hoping you have a way to get the best quality possible in the settings!

  27. I strangely can’t find any of “tools” folder inside MeGUI folder after I installed it. And seems like your mkvtoolnix link is broken too. :S
    Sorry for the bad english :)

  28. Christopher, try lowering the res to 720p with a CRF value of 21.5.

  29. I’ve tried using interframe sooth setting but there are still noticeable distortions during fast motion scenes. Is there anything else I could try to help with the distortion problem?

  30. Hi,

    I was really amazed on how my old movies looked really nice when converted to 60fps. My question is;
    Is it possible to re-encode the final MKV file that is on 60fps using Handbrake? I would like to re-encode it using Handbrake’s default settings for Apple TV. That way, I’ll get an MP4 instead of an MKV file.

    Thank you in advance.

  31. @Christopher Some of that may be because MeGUI is using a newer version of x264 (the video encoder) which is more efficient at encoding than the one the original video was made with. But you can always increase bitrate by using a lower CRF value, for example changing from 18 to 14 or something. Using 12-14 should be visually lossless.

    @Hananda The MKVToolnix link works for me, and the tools folder is there for me too. Not sure why it’s not working for you.

    @Ibrahim MeGUI can also export to MP4 :)

  32. How do we use the universal media server to have realtime HFR? I downloaded it but it don’t know how to use it.

  33. Hey Sub. Firstly, thanks for all your hard work and those that have helped you for all this. OK… Question. I have been doing full 1080p 60fps with no problems. I have seen a few small artifacts in some scenes not too noticeable. But i just did the Star Wars I and observed a high amount of artifacts around the light saber fights scenes… almost unwatchable. I have been using CRF 16 but have not tried to go further down yet. And i just saw you posted a reply for Christopher…. to use 12-14 for visually lossless but why are there lower CRF’s? What would a difference be between say a CRF 1 or 2 to 9 or 10?


Leave a comment

No trackbacks yet.