Log in

View Full Version : x264 settings


x265
28th April 2013, 17:37
This is what i'm using to encode one the BD film's i have. Should i make any more changes to the x264 settings?


FFVideoSource("C:\Users\Abhijith Nair\Desktop\Reservoir Dogs.m2ts")
Crop(4, 132, -0, -132)
Dither_convert_8_to_16()
Dither_Resize16(1690, 720, kernel="Spline36")
Dither_Quantize(10, reducerange=true, mode=6)
Dither_Out()



--input-depth 10 --input-res 3380x720 --fps 24000/1001 --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --crf 14.0 --tune film --preset veryslow --aq-strength 0.65 --level 4.1 --profile high10 --subme 10 --me tesa --merange 28 --rc-lookahead 60 --no-fast-pskip --no-dct-decimate --colormatrix bt709 -o "Reservoir_Dogs_720p.mkv"

sneaker_ger
28th April 2013, 22:44
--input-res needs to be 1690x720. Using --bluray-compat with 10bit h.264 is kinda meaningless, because Blu-Ray players do not support 10 bit in the first place.

x265
29th April 2013, 02:16
Sets the number of frames to use for mb-tree ratecontrol and vbv-lookahead. The maximum allowed value is 250.
For the mb-tree portion of this, increasing the frame count generates better results but is also slower.

Should i increase the rc-lookahead value?

x265
29th April 2013, 11:47
Does using open-gop improve compression?

detmek
29th April 2013, 12:02
Should i increase the rc-lookahead value?
No. Even preset Placebo uses 60.
Does using open-gop improve compression?

Only if you use small GOPs, and you don't.

Aslo, --me tesa is usualy waste of time over --me umh with no visible quality improvement. Maybe --subme 11 would be better idea. You should probably remove --level 4.1, --vbv-maxrate and --vbv-bufsize as those are only usefull for hardware players (and your settings won't work with any hardware player because of --profile high10) or network streaming.

x265
29th April 2013, 20:14
--bframes 16 <--- will this improve compression?

LoRd_MuldeR
29th April 2013, 20:26
--bframes 16 <--- will this improve compression?

Compared to what?

Even if you allow up to 16 consecutive B-Frames, x264 will rarely actually go that high. It hardly goes above 4-5 for most footage.

Anime has a tendency to benefit more from higher B-Frame setting. I suggest you check your log and see...

Example:

x264 [info]: consecutive B-frames: 0.7% 0.0% 0.5% 2.7% 12.5% 53.0% 12.8% 6.7% 4.5% 6.7% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0% 0.0%

(Here x264 used 6 or less B-Frames in 82.2% of all cases. And it didn't go above 9 at all, i.e. "--bframes 16" was quite a waste!)

x265
29th April 2013, 20:48
How do i find the no. of bframes x264 used by looking at the log?

LoRd_MuldeR
29th April 2013, 21:02
I posted an example above. First number is no B-Frame at all, second number is one B-Frame, third number is two B-Frames, etc...

x265
29th April 2013, 21:05
What do those percentages indicate?

kypec
29th April 2013, 21:09
What do those percentages indicate?
They indicate the percentage of occurrences of given N-th B frame sequence - from 0 (zero) to X (max) when read from left to right.

LoRd_MuldeR
30th April 2013, 00:20
What do those percentages indicate?

It shows how often each number of B-Frames (in sequence) has actually been used by x264.

And, as you can see in my example, which is from a real encode, very high numbers of consecutive B-Frames (almost) never occur.

...which means "--bframes 16" usually is just a waste of time, as with something like 5 or 6 B-Frames you don't loose much.

x265
1st May 2013, 05:38
How do i calculate the no. of ref. frames and bframes i should use for a 720p encode?

sneaker_ger
1st May 2013, 07:20
--preset, --tune and --level (and --bluray-compat, if applicable) already do that for you.

x265
1st May 2013, 07:28
Ok. Does limiting the no. of ref. & bframes affect the quality of the encode?

sneaker_ger
1st May 2013, 07:51
Like many other x264 options: yes, they influence the quality (at a given bitrate). But as LoRd_MuldeR has shown above it does not always make sense to simply set them to 16 as often that will only eat up CPU time without any return worth mentioning. Just let x264 pick them for you.