PDA

View Full Version : Read this before posting a question about x264


JohannesL
16th October 2009, 18:01
Update your x264 to a recent version (http://x264.nl). Never use single-pass bitrate mode or CQP mode. For most purposes CRF mode is highly preferred. Use CRF=~22 as a starting point and find the highest possible CRF value that still satisfies your personal quality needs. However use 2-pass bitrate mode when you need to hit an exact bitrate or an exact file size. Maxrate is useless without a bufsize. PSNR and SSIM are useless for judging the overall percieved quality of video when psychovisual optimisations are enabled. Psychovisual optimisations are enabled by default in x264. If you for some reason need the best possible PSNR/SSIM, use --tune psnr and --tune ssim, respectively. Most of the "you shouldn't use x when encoding x sources" are outdated. There is no "magic bitrate", since it varies for every source. Use the presets - there is rarely any need for specifying partitions, consecutive b-frames, consecutive ref frames, subpixel refinement, qmin, qmax, etc manually.

LoRd_MuldeR
16th October 2009, 18:19
Some remarks:

CRF is good, at a value between 18 and 24.

Not necessarily. A CRF value between 18 and 24 should be a reasonable starting point, indeed. But depending on your quality needs and on your individual source, CRF's outside that range may be needed in some cases. Why not say something like: "For most purposes CRF mode is highly preferred. Use CRF=~22 as a starting point and find the highest possible CRF value that still satisfies your personal quality needs. However use 2-pass bitrate mode when you need to hit an exact bitrate or an exact file size."

They are enabled by default in x264

From the text it's not 100% clear that you refer to Psy optimizations here. It could refer to PSNR/SSIM too.

neuron2
16th October 2009, 22:03
Never use single-pass bitrate mode Why do you say that?

dstln
16th October 2009, 23:06
Trying to get a sticky? :P

And split it up into a list rather than paragraph imo. Also you should probably take away/reduce your "nevers." I'm sure there are some applications for every mode. Maxrate still means something without buffsize even though generally devices would have limits on both. PSNR/SSIM still mean something, but they don't mean as much. But they'll still generally go up with higher bitrates/better settings/etc.

Dark Shikari
16th October 2009, 23:11
Maxrate still means something without buffsizeNo it doesn't.

ajp_anton
17th October 2009, 00:35
No it doesn't.Well it *could* mean max framesize = maxrate/fps =)

Dark Shikari
17th October 2009, 00:42
Well it *could* mean max framesize = maxrate/fps =)But it doesn't.

detmek
17th October 2009, 14:33
Maxrate still means something without buffsize

No it doesn't.

Does this mean that maxrate won't stop crazy bitrate jumps? Lets say, average bitrate is set to 12000kbs, maxrate is set to 24000. Won't this stop a bitrate to jump to, say, 50000?

Question1: Does maxrate refferes to maximum bitrate per second or maximum bitrate per frame?
Question 2: What does exactly buffsize means as I see in some predefined presets is set lower then maxrate?

LoRd_MuldeR
17th October 2009, 14:55
Does this mean that maxrate won't stop crazy bitrate jumps? Lets say, average bitrate is set to 12000kbs, maxrate is set to 24000. Won't this stop a bitrate to jump to, say, 50000?

It means that the VBV model requires two parameters: The maximum bitrate and the size of the buffer. Actually it also needs the initial buffer fullness, which is assumed to be 90%.

So unless you provide both parameters, maximum rate -and- buffer size, VBV cannot be used and won't be used. And thus the peak bitrate won't be restricted at all in this case ;)

Or in other words: VBV max rate has no meaning without a VBV buffer size...

Question1: Does maxrate refferes to maximum bitrate per second or maximum bitrate per frame?
Question 2: What does exactly buffsize means as I see in some predefined presets is set lower then maxrate?

1) Neither. It refers to the maximum bitrate at which data can enter the buffer. In reality this may be restricted by the network's bandwidth or the CD/DVD/BD drive's speed.
2) It's the size of the (hypothetical) buffer, in which the data is stored. Data enters the buffer no faster than max rate. The decoder reads the data from the buffer in chunks as required.

Obviously if the buffer runs out of data (known as "buffer underflow") the decoder has no data to decode and playback stops. So what VBV does is avoiding underflows (and overflows).
If for example the buffer fullness is low and the buffer is in danger to underflow, then the size of the next frame(s) must be limited to circumvent the underflow...

*Link* (http://en.wikipedia.org/wiki/Video_buffering_verifier)

detmek
17th October 2009, 17:45
Thank you, LM. Now I understand better concept of VBV.