Spirton The Cam & Klaus Show

19May/10891

Convert videos to 60fps (Updated 22 July 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.

Optional Tip: If you want MeGUI to update to the very latest stuff (at your own risk) you can push ctrl+s, go to the Extra Configuration tab, and in the Auto Update section select "Use development update server"

Close MeGUI and extract the tools folder over the top of your MeGUI tools folder, which for most people will be either C:\Program Files (x86)\MeGUI\tools\ or 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. If you install K-Lite, make sure to select "Profile 9: Lots of Stuff" during installation.

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 Universal 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 help me with server costs and time spent keeping this article updated, you can do so here with my thanks :)





FAQ:

  • 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. or
    I get 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 Mega Codec Pack and the error should go away after you install it. If you install K-Lite, make sure to select "Profile 9: Lots of Stuff" during installation.
  • The file stops encoding after 99%.
    This usually indicates a codec configuration issue. Try installing/reinstalling K-Lite Mega Codec Pack, and make sure to let it select its preferred defaults (not "quick upgrade")
  • Can I customize the output framerate to make it 48FPS, 75FPS or 120FPS?
    Yes, you can choose any framerate you want. It is best to choose a framerate that is divisible in some way with the original video, but even that is your choice. You just need to add the options "NewNum" and "NewDen", like this:
    InterFrame(NewNum=48000,NewDen=1001)
    NewNum stands for "New Numerator" and NewDen stands for "New Denominator". In general, with NTSC material the NewDen should be 1001 and the NewNum should be 1000x your desired framerate (so for 48FPS you want 48000 and 1001) while for PAL content you might just want something like NewNum=75,NewDen=1 to output 75FPS content.
  • The output seems choppy, can I make it smoother?
    Yes, by default we output a video that sacrifices a little smoothness in order to reduce errors, but different people's eyes pick up on different things so it can all be a matter of taste. You can try the InterFrame "Smooth" tuning, like this:
    InterFrame(Tuning="Smooth")
  • Why isn't the GPU being used much in GPU mode?
    Only some things are done with the GPU in GPU mode, it's still mostly done by CPU but helped by GPU.
  • Why is the video still the original framerate after running it through MKVMerge?
    You probably selected the wrong tracks in MKVMerge so you're getting the original video track instead of the new one; make sure you untick the original video stream before muxing.

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:

22/07/2014:

  • Added more items to the FAQ

10/07/2014:

  • Added more items to the FAQ
  • Shortened the changelog to only the latest 3 changes by default

20/05/2014:

  • Updated instructions
  • Added more tips
  • Added to and updated the FAQ
  • Updated the link to MKVToolnix to always point to the latest version

Click here to display the rest of the changelog

