Log in

View Full Version : THE Bluray to x264 Guide


hajj_3
1st October 2008, 22:09
This guide was given to me, it was taken to another site, doom9 doesnt really have any guides with screenshots so i thought i'd share it. Hopefully people will improve this, explain more about which settings do what and what values to use etc. All credit goes to the original creators of this guide. Moderators are welcome to change these first 3 posts and update them whenever they like.

Please could a moderator make this a sticky, it with help countless people and save loads of threads being made.



Software you will/may need:



GraphStudio............: Download Link (http://blog.monogram.sk/janos/)
Eac3to.................: Download Link (http://forum.doom9.org/showthread.php?t=125966)
x264...................: Download Link (http://x264.tk/)
AVSP...................: Download Link (http://avisynth.org/qwerpoi/Download.html)
AviSynth...............: Download Link (http://avisynth.org/mediawiki/Main_Page)
FFmpeg source..........: Download Link (http://forum.doom9.org/showthread.php?t=127037)
MeGUI..................: Download Link (http://forum.doom9.org/showthread.php?t=96032)
Haali..................: Download Link (http://haali.cs.msu.ru/mkv/)
ffdshow................: Download Link (http://ffdshow-tryout.sourceforge.net/)
SurCode DTS............:
Arcsoft DTS DLLs.......:
Arcsoft Total media....:
MKVtoolnix.............: Download Link (http://www.bunkus.org/videotools/mkvtoolnix/)
LimitedSharpenFaster...:
Soothe.................:

Notice: its possible to encode HD DVDīs with this guide and if all fails you can convert the .EVO file to mkv with eac3to and follow the normal steps


Install all programs!

In ffdshow you need to activate support for VC-1 and MPEG-2. So if you goto start under "Programs"
find ffdshow video decoder configuration" in there you see a section called "Codecs" in there you need to find "VC-1" and choose "libavcodec" as the Decoder.

http://hdimage.org/images/cwv6mtgm1dz1zgymiyb2_ffdshowpic1.jpg

Same procedure for MPEG-2 change from deactivated to "libmpeg2"

http://hdimage.org/images/7ftdlkcvwt2ygygey44x_ffdshowpic2.jpg

Graphstudio

With GraphStudio we can make a .GRF file for the avs script we will be making next in this guide.

What this program can do for us is is that we can chose which filters and decoders we want to use for our avs script.

Start up Graphstudio and press "Ctrl + F" if you look on the picture below you can see all the filters. Be sure you are under the "Directshow filter" section.

http://img236.imageshack.us/img236/3209/92399041gq1.jpg

1. Choose "Haali Media Splitter" it will prompt you for the file, choose the one you want to decode "filename0001.m2ts" (if the movie is splitted over several files learn how to mux them in the Eac3to section.)

2. Choose "ffdshow Video Decoder"

3. Join the two filters by dragging the mouse from "Video" to "In" As shown on the picture below.

http://hdimage.org/images/obruexi1k2h8rtb2deu_graphpic2.jpg

Now save your graph!



AVSP

With AVSP we can make a .avs file for MeGUI i will just cover the basics in this guide!

Open your .grf file that you just made you will have to change it from only viewing .avs files as i do on the picture below.

http://img516.imageshack.us/img516/5049/50265903xe2.jpg

Now we can begin the script
This is more or less how your script will look like when you opened the .grf file



DirectShowSource("C:\your_movie\filename.grf")




Now if you know what framerate the movie is add Fps=XX.XXX to your script, also add Audio=false as we will be focusing on the video stream. (Learn how to find the framerates in the Eac3to section).


This is how it will look



DirectShowSource("C:\your_movie\filename.grf",Audio=false,Fps=23.976)




Now add ConvertToYV12() to your script, this is the color conversion filter.



DirectShowSource("C:\your_movie\filename.grf",Audio=false,Fps=23.976)

ConvertToYV12()




Now we want to crop the movie so find a bright frame in the movie and crop all the black bars away.
If the Aspect Ratio (AR) is not correct you are allowed to undercrop to archieve the right AR.

So start of with this code "Crop(0,0,-0,-0)" Left,Top,-Right-Buttom

You always want to archieve either mod16 or mod4 undercrop if necessary there must be no remainder.

In this example i had to crop the video to 1920x800 Pixels
Code i used "Crop(0,144,-0,-136)"

How to calculate if itīs mod16 or mod4



mod16 "16 divisible With end result with no remainder"
mod4 "4 divisible with end result with no remainder"



Left+right= Pixels making the width 1920- Pixels=

Top+Buttom= Pixels making the height 1080- Pixels=



So in my example i got this result
Width 1920-0=1920 Pixels 1920/16=120
Height 1080-280=800 Pixels 800/16=50

So now our script looks something like this



DirectShowSource("C:\your_movie\filename.grf",Audio=false,Fps=23.976)

ConvertToYV12()

Crop(0,144,-0,-136)




If your video donīt need to be resized and is not interlaced you can save your avs now.

Save as "encode script" and make an extra for your samples save as "Sample script"

Now if you wanna resize the movie to 720p you can use these numbers.





Spline36resize(1280,720) Video source roughly 1920x1080

Spline36resize(1280,688) Video source roughly 1920x1040

Spline36resize(1280,544) Video source 1920x816

Spline36resize(1280,536) Video source 1920x800

Spline36resize(1280,528) video source 1920x800

Choose 536 or 528 depends on which one looks better to you.



Here is my script now



DirectShowSource("C:\your_movie\filename.grf",Audio=false,Fps=23.976)

ConvertToYV12()

Crop(0,144,-0,-136)

Spline36resize(1280,536)





OAR - Original Aspect Ratio


Now when you have resized it be sure that you have OAR or close to OAR.
Here is how you can check how to get OAR. Always go for either mod4 or mod16



Height/Width*1280=OAR




So lets say i have a source that is 1920x1040 after cropping. Height should be 693,33 Well as we canīt uptain that we are going to find the nearest spot. i did that with mod4 height = 692
Now your commandline should look something like this.



DirectShowSource("C:\your_movie\filename.grf",Audio=false,Fps=23.976)

ConvertToYV12()

Crop(0,144,-0,-136)

Spline36resize(1280,692)





LimitedSharpen(Faster)

LimitedSharpen is a avs filter that can sharpen up your source. (Not recommended if you are new to avs scripts)


Applies a strong sharpening to edges and fine details by controlling halos and minimising artifacts. All sharpening is a 3-way struggle between edge-halos,
edge-aliasing, and confetti artifacts; LimitedSharpen is an attempt to minimize each in the most visually pleasing way.

This should be used as the last filter in a chain if possible, like any sharpener. The different Smodes cause different defaults to be used in certain cases,
or limit the ranges differently. See the source for specifics.

Here is an overview of itīs commands.



Smode int (1-4, default 3)

Sharpen mode:

1 : UnsharpMask
2 : Sharpen
3 : Range sharpening.
4 : nonlinear sharpening.



Each mode has progressively less haloing in its sharpening.



ss_x float = 1.5
ss_y float = 1.5

Supersampling when > 1, which reduces aliasing on edges.


dest_x float = width
dest_y float = height

Resize directly to final size, saves a resize step.



strength int = 160

Sharpening strength:

For Smode=1, it can be 0~127 (simple sharpening), 128~255 (simple overdrive), 255~4096 (big overdrive).
For Smode=2, values 0~100 are handled over to Sharpen() as 0.0~1.0. Values >100 are mapped to 100.
For Smode=3, 0~100 is common, but 100~inf. can be used if necessary.



Default is strength=160 for Smode=1, and strength=100 otherwise.

radius int (1-10, default 1)

Radius of UnsharpMask, only used in Smode=1.



overshoot int = 1

Sharpening limit: a sharpened pixel may not exceed [min,max] of the local neighborhood by more than 'overshoot'.

(High values remove the "Limited" of LimitedSharpen, and cause excessive haloing.)



undershoot int = [overshoot]

Separate limit for pixels that get darker during sharpening. Good for cartoons with strong lines. (If not specified,

then undershoot==overshoot.)

Lmode int (0-3, default 1)

Lmode:

0 : No effect
1 : Clamp to over/undershoot.
3 : Zero over/undershoot on edges, normal over/undershoot on not-edges.



soft int (0-100, default 0)

Softens the effect of sharpening. -1 will (try to) autocalculate a good value.

edgemode int (-1 to 2, default 0)

-1 : shows edges.
0 : does nothing.
1 : restricts sharpening to edges
2 : restricts sharpening to mostly non-edges (I think?)

special bool = false

special=true tries to raise detail contrast in dark areas of a frame. (Usage not really recommended - the method is simple

and might cause artefacts.)



wide bool = false

With wide=true, the local [min,max] limits are gathered from the 5x5 neighborhood, instead just 3x3. Enables more gain in

detail contrast. Increasingly useful with increasing supersampling factors.

exborder int (0-16, default 0)

Command example of a basic script



LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=3, strength=80, overshoot=0)




The final script would look something like this.



DirectShowSource("C:\your_movie\filename.grf",Audio=false,Fps=23.976)
ConvertToYV12()
Crop(0,144,-0,-136)
Spline36resize(1280,536)
LimitedSharpenFaster(ss_x=1.0, ss_y=1.0, Smode=1, strength=60, overshoot=0)




for more info about LSF read this thread LimitedSharpen (http://forum.doom9.org/showthread.php?t=84196&highlight=limitedsharpen)

For more filters visit these sites.

Link 1 (http://avisynth.org/warpenterprises/)
Link 2 (http://avisynth.org/warpenterprises/)


Now there is several of ways to encode with x264 i will show you two ways GUI encoding and Batch encoding.


MeGUI

MeGUI is the program we use as our GUI encoder. This encoder has a graphical interface if you want to encode using Batch goto the next section.

When you start MeGUI it will prompt you if there is any new updates. If you want to use the x264 builds i linked to at the top of the guide
untick the x264 update. If you want to use the x264 builds i recommended copy the x264.exe file to "c:\program files\megui\tools\x264\"

When it prompts about x264 profiles tick the following ones:



x264: DXVA-HD-HQ
x264: DXVA-HD-Insane
x264: Unrestricted (take the ones you think you need)



Now we have that in order we can continue. When you have started MeGUI choose your avisynth script (.avs)

http://hdimage.org/images/d4a7ypsl45urdbg8hh0_meguipic1.jpg

Be sure that File format is set to "MKV"

Now letīs start configuring our x264 encoding settings goto "Config"

I will be focusing on the DXVA-HD-HQ preset and tweak it a little (!When using VBV restrictions you should only be using 2-pass mode.
As 1-pass modes has some compliancy problems at the moment).

DXVA is for Gpu and Hardware support.

here is the basic commandline before i tweaked it for our guide.



program --pass 2 --bitrate XXXX --stats ".stats" --level 4.1 --ref 4 --mixed-refs --bframes 3
--b-rdo --bime --weightb --direct auto --filter -1,-1 --subme 6 --trellis 2 --partitions p8x8,b8x8,i4x4,i8x8
--8x8dct --vbv-bufsize 40000 --vbv-maxrate 50000 --me umh --threads auto --thread-input --progress
--no-psnr --no-ssim --output "output" "input"




Well the first thing i want to do is raise --subme 6 to --subme 7
You can do that under "RC and ME" There you have "subpixel Refinement" you want to set that to "7 - RDO Level 2 (Slower)"

http://hdimage.org/images/zue433dbc7d521qkog1_meguipic2.jpg

The reason for this is that Psy-rdo works very well with --subme 7 it will take some extra time, but we really want to archieve the best result.
In the same section you can change the values of "M.E. Range" Default is "16" You can raise it to 24, 32, 64 higher the better but for movies 24 should really be enough 64 can be used for Anime.
Expect a much longer encoding time when raising these numbers!

If you goto "Main" in x264 in there untick turbo mode. As we want exact same settings for pass 1 and 2. This will take twice the time but will gain you better quality.
make a sample to see if itīs worth the extra time.

http://hdimage.org/images/5zdc5x4jdlqc6db7bcc1_meguipic3.jpg

Now if you donīt care about hitting a specific filesize you can do a Single pass constant Rate Factor encode instead this will provide you with teh same quality through the hole movie.

in x264 go from 2 pass to const. Quality and choose a level between 18-24. 18 being the best.


Tweaking


Well as movies all vary how compressable, grainy and etc.

There are numerous of tweaks you can apply to your settings.


Level 4.1 Compliances:

number of reference frames.

|-----------|---------|

|Resolution | no. ref |

|-----------|---------|

| 1280x544 | 12 |

| 1280x720 | 9 |

| 1920x800 | 5 |

| 1920x816 | 5 |

| 1920x1080 | 4 |

|-----------|---------|





If none of the resolutions above match your source, use the following equation to work it out for yourself:
8388608
__________________

(width x height)

thanks to DarkShikari for the method and techouse for the math

Deblocking:



Movies: the highest you should set it is 0,0 here is some you can try out with.
-1,-1
-1,-2
-2,-1
-3,-3



Anime: With Anime you should always stay on the + side +2,+2 is considered a good setting.

Try and mess around with the settings to see which setting you get the best results from.



Adaptive Quantizers:


A new AQ algorithm can be introduced simply by introducing a new aq_mode and a corresponding if in adaptive_quant_frame.
This also allows quantizer field smoothing, since quantizers are calculated beforehand rather during encoding.
Since there is no more reason for it, aq_mode 1 is removed. The new mode 1 is in a sense a merger of the old modes 1 and 2.
WARNING: This change redefines CRF when using AQ, so output bitrate for a given CRF may be significantly different from before this change!

You can change settings with this command.

Keep in mind that you should keep the settings between 0.7 - 1.5

Adaptive Quantizers can be found under "Advanced" in x264



--aq-strength 0.8




New B-frame Decision


In the new x264 builds there is a new B-frame decision itīs much more precise than the old method. Recommended numbers of B-frames with this new B-frame decision "3-6" B-frames.
If you where using 16 B-frames before it will be considerably slower than with the old method because of the new algorithm use 4-5 B-frames instead.

Command to enable the new B-frame decision.



--b-adapt 2





Now if you donīt want to use it write this command in custom commands in the advanced section of x264



--b-adapt 1

hajj_3
1st October 2008, 22:10
Bitrates

Bitrates for 1080p encodes should be between = 8000-12000 kbps
Bitrates for 720p encodes should be between = 4000-6000 kbps
it depends on the source sometimes it needs even less than stated or even more be sure to make a sample before encoding the hole movie!
Dark movies will normally require less bitrate than a bright/colored movie.


MeGUI Bitrate calculator


You can use MeGUI Bitrate calculator if you are trying to hit a specific filesize.
So if you goto tools and find the Bitrate calculator

http://hdimage.org/images/6jahxx0j6wl61rm6g8cs_meguicalc.jpg

As you can see on the picture above i have found the size iīm going after always remember to change this to what you have:

Audio Type: in my case DTS
Audio Bitrate: in my case 1536
and also ensure that the correct framerate is choosen.

Here is the final commandline



program --pass 2 --bitrate XXXXX --stats ".stats" --level 4.1 --ref 4 --mixed-refs --bframes 3 --b-rdo --bime --weightb --direct auto --filter -2,-1 --subme 7 --trellis 2 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-bufsize 40000 --vbv-maxrate 50000 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input"




Be sure to save the presets when you are done setting all your settings!


MeGUI AVS Cutter


Now you donīt wanna encode the hole movie before testing your settings. so load up your "Sample Script.avs"
In MeGUI goto tools and select "AVS Cutter"

http://hdimage.org/images/clk7l2fovajvf3axux_meguipic4.jpg

Make a 1000 Frame sample from somewhere in the movie

Example:

start frame.: 10000
End frame...: 11000


AVSP Comparison Source vs Encode

You need to put the FFmpeg source dll into your avisynth directory
c:\program files\avisynth 2.5\plugins\

Now open AVSP and copy the following code.





a=import("source avs script.avs")

b=Directshowsource("yourencode.mkv")

interleave(a,b)





Now press F5 or goto "Video" and press "refresh preview"
Drag the frame slider until you find a nice screen without to much movement. The very next frame should be the same frame, just your encode.
If there is any movement between the frames, you are on the encode frame and need to go back one frame to get to the source frame.

http://hdimage.org/images/85obsdvdjrsu876vegef_comp1.jpg


Now Go to Video>Save image as... and make sure you save it as a PNG. This is the source screenshot. Proceed to the next frame and do the same thing, saving it as the encode screenshot.

http://hdimage.org/images/06gu3uhbyf0f4ccknspn_comp2.jpg


If it doesnīt work for you here is another way.

Open up your Encode script.avs next open your sample.mkv and add this command only to the sample



Trim(1,0)




just switch between your source and encode.



Batch Encoding

Batch encoding is done by making a batch encoding script i will show you how. (If you are a newbeginner i would recommend trying MeGUI first).

First put your x264.exe in your STREAM folder.

Then open notepad and write in your commands save it as encode batch.bat and just double click it to start it.

If you also want to use the pc while encoding remember to put it to a low priority in "Task manager"

here is an example of a script with Turbo 1-pass for maximum quality use same settings on both



x264.exe --pass 1 --bitrate XXXX --stats ".stats" --ref 5 --mixed-refs --no-fast-pskip --bframes 5 --b-pyramid --b-rdo --bime --weightb --direct auto --deblock -3:-3 --subme 7 --analyse all --8x8dct --trellis 2 --aq-strength 0.8 --psy-rd 1.0:0.0 --b-adapt 2 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output NUL "avs encode.avs"

x264.exe --pass 2 --bitrate XXXX --stats ".stats" --ref 5 --mixed-refs --no-fast-pskip --bframes 5 --b-pyramid --b-rdo --bime --weightb --direct auto --deblock -3:-3 --subme 7 --analyse all --8x8dct --trellis 2 --aq-strength 0.8 --psy-rd 1.0:0.0 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim --output "yourmovie.mkv" "avs encode.avs"




If you want to do first pass in turbo mode here is an example. Notice this will take less time but have a lower quality output.
Play around with the settings to you find a decent ratio between encoding time and output quality!



x264.exe --pass 1 --bitrate XXXX --stats ".stats" --bframes 3 --b-pyramid --direct auto --deblock -3:-3 --subme 1 --analyse none --psy-rd 1.0:0.0 --me dia --threads auto --thread-input --progress --no-psnr --no-ssim --b-adapt 2 --output NUL "avs encode.avs"



http://hdimage.org/images/z1uzqa6bwif88wd3rgnq_x264batch.jpg





x264 Commands


--Threads x (where 'x' is the number of threads)
Command for number of threads.

--Pass
Command for pass number.

--Bitrate
Command for bitrates.

--Stats “.stats”
Command for stats file.

--Crf
Command for single pass constant rate factor. (single pass encoding recommended if you dont want to hit a specific filesize).

--Interlaced
Command for interlaced encoding.

--Bframes 3-16
Command for numbers of B-frames.

--Ref 3-6
Command for numbers of refference frames.

--mixed-refs
Command for enabling mixed refference frames.

--B-pyramid
command for enabling b-pyramid (should be disabled if you encode Anime)

--Trellis 1-2
Command for trellis

--Subme 1-7
Command for Subpixel Motion Estimation.

--Merange 16-64
Command for Motion Estimation range.

--Deblock -3:-3
Command for deblocking settings.

--Psy-rd 1.0:0.0 (standard settings) first is psy-rdo and then its psy-trellis this is used for sharpening)
Command for enabling psy-rdo and psy-trellis

--me x (where 'x' is 'dia', 'hex', 'umh' or 'esa')
Command for Motion Estimation Method

--partitions i8x8,i4x4,p8x8,p4x4,b8x8,all
Command for Macroblock Partitioning.

--Direct x (where 'x' is 'none', 'spatial', 'temporal' or 'auto')
Command for direct mode.

--B-rdo
Command enables RDO.

--B-adapt 1-2 (2 is more precise but takes more time)
B-frame decision

--Bime
Command enables bidirectional M.E.

--Scenecut x (where 'x' is the scene cut value)
Command for Scene Cut.

--No-cabac
Command Disables CABAC

--Keyint 250
Command for Key frame interval

--Min-keyint 25
Command for minimum GOP size.

--Output
Command for your output file.

you.avs.script.avs
command for choosing avs script


x264 quants


This is not so accurate with the new psy-rdo patch!

when you have made an encode in MeGUI you can goto the log and check out your quants. Here is what you should look for in the log



avis [info]: 1920x800 @ 23.98 fps (225877 frames)
x264 [info]: using cpu capabilities: MMX MMXEXT SSE SSE2 SSSE3
x264 [info]: slice I:19020 Avg QP:14.99 size:135578
x264 [info]: slice P:104481 Avg QP:16.42 size: 63445
x264 [info]: slice B:102376 Avg QP:18.27 size: 25097
x264 [info]: mb I I16..4: 10.3% 61.9% 27.8%
x264 [info]: mb P I16..4: 1.3% 16.4% 5.2% P16..4: 44.0% 21.7% 4.9% 0.2% 0.1% skip: 6.1%
x264 [info]: mb B I16..4: 0.1% 1.3% 0.3% B16..8: 32.7% 2.0% 3.6% direct: 9.0% skip:51.1%
x264 [info]: 8x8 transform intra:67.7% inter:48.0%
x264 [info]: direct mvs spatial:89.3% temporal:10.7%
x264 [info]: ref P 66.7% 17.7% 9.1% 3.8% 2.8%
x264 [info]: ref B 81.9% 12.0% 3.7% 1.4% 0.9%
x264 [info]: kb/s:10000.5




explanation of what you see.



This is the output from an x264 encoding job in MeGUI.

In order:

o 1. Input clip information
o 2. CPU extensions in use
o 3-5. These lines give the number, average quantizer, and average size in bytes for each of the three frametypes (I, P, B)
o 6-8. These lines give the use of the various partitions available to x264
o 6. This line gives information on the use of 16x16, 8x8 and 4x4 MBs in I frames
o 7/8. The first three numbers refer to the use of I MBs in the P/B frame, and are in the same

order as above. The second set are for MBs of the native type (P or B). Skip and direct refer

to skip / direct encoded MBs. As far as I know, direct are simply motion compensated MBs with no other processing (beyond deblocking), and skip refers to unchanged

blocks. Take these last two definitions with salt, I'm not sure how accurate they are.

o 9. This gives the breakdown of 8x8 transform type usage. This is the 8x8dct (ie, -8) option (?)
o 10. This gives a breakdown of direct MB types. These are the 'direct' from B frames above.
o 11/12. This gives the usage for each number of reference frames by frame. The first number

refers to the % of frames using at least one ref, the second to >= 2 refs, etc.

(if you have the new B-frame decision on there will be an extra B-frame line)

o 13. The final line gives the output bitrate. I'm unsure as to whether it includes container overhead or not (I would guess not).




These is the ones you want to examin.



x264 [info]: slice I:19020 Avg QP:14.99 size:135578
x264 [info]: slice P:104481 Avg QP:16.42 size: 63445
x264 [info]: slice B:102376 Avg QP:18.27 size: 25097




Now, what does the average quantizer show?
- It represents the transparency to the source (quantizer 0 = 1:1 copy)

What are good values?
- beneath 16,17 --> waste of space, the file is too big. This means you can reduce the bitrate and therefore more people will be able to play it (less bitrate = easier to play)

- above 25,26 --> you risk blocking and loss of detail, you probably need more bitrate to maintain the quality (always depends on source, but generally this is correct.)

Try to end up somewhere between 18 and 24 and don't forget that the quantizers only show the transparency to the source - so, if the source is shit, they show how perfect you copied the shit

- 2nd pass avg quantizer drop by ~1.5-2 points compared to the 1st pass (due to bframes, motion search etc. --- if you've done a "turbo" 1st pass, MeGui does this by default for those of you who use it)

hajj_3
1st October 2008, 22:10
Eac3to

This program can do many things including demuxing, DTS encoding etc. here is a overview of it features.



- can show information about audio, video and VOB/EVO/(M2)TS files
- can decode and encode various audio formats
- can remove dialog normalization from AC3, E-AC3, DTS and TrueHD tracks
- can extract AC3 stream from Blu-Ray TrueHD/AC3 tracks
- can extract TrueHD stream from Blu-Ray TrueHD/AC3 tracks
- can extract DTS core from DTS-HD tracks
- can remove DTS zero padding and repair outdated DTS-ES headers
- can apply positive or negative audio delays
- can reduce bitdepth of decoded audio data by using TPDF dithering
- can resample decoded audio data (using "r8brain")
- can apply/reverse PAL speedup on decoded audio data (using "r8brain")
- can demux all video and audio tracks of an EVO/VOB/(M2)TS source file
- can list available titles of Blu-Ray and HD DVD discs
- can extract Blu-Ray and HD DVD chapter information and subtitles
- can mux MPEG2, VC-1 and h264 video tracks to Matroska
- can remove pulldown flags from MPEG2, VC-1 and h264 video tracks



eac3to sourcefile[+sourcefile2] [trackno:] [destfile|stdout] [-options]

Examples:

eac3to source.pcm destination.flac
eac3to source.thd destination.flac destination.ac3
eac3to source.evo 1: chapters.txt 2: video.mkv 3: audio.flac 5: subtitle.sup
eac3to feature_1.evo+feature_2.evo movie.mkv
eac3to blurayMovieFolder movie.mkv

Options:

-448 use e.g. "192", "448" or "640" kbps for AC3 encoding
-768 use "768" or "1536" kbps for DTS encoding
-core extract the DTS core of a DTS-HD track
+/-100ms apply a positive or negative delay
-0,1,2,3,4,5 remap the channels to the specified order
-down6 downmix 7 or 8 channels to 6 channels
-down2 downmix multi channel audio to stereo (Dolby Pro Logic II)
-mixlfe mix LFE in (when doing stereo downmixing, see "down2")
-down16 downconvert decoded audio data to 14..23 bit
-slowdown reverse PAL speedup (25.000 -> 24.000/1.001 fps)
-speedup apply PAL speedup (24.000/1.001 -> 25.000 fps)
-resampleTo48000 resample audio to "44100", "48000" or "96000" Hz
-quality=4 slowdown/speedup/resampling quality (0 = low; 4 = very high)
-quality=0.50 Nero AAC encoding quality (0.01 = low; 0.99 = very high)
-8 PCM file has "1".."8" channels
-16 PCM file is "16" or "24" bit
-little PCM file is "little" or "big" endian
-96000 PCM file is "44100", "48000", "96000" or "192000" Hz
-override forcefully overrides PCM auto detection with manual values
-sonic/nero/... force the use of a specific decoder (not recommended)
-keepDialnorm disables dialog normalization removal (not recommended)
-demux demuxes 1st video track and all audio and subtitle tracks
-stripPulldown strips the pulldown from MPEG2 video tracks
-keepPulldown disable removal of pulldown for MPEG2, h264 and VC-1 tracks
-skip2 skips the first 1..99 VC-1 sequence headers
-seekToIFrames make all h264/AVC "I" frames seekable
-24p/30p/60i force the use of the specified framerate for h264 muxing
-check checks if the source EVO/(M2)TS file is clean.
-test checks if the external filters are installed & working



Supported source formats:

(1) RAW, (L)PCM
(2) WAV (PCM, DTS and AC3)
(3) AC3, E-AC3
(4) DTS, DTS-ES, DTS-96/24, DTS-HD Hi-Res, DTS-HD Master Audio
(5) MP1, MP2, MP3 audio
(6) AAC audio
(7) MLP, TrueHD, TrueHD/AC3
(8) FLAC
(9) EVO/VOB/(M2)TS

Decoded audio data can be stored as / encoded to:

(1) RAW, (L)PCM
(2) WAV (PCM only)
(3) WAVs (multiple mono WAV files, PCM only)
(4) AC3
(5) DTS
(6) AAC
(7) FLAC

For best AC3, E-AC3 and AAC decoding you need:

(1) Nero 7 (Nero 8 won't work!)
(2) Nero HD-DVD / Blu-Ray plugin

For best DTS decoding you need:

(1) ArcSoft DTS Decoder - version 1.1.0.0 or newer


For DTS encoding you need:

(1) SurCode DVD DTS - version 1.0.21 or newer


For AAC encoding you need:

(1) Nero AAC Encoder


For video muxing you need:

(1) Haali Matroska Muxer




Now to start with put all the files from eac3to folder over in your Blu-ray "STREAM" folder. In the same folder also add the Arcsoft DTS DLLs as we aer going to use them for the DTS Decoding.
Now goto your windows start menu
and start command you can do that by writing "cmd" omit the quotes.

Well for those of you that canīt remember the simple commands in cmd here is some you gonna need


cd.. = 1 directory back
cd "foldername" = change to that directory
e: = change drive


Now find your movie folder and use this command.
With this command you can see all the streams in the selected stream and you can also see the frame-rate.

23.976 = 1080p24 / 1.001
24 = 1080p24





eac3to filename.m2ts



As seen on the picture below this command will show you what is in the that specific .m2ts file and you can also see what number the different streams have.

http://hdimage.org/images/m6yonhohr4apc6fjkgy_eac3topic1.jpg

If your movie is splitted over several m2ts files you can mux them to a single .Mkv file using this command



eac3to filename_1.m2ts+filename_2.m2ts #: movie.mkv # = number of the video stream itīs usually 2




Now you want to demux .m2ts file so we can get all the subtitles and audio tracks.





eac3to filename.m2ts -demux


http://hdimage.org/images/hitxo4fjl7i7d50qzgsk_eac3topic2.jpg

Now we want to encode the audio to DTS i used this command -Core. In my example the raw audio was DTS-HD Master Audio it has the extension .dtsma

So when itīs
DTS-HD Master Audio you should use the command -Core

and when itīs
PCM and True-HD. You should use the command -1536





eac3to filename.dtsma audioDTS.dts -Core



http://hdimage.org/images/qah7lu8gevxki2campg0_eac3topic3.jpg


Visit this site for further command explanations Command help (http://en.wikibooks.org/wiki/Eac3to/How_to_Use)


When you are done encoding your audio you can remux with mkvtoolnix. Just add your mkv + dts file and mux them together.

If you want to add subtitles also first convert them from .sup to srt. with Suprip Download Link (http://exar.ch/suprip/) then mux them with the .mkv and .dts file.

Atak_Snajpera
1st October 2008, 22:27
I have very stupid question! :) Wouldn't be easier to just use RipBot264? :)

hajj_3
1st October 2008, 22:32
lol, i've tried ripbot264 but it was too simplified for my liking, advanced users tend to want more control. The guide also explains a fair bit about x264 too for users.

Atak_Snajpera
1st October 2008, 22:39
lol, i've tried ripbot264 but it was too simplified for my liking
true but there is good side of it. At least I don't have to write any guides :)

rica
1st October 2008, 22:47
Good trick: splitting one post to 3 posts.

I just tried to give it in one post:

http://forum.doom9.org/showthread.php?t=136505

I think i have to update.

Users do not need/like too much explanations on details; they know where to find them.

hajj_3
1st October 2008, 22:53
yours is rather basic and not much detail, this guide is alot better imo, you are welcome to suggest changes and make screenshots for things that dont have screenshots, better to have a complete full in depth guide like doom9 used to be known for, unfortunately they never bothered creating a bluray to x264 guide for doom9.org main site so this is the attempt of another forum which i slightly edited bits, mainly vista screenshots and replaced with xp screenshots as most users use xp, feel free to replace the few vista ones in here.

not really rica, users dont want to read the 300 page or so thread about bluray to x264 that exists, a simple guide like this with screenshots and some details about x264 settings is what most users want, reading 300 pages is crazy.

J_Darnley
1st October 2008, 23:11
Please correct the x264 options with upper case letters. No long options have one. --mixed-refs is the only one you have listed which x264 will understand.

hajj_3
1st October 2008, 23:15
paste me which ones need changing and what to and i'll update the guide, im only an intermediate user, i use megui to set options, i dont paste options in, i just thought we could do with a proper bluray to x264 in depth guide, obviously lots will need changing by the guru's on here but its a good starting point.

J_Darnley
1st October 2008, 23:31
What did you not understand about upper case letters? The term? Capitals, hoofdletters, lettres majuscules? And sorry, you had --partitions and --me correct too.
--threads --pass --bitrate --stats --crf --interlaced --bframes --ref --b-pyramid --trellis --subme --merange --deblock --psy-rd --direct --b-rdo --b-adapt --bime --scenecut --no-cabac --keyint --min-keyint --output

jult
6th March 2009, 17:04
Is there still no fully maintained and updated commandline reference for the stable x264.exe ?
Pretty ridiculous it can only be obtained through the longhelp option. I find CLI-help is never useful that way, since you're already typing and adapting commands and sh_t. It's much easier to simply obtain commands from a well-explained alphabetical reference guide online. Maybe even a wiki, since options change and disappear with each version.

Really sad to see that this needs to be the culprit for such a good open-source codec.

RunningSkittle
6th March 2009, 17:13
If this guide is for 'advanced' users, you likely lost the interest of most of them when you chose to use directshowsource.

Unhandled
6th March 2009, 19:01
@jult

http://mewiki.project357.com/wiki/X264_Settings

rookandpawn
30th August 2009, 08:11
This saved me!

I was trying to insert a .m2ts file directly in graphstudio and then having GraphStudio auto-render the pin, but then your tutorial showed me the correct way to use Haali media splitter on the .m2ts file. Thank you thank you!:goodpost:

Thank you!

creamyhorror
30th August 2009, 16:41
I use FFVideoSource() on MTS files (albeit only AVCHD ones so far). There doesn't seem to be a need to use GraphStudio - but do correct me if I'm wrong.