22
Jan
x265 codec encoding (with ffmpeg)
Pre-requisites
ffmpeg needs to be built with the –enable-libx265 configuration flag and requires x265 to be installed on your system.
Cmd:
ffmpeg -i input -c:v libx265 -crf 28 -c:a aac -b:a 128k output.mp4
The -crf flag
The Constant Rate Factor (CRF) is the default quality (and rate control) setting for the x264 and x265 encoders.
For x264 your valid range is 0-51
: sane values are between 18 and 28.
The default is 23, so you can use this as a starting point.
The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible. A lower value is a higher quality and a subjectively sane range is 18-28. Consider 18 to be visually lossless or nearly so: it should look the same or nearly the same as the input but it isn’t technically lossless.
For x265, the default CRF is 28.