Log in

View Full Version : Is max bitrate useful if i use average bitrate


YaBoyShredderson
28th January 2021, 14:15
Current i use handbrake, x264, crf 18 to encode blurays but im getting kind of annoyed at the inconsistency of file sizes.

Im thinking of using staxrip instead, x265, 10bit 2 pass abr. Was wondering wether i should use max bitrate if im using average bitrate?

benwaggoner
28th January 2021, 21:08
Setting max bitrate (and vbv-bufsize; they both need to be set to have a useful impact) is mainly useful to reduce variability in bitrate for streaming or for decoder requirements. x265 should automatically constrain it and vbv-bufsize based on your profile, level, and tier, and generally selects the lowest profile and level compatible with your frame size and frame rate.

So setting it to something more constrained would be really based on the specifics of your use case.

Also, why are you annoyed by variability in file size? For encoding, your choices are basically to set quality and vary bitrate or set bitrate and vary quality. Setting an ABR will generally mean that your easiest content winds up being bigger files than needed and your hardest content will get fewer bits than needed to deliver the target quality.

It's possible to use crf and bitrate together, and file size will then be the lower of what needed for the CRF or the specified bitrate.

YaBoyShredderson
28th January 2021, 21:44
Setting max bitrate (and vbv-bufsize; they both need to be set to have a useful impact) is mainly useful to reduce variability in bitrate for streaming or for decoder requirements. x265 should automatically constrain it and vbv-bufsize based on your profile, level, and tier, and generally selects the lowest profile and level compatible with your frame size and frame rate.

So setting it to something more constrained would be really based on the specifics of your use case.

Also, why are you annoyed by variability in file size? For encoding, your choices are basically to set quality and vary bitrate or set bitrate and vary quality. Setting an ABR will generally mean that your easiest content winds up being bigger files than needed and your hardest content will get fewer bits than needed to deliver the target quality.

It's possible to use crf and bitrate together, and file size will then be the lower of what needed for the CRF or the specified bitrate.

Im generally annoyed by the variability as it can vary wildly and often unpredictably, as well as some files ending up larger than the source. Rather than wasting time encoding something several times to try and get the file size down for some files, ot would be easier to just set the average bitrate.

benwaggoner
29th January 2021, 01:23
Im generally annoyed by the variability as it can vary wildly and often unpredictably, as well as some files ending up larger than the source. Rather than wasting time encoding something several times to try and get the file size down for some files, ot would be easier to just set the average bitrate.
The simplest thing to be would be to set --crf, --bitrate, and --vbv-maxrate together. In a single pass that would keep the average lower, although 1-pass VBR won't give optimal bit distribution. You could also do the first pass as --crf but save a .stats file and potentially an analysis-save. For files that aren't too large, call it a day. And for files that are too large, then do a 2nd pass targeting an ABR. Reusing the stats and particularly analysis data should make a second rate-controlled pass quite a bit faster than the first.

I tried this all some years ago and it worked quite nicely, but there are probably specifics I am forgetting.