Author Topic: Tutorial: Matroska x264 Encoding 2.3  (Read 53258 times)

0 Members and 1 Guest are viewing this topic.

Offline Daffy

  • V.I.P. Member
  • Posts: 13506
  • WH & NU Founder
    • View Profile
Tutorial: Matroska x264 Encoding 2.3
« on: September 12, 2007, 04:13:50 AM »
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)
Mkvtoolnix
AviSynth 2.6.0 (Download the most recent version.)
Lagarith
Additional Files

1: 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:
Code: [Select]
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.
Code: [Select]
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.
« Last Edit: January 06, 2018, 02:19:52 PM by Daffy »

Offline Spoofy

  • Posts: 3949
    • View Profile
    • http://
Tutorial: Matroska x264 Encoding 1.9
« Reply #1 on: September 12, 2007, 04:22:45 AM »
I doubt I'll be using this myself but surely someone will find good use to it. Well done, Daffy

Offline Daffy

  • V.I.P. Member
  • Posts: 13506
  • WH & NU Founder
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #2 on: September 12, 2007, 04:24:50 AM »
I'll add some screens soon.

Offline BoBsaget

  • Veteran Member
  • Posts: 2692
    • View Profile
    • http://www.bobsagetisgod.com/
Tutorial: Matroska x264 Encoding 1.9
« Reply #3 on: September 12, 2007, 04:31:10 AM »
Sounds great, I'll be testing it later. Btw, whats the size could you expect with a 5 min vid, same as .mp4?

Offline boxXx

  • Veteran Member
  • Posts: 4692
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #4 on: September 12, 2007, 04:46:49 AM »
a sweet daffy you finally got it up  thanks

Offline Daffy

  • V.I.P. Member
  • Posts: 13506
  • WH & NU Founder
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #5 on: September 12, 2007, 05:16:40 AM »
Quote from: BoBsaget
Sounds great, I'll be testing it later. Btw, whats the size could you expect with a 5 min vid, same as .mp4?
You need a lower bitrate to achieve the same quality.

Offline Paxton

  • Posts: 2140
    • View Profile
    • http://
Tutorial: Matroska x264 Encoding 1.9
« Reply #6 on: September 12, 2007, 05:18:35 AM »
Perhaps i'm gonna test this when i got time. It sounds so good, thanks for sharing.  
« Last Edit: September 12, 2007, 05:18:49 AM by PaxtonfT »

Offline Daffy

  • V.I.P. Member
  • Posts: 13506
  • WH & NU Founder
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #7 on: September 12, 2007, 11:56:05 AM »
It'd be great if someone could post a test-result or what they think after haven tried it.

Offline Torque

  • Veteran Member
  • Posts: 12959
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #8 on: September 12, 2007, 01:12:03 PM »
What vids have used this rendering option?

Offline Daffy

  • V.I.P. Member
  • Posts: 13506
  • WH & NU Founder
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #9 on: September 12, 2007, 01:42:18 PM »
None so far, soon the XQ of Fracture...soon.

Offline Labiloute

  • Veteran Member
  • Posts: 2502
    • View Profile
    • YouTube Channel
Tutorial: Matroska x264 Encoding 1.9
« Reply #10 on: September 12, 2007, 01:46:15 PM »
Sorry but i think xvid is best no ? yeah its an avi but i prefer avi or wmv quality.If u have some exemple of this render tutorial show me

Offline SnowMan

  • Veteran Member
  • Posts: 7125
  • Life is what you make it
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #11 on: September 12, 2007, 02:04:51 PM »
looks nice still waiting

Offline Daffy

  • V.I.P. Member
  • Posts: 13506
  • WH & NU Founder
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #12 on: September 13, 2007, 02:34:56 AM »
Quote from: Labilouteâ„¢
Sorry but i think xvid is best no ? yeah its an avi but i prefer avi or wmv quality.If u have some exemple of this render tutorial show me
Use that rolleyes smiley while answering me again and i'll bash your fucking face in.
x264 + .mkv pwns the shit of out XviD + .avi.
x264 compresses a lot better but uses more CPU resources to decompress it.
SO X264 PWNS THE BLOODY CUMSHOT OUT OF XVID!!!
« Last Edit: October 07, 2007, 09:11:03 PM by Daffy »

Offline Olin

  • Posts: 368
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #13 on: September 13, 2007, 02:57:26 AM »
Righto, x264 is awesome. I'll be using this sometime.

Offline Daffy

  • V.I.P. Member
  • Posts: 13506
  • WH & NU Founder
    • View Profile
Tutorial: Matroska x264 Encoding 1.9
« Reply #14 on: September 13, 2007, 03:53:48 AM »
Indeed it is.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal