![x264 ffmpeg crf 25 x264 ffmpeg crf 25](https://img.lydingpin.com/upload/image/2022092213/0109/166300257749857197662.png)
With low motion, compression artifacts become more salient (visually apparent) and thus more distracting. On the other hand, when a frame doesn’t have a lot of motion, you will (simply put) have more time to look at the image, and there will be nothing to distract you or mask any artifacts, so you want the frame to be as little compressed as possible. Slightly more technically speaking, high motion “masks” the presence of compression artifacts like blocking. In layperson’s terms, this is because your visual system will be “distracted” by everything going on, and won’t have the image on screen for enough time to see the heavier compression. Because of this, a video encoder can apply more compression (drop more detail) when things are moving, and apply less compression (retain more detail) when things are still. The human eye perceives more detail in still objects than when they’re in motion. This effect is quite pronounced in the first video clip, for example. The line for CRF is always lower than the line for CQP it means that the encoder can save bits, while retaining perceptual quality, whereas with CQP, you waste a little bit of space. This will essentially change the bitrate allocation over time.įor example, here is a figure ( from another post of mine) that shows how the bitrate changes for two video clips encoded at different levels (17, 23) of constant QP or CRF: Constant Rate Factor at CRF=18 will increase the QP to, say, 20, for high motion frames (compressing them more) and lower it down to 16 for low motion parts of the sequence. A constant QP encode at QP=18 will stay at QP=18 regardless of the frame (there is some small offset for different frame types, but it is negligible here). It does this by taking motion into account.
![x264 ffmpeg crf 25 x264 ffmpeg crf 25](https://i.ibb.co/khYXBYp/phpb3x-Ulh.jpg)
It will compress different frames by different amounts, thus varying the QP as necessary to maintain a certain level of perceived quality. This typically leads to a hugely varying bitrate over the entire sequence.Ĭonstant Rate Factor is a little more sophisticated than that. The quantization parameter defines how much information to discard from a given block of pixels (a Macroblock). In tech terminology, you maintain a constant QP (quantization parameter). Typically you would achieve constant quality by compressing every frame of the same type the same amount, that is, throwing away the same (relative) amount of information. CRF versus Constant QPĬRF is a “constant quality” encoding mode, as opposed to constant bitrate (CBR). You can clearly see the logarithmic relationship between CRF and bitrate. For other CRFs and resolutions, the rates vary accordingly. To give you an estimation of the bitrates to be expected for clips with different resolutions, here’s a figure showing the average bitrate in MBit/s for four one-minute video clips with different encoding complexity, encoded with x264 and different CRF values:Īs you can see, the maximum rate can range between 10 and 25 MBit/s for a 2160p encode at CRF 23. In video streaming, for example, CRF can be used in a constrained/capped mode to prevent bitrate spikes. For other applications, other rate control modes are recommended.
#X264 ffmpeg crf 25 Offline#
You should use CRF encoding primarly for offline file storage, in order to achieve the most optimal encodes. A change of ☖ should result in about half/double the file size, although your results might vary. Is the file size too high? Choose a higher CRF.
![x264 ffmpeg crf 25 x264 ffmpeg crf 25](https://www.mxparts.com.br/imagens_conteudo/kit-plastico-polisport-crf-250r-450r-55925p.jpg)
Is the quality good enough? No? Then set a lower CRF. If you’re unsure about what CRF to use, begin with the default and change it according to your subjective impression of the output. Ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 31 -b:v 0 output.mkv