Important:Each time the tutorial has been updated, you should download the "additional files" again to be able to use the most recent version of the tutorial properly.
0: Preparations.
Now in order to be able to use this guide you will need to download some software.
MeGUI (
IMPORTANT:
read and follow the instructions)
MkvtoolnixAviSynth 2.6.0 (Download the most recent version.)LagarithAdditional Files1: Source Files.
Render the video and audio separately, render the audio as a .mp3/.flac or the format of your preference.
Then the video as a lossless .avi-file using the Lagarith codec.
2: AviSynth Script.
It's recommend that you put the rendered ".avi" on the root of the HDD so the path to it is for example "C:\video.avi"
Open Notepad or
AvspMod and copy this in:
DirectShowSource("C:\video.avi")
Spline64Resize(1280,720)
Converttoyv12()
l = gradfun2dbmod(1.4)
c = gradfun2dbmod(2.2).addgrainc(0.0,1.0)
mt_merge(l,c,c,y=2,chroma="copy second")
-
Line 1: Fill in the correct location and filename for the lossless ".avi" you just rendered.
-
Line 2: Fill in the correct resolution, for non-resized versions (ex. 1080p source to 1080p encode insert a "#" at the beginning of the line to disable resizing.
-
Do not touch the other lines.
Check the preview if you used AvspMod to check that the script works.
Press Ctrl+S and save the script.
3: MeGUI.
Open the "Additional Files" from the top before you open MeGUI and do this.
Place "
x264_dp_ Optimized x264 Settings.xml" file in the "
MeGUI\allprofiles\x264" folder.
Place the files inside the "
AviSynth Filters" folder in the "
AviSynth\plugins" folder.
Now open MeGUI and drag'n drop the AviSynth Script onto the AviSynth Script field, a preview should show up to confirm that your video has been found and can be encoded, close this.
Select the "
MKV" as file format and then Click the "
Config" button.
Now check the "
Show Advanced Settings" option and, select the "
Optimized x264 settings" profile I included under
presets.
Make sure the encoding mode is set to
Constant Quality and the value is between 18-20 set (18 = better quality but bigger file).
Proceed to the second tab titled
Frame-Type.
Set the correct number of reference frames, use the chart below to see how many you should use.
1920x1200 or less: 3
1920x1080 or less: 4
1280x720 or les: 9
When you have done that you can click Ok at the bottom of the tab as you're done configuring.
Press
Enqueue tell MeGUI that the video is ready for encoding, go to the
Queue tab and press
Start at the bottom to start the encode.
Close MeGUI when it's done.
4: Muxing.
Once your video is encoded and your .mkv is ready, open mkvtoolnix up.
Import the video and then the audio, as a rule of thumb you should
always import the .mkv first.
Give it a new filename and click
Start Muxing and close Mkvtoolnix when it's done.
That's it, enjoy your new video with the best possible quality.
Change-Log:
2.3
Improvements:
- Huffyuv is replaced with Lagarith for rendering the lossless .avi
- Some links are updated.
2.2
Improvements:
- Bitrate values has been replaced by a Constant Quality value to provide more consistent quality.
- A de-banding filter (GradFun2DB) has been added to smooth the transitions from colors more gradually.
2.1
Improvements:
- MeGUI has been updated to a patched version where the updates works again.
- The number of B-Frames has been lowered to support computers low on RAM.
2.0
Improvements:
- Advanced version removed as it is now redundant.
- Improved a couple of settings and removed the CQM which does not have much effect anymore.
1.9
Improvements:
- Both versions has been updated to utilize and be compatible with the most recent x264 updates.
1.8
Improvements:
- AviSynth 2.5.8RC4 has been released and a link for it has been added to both versions.
- "--subme 7" for better and more precise motion estimation instead of a unnecessary prepass.
- New B-Frame decision mode added for the advanced version.
1.7
Improvements:
- AviSynth 2.5.8RC1 has been released and a link for it has been added to both versions.
- ColorMatrix is out as it's not really necessary.
- Avisource is replaced with DirectShowSource which is a lot more forgiving.
1.6
Advanced gets even more advanced:
- Added a Huffyuv patch that fixes a old bug so the last frames doesn't get left out and a link to new and better x264 builds that has a lot of great patches.
PS3, XBOX 360 and so on...:
- Instead of using a unrestricted level, the h.264 level is now set to 4.1 meaning you should be able to stream them to a PS3, XBOX 360, Popcorn Hour or anything like that.
1.5
Advanced version added:
- There is now an advanced version for those who wants slightly better quality and perhaps learn a little more at the same time.
1.4
MeGUI back, several filters gone, command line gone:
- The tutorial is easier to use than ever before with a very minor loss quality-wise most people won't notice.
1.3
MeGUI Gone:
- Since MeGUI doesn't let you pick rate factor instead, i've removed it for now.
CRF18:
- CRF18 (Constant Rate Factor 18) replaces the part where you have to select a bitrate.
1.2
ColorMatrix added for:
- To prevent color loss when converting from RGB to YV12.
Command Line Encoding added for:
- It uses a x264.exe version that lets you add the "aqstrength" options which should prevent blocking in dark areas.
- For those who got stability problems with MeGUI.
1.1
Soothe added for:
- Lower bitrate requirements.
- More steady appearance.
- Smoother motion compared to plain-sharpening, since motion-blurred edges will be less sharpened.
- Less artifacts in moving areas.
- LimitedSharpenFasterMOD can run faster, since one can get away with less supersampling.
AviSynth 2.5.8 added for:
- The new Spline64 is sharper and has less ringing than spline36.
RemoveGrain options added for:
- The different versions are made for CPUs with different SSE versions which will lower the time the encode takes.
MaskTools 2.0.30.0 updated to 2.0.a32.0:
- More precise and efficient sharpening.