Log in

View Full Version : x264 L4.0 vs. L4.1 ?


dansrfe
24th December 2010, 10:43
I have found very little difference between the specifications for Level 4.0 and Level 4.1 in x264's specs. I do a lot of x264 cmd line encoding and my main question was that is what setting do I need to increase/decrease or add to make x264 set the level to 4.1 and what difference would it make in the first place.

Here's my current cmd line:

avs2yuv script.avs -o - | x264 --stdin y4m --thread-input --partitions all --deblock -3:-3 --qcomp 0.65 --me umh --merange 32 --b-pyramid 2 --b-adapt 2 --bframes 6 --trellis 2 --aq-mode 1 --aq-strength 1.0 --subme 9 --ref 5 --crf 19 --no-mbtree --rc-lookahead 60 --no-fast-pskip -o output.mkv -

7ekno
24th December 2010, 11:57
Only difference between 4.0 and 4.1 is maximum bitrate ;)

7ek

shroomM
24th December 2010, 12:00
Also, I believe that when you're encoding for bluray, using Level 4.0 means you can avoid using slices (please correct me if I'm wrong), which supposedly hurt compressibility. How much is up for debate though.

dansrfe
24th December 2010, 12:11
Only difference between 4.0 and 4.1 is maximum bitrate ;)

7ek

How does x264 know what the max bitrate will be before even the encoding starts? It says setting to Level 4.0 before the frames processed and fps status line shows up.

Sharktooth
24th December 2010, 12:22
x264 doesnt know but the maxbitrate value is a RESTRICTION.

Audionut
24th December 2010, 12:44
AFAIK, x264 sets the level based on refs and resolution.

So if you want to ensure for instance it uses level 4.1 instead of 4.0, you should use the --level parameter.

dansrfe
24th December 2010, 19:15
^ That's what I was wondering too but I have refs set to 5 and the input resolution is 1920 x 800. My main problem was the whole autodetection thing for x264 to choose L4.1 on its own but I just used the level param to get it to 4.1.

Snowknight26
24th December 2010, 20:46
Who cares what the level flag is? If you aren't using VBV, why not let x264 automatically set it? Remember, players go by the ref count* not the level flag.

dansrfe
24th December 2010, 22:24
That's quite true but here's the problem: How does x264 know if 4.0 is sufficient for the maximum bitrate that crf might encode at? Like right now I'm encoding a file that is peaking around 13Mbps but I know x264 would have set the level flag to 4.0 before the encoding even started even though most x264 encoes around this bitrate are at 4.1. With all the info above, I'm concluding that the level between 4.0 and 4.1 doesn't make a difference.

shon3i
24th December 2010, 22:55
That's quite true but here's the problem: How does x264 know if 4.0 is sufficient for the maximum bitrate that crf might encode at? Like right now I'm encoding a file that is peaking around 13Mbps but I know x264 would have set the level flag to 4.0 before the encoding even started even though most x264 encoes around this bitrate are at 4.1. With all the info above, I'm concluding that the level between 4.0 and 4.1 doesn't make a difference.
Because x264 will not set VBV, only level flag, so there is no limit on bitrate at all, it's same effect as leave level unset.

benwaggoner
30th December 2010, 21:08
Because x264 will not set VBV, only level flag, so there is no limit on bitrate at all, it's same effect as leave level unset.
Really? I always get worried when I find places where x264 can make a non-compliant file by default. I'd prefer that it would constrain the VBV, ref frame count, etcetera to those compatible with a specified level. Provide an override, definitely, but I think by default the output should be Profile@Level complaint unless there is an explicit override set.

kemuri-_9
30th December 2010, 22:21
there is a x264_param_apply_level feature in the works from one of the GCI folks that will restrict features to the level specified (if it actually is specified), similar to the profile one.
(this is being combined with some initial --device support)

x264cli will be calling this by default and will downsize your input video, if it deems necessary, to meet the level/device restrictions.

benwaggoner
30th December 2010, 22:32
there is a x264_param_apply_level feature in the works from one of the GCI folks that will restrict features to the level specified (if it actually is specified), similar to the profile one.
(this is being combined with some initial --device support)

x264cli will be calling this by default and will downsize your input video, if it deems necessary, to meet the level/device restrictions.
That sounds just perfect! Bonus that it handles automatic resizing as well.

Lyris
31st December 2010, 02:44
I didn't realise it didn't do that already. Thanks for the info.