Comments (891) Trackbacks (0)
  1. Hello and thanx for tutorial. This is Great!
    I am converting HD football match from 1280-720 29.97fps to 1280-720 60fps, everything looks fine after 8 -9 hours of decoding except that in converted video i always see trace of soccer ball, when player hit it, especially when some player hit ball quick and hard, than ball fly with “trace” of balls behind..Any solution?
    Thank You.

  2. Hey amazing tutorial! I just have one quick question, everything is great up until the Queue portion in step 12. I press start but it shows nothing and doesnt convert at all. its very irritating. heres what it looks like, http://prntscr.com/3mnss2 thanks

  3. @TSM Sorry it didn’t work out for you but it’s really very simple if you follow the instructions exactly :) The cool thing is that even though it take a bit of time (5 minutes or so) to set up initially, it’s very fast on subsequent times.

    @Stanko You can try tuning=”Smooth” :) See the InterFrame documentation for more possible options

    @Maturo Thanks :) It looks like you might have missed the last part of Step 11, “click Queue in the Video encoding section”. Hope that helps :)

  4. Hi, everything works just fine, but I get “ghost frames” how can I fix that?

  5. Hi Blog Writer,

    I know this is useless when watching on a normal computer monitor but I really need to know how to raise a video frame rate to 120fps or above from this method? i.e. by modifying a script above ?

    Thanks guy.

  6. @GoLfWRC You can specify any framerate, for 120FPS use:
    InterFrame(NewNum=120000,NewDen=1001)

  7. Umm, Step 8. “Prefer DSS2 over DirectShowSource” is grayed out, i am not able to click it?!

  8. @Sean Check the FAQ section :)

  9. Hi, I was wondering if it is possible to create a batch such that you can convert multiple videos? Any help would be greatly appreciated.

  10. Why aren’t you allowing my comments? I don’t get it.

  11. I’m suddenly getting the error “Direct Show Error – Unable to render the file. You probably don’t have the correct filters installed” in the AviSynth script creator. This happens when using AviSource. Seems to work fine with a video that uses DirectShowSource. The thing is though, it was working previously! I have no idea what changed, how to see what filters are installed and of course it doesn’t mention what filter is missing. Any suggestions?

  12. Hi SubJunk!

    I really want this tutorial to work because it looks amazing but I’m having some problems. When I’m installing the plugins for MeGUI it keeps asking me if I want to overwrite the existing files or skip it. Is that normal? Also once I restart MeGUI after installing the plugins, every time I run MeGUI a message says “MeGUI cannot find at least one required component. Without these components, MeGUI will not run properly (e.g. no job can be started).”
    HEEEEEEEEEEEEEEELP

  13. @Brian Sounds like MeGUI didn’t install correctly, maybe try uninstalling and installing it again. It should be ok to let MeGUI overwrite files :)

    @jeffro I’ve fixed that error before by re-installing or updating K-Lite Mega Codec Pack, hopefully that works for you :)

  14. Hi SubJunk,
    Thanks for the guide, very useful and it works a treat, but can you help me please. Is there any way to keep the size of the encoded file to around 4.0- 4.5gb.
    Thanks

  15. @Ian you can use a higher CRF value to lower the filesize :)

  16. Can anyone that has figured it out make a youtube video for this? Please?

  17. So I’m running into a weird behavior you may have seen. I’m encoding a video, and it’s gotten through 99.9% of the file, then it just freezes and does nothing. It has maybe 12 seconds left of estimated time, and only a few frames to process, but it never finishes. I’ve seen this happen a larger MP4 file that’s about 3.4 GB, and then on an 80 MB avi. I’ve tried tuning the encoder mode from 16 to 23 and a few in between just to see if that may kick it into gear, but no luck.

    Any help or suggestions would be appreciated.

  18. Hello SubJunk, I seem to have a bit of an issue, at least I think it’s one.

    I’ve followed the steps correctly past Queueing and conversion. Now, with the part of Muxing. I have the original video and converted video in a folder alone, and when I mux, with the audio, it seems that the framerate doesn’t change at all. Am I missing something?

    Would I need to specify a target framerate? I used the copy pasta you provided for the script with a few minor additions, mainly just the addition of the GPU usage.

  19. Hello!

    Big thanks for the tutorial! Already got 2 great Videos out of it.

    Unfortunately most of the videos I try to convert don’t finish. MEGUI always Stops on “encoding Video” at 99.xx% and doesn’t keep on going.

    Do you have an idea what that problem is?
    Best regards!

  20. @Mando Great idea. If someone does it I’ll be happy to link to the video from the article :)

    @Donder @Stefan It seems to be a codec configuration issue. I’ve fixed it in the past by reinstalling K-Lite :)

    @Ezequiel It probably means there was some mixup with the filenames, make sure you really are using the output video :)

  21. I did everything i was suppose to do (apparently not) and when i choose the video input on step 9, which is a 4k video i get this error http://puu.sh/a11Tq/9b6c48329a.jpg

    AviSynth Script error:
    DirectShowSource: Timeout waiting for graph to start.

  22. Dont know why but when I get up to step 9, I select my video input and hit “Save” but I get this error “FILENAMEHERE.avs can not be opened. Please make sure its a valid AviSynth script and that AviSynth is properly installed. Error message for your reference. Can’t read the video stream.”

    I checked the 3rd line on the 60FPS preset I made and it does bring me to the correct location, However I do seem to be missing svpflow1.dll in the avisynth_plugin folder. Any ideas?

  23. @Donder It seems to be a codec configuration issue. I’ve fixed it in the past by reinstalling K-Lite :)

    That didn’t seem to fix it. Think it might be with the format the video is in originally? One of the files it does it consistently on is a .m4v, and it’s a 3.53 GB file as well. Whereas the majority of the others that I’ve succeeded with are .mkv’s and .avi’s, but those are generally between 6 and 8 GB files.

    Thoughts?

  24. @Lodvib That could be a codec issue or a computer memory/speed issue

    @Heyrwq It’s possible there’s a special character in the path, MeGUI doesn’t like special characters

  25. I have the same problem as Lodvib… only happens with 4K video.

  26. @Trendle I just opened a 4k video on my computer and it took about 600MB of memory to do it. Do you have enough free memory when you attempt it?

  27. @SubJunk. I am having a problem. The problem is that my GPU uasage is only about 1-2% at max and not more than that. So i was wondering if there was something wrong with the script or not. The script that i am using is as follows:

    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”)
    .ConvertToYV12()
    SetMTMode(2)

    InterFrame(Cores=4,GPU=true)

    Any and all the help is much appreciated.

  28. Hi,

    in MEGUI, When I click “save” after clikcing on “Direct show source” etc… I have this error :

    The file C:\Users\____\Videos\_____.avs cannot be opened. Please make sure it’s a valid AviSynth script and that AviSynth is properly installed
    Error message for your reference : Can’t read the video stream

    My video is in MP4 format. Do I need to change for MKV?

  29. I found what was the problem. I just have to copy some Avisynth tool to Avisynth pluging in MeGUI.

  30. So if I wanted it encoded for 12o frames the code would like this

    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”)
    .ConvertToYV12()
    SetMTMode(2)

    InterFrame(Cores=4)
    InterFrame(NewNum=120000,NewDen=1001)
    ?

    is this right?

  31. @zed026 that’s normal, the GPU is just so powerful for this type of thing it doesn’t need to try hard to do its job

    @Isaac Verdugo almost. The bottom two lines should be merged, like this:
    InterFrame(Cores=4, NewNum=120000,NewDen=1001)

  32. Have the same problem as Nic727, cant open the avs in MeGUI, its driving me crazy. I checked and already copied all the tools, the files are there. Also when I try to open the .avs in MeGUI again after the error, it says unable to load library in “compose” and shows the locations of the files thereafter. They are there, im not kidding.

    Can I do step 10+ with another program that doesnt bitch around so much at my PC?

  33. I know that nic asked this already, but what do you need to do to fix the “Can’t read the video stream” error?

  34. @SubJunk thanks for the info. Is there any i can force the gpu to work harder or something. Also if I use preset as medium it takes around 5-6 hours to finish a movie. The movie in question is say of 8-10 GB size from the original file. So is the time required to complete normal?
    Thanks again.

  35. Hey guys, i just wanted to know if the final bit rate for the encoded files affect quality at all? i’m relatively new to this & if possible would like to make sure that no quality suffers what so ever.

  36. @SubJunk I am new to this post and I definitely want to convert some of my favorites to the smooth 60 fps version. I have downloaded the tools : MEGUI 0.35, K-Lite Codec 1060 Megapack, mkvtoolnix-amdx64-7.0.0.
    I have a Lenovo Y510p with I5 4200M (2 Cores) and GPU (Nvidia GTX 755M 2 GB) and 8 GB RAM on windows 8. Can you please provide a precise script as per the specifications for me to use. Please, I will be greatful for this help.

  37. @SubJunk The output video of the conversion has a bit of a glitch wherever there is some fast paced action in the movie. You can actually see the trail of hands and legs when character is running or doing kung-fu. Can you suggest some modification to the script?I used your original one with GPU = True and core = 2.

  38. MKVMerge makes my videos 22 fps again after successfull conversion.

  39. @ShinyZealot Maybe there is a special character in the path to the files. Sure you can use any program that supports AviSynth like VirtualDub for example.

    @Q Sounds like there’s a missing codec so try installing K-Lite Mega with the “Lots of Stuff” setting

    @Peter The final bitrate is one factor in quality but other things matter more like codec settings. If you want visually lossless then use a CRF value between 12-16.

    @Niteesh Pandey Please see the FAQ for the answer to your question :)

    @asd Are you sure you’re putting the output file into MKVMerge and not the original file?

  40. @SubJunk bro any suggestions for making the GPU work extra hard to decrease the time required for the overall process. Thanks in advance. Please check my previous comment for details of the script that i am using.


Leave a comment

No trackbacks yet.