Changes between Version 80 and Version 81 of Encode/H.264


Ignore:
Timestamp:
Dec 30, 2021, 9:33:42 PM (5 years ago)
Author:
Balling
Comment:

changed to qp 0

Legend:

Unmodified
Added
Removed
Modified
  • Encode/H.264

    v80 v81  
    2121
    2222== 1. Choose a CRF value ==
    23 The range of the CRF scale is 0–51, where 0 is lossless, 23 is the default, and 51 is worst quality possible. A lower value generally leads to higher quality, and a subjectively sane range is 17–28. Consider 17 or 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.
     23The range of the CRF scale is 0–51, where 0 is lossless (for 8 bit only, for 10 bit use -qp 0), 23 is the default, and 51 is worst quality possible. A lower value generally leads to higher quality, and a subjectively sane range is 17–28. Consider 17 or 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.
    2424
    2525The range is exponential, so increasing the CRF value +6 results in roughly half the bitrate / file size, while -6 leads to roughly twice the bitrate.
     
    2929{{{
    3030#!div style="border: 1px solid #e5e5c7; margin: 1em; background-color: #ffd;"
    31 '''Note:''' The 0–51 CRF quantizer scale mentioned on this page only applies to 8-bit x264. When compiled with 10-bit support, x264's quantizer scale is 0–63. You can see what you are using by referring to the `ffmpeg` console output during encoding (`yuv420p` or similar for 8-bit, and `yuv420p10le` or similar for 10-bit). 8-bit is more common among distributors.
     31'''Note:''' The 0–51 CRF quantizer scale mentioned on this page only applies to 8-bit x264. When compiled with 10-bit support, x264's quantizer scale is 0–63 (internally in x264 itself it is from -12 to 51 https://code.videolan.org/videolan/x264/-/blob/master/x264.c#L733 but ffmpeg libx264 wrapper shifted it, so that 0 is lossless, but only in supported profiles, High 10 does not support lossless). You can see what you are using by referring to the `ffmpeg` console output during encoding (`yuv420p` or similar for 8-bit, and `yuv420p10le` or similar for 10-bit). 8-bit is more common among distributors.
    3232}}}
    3333
     
    148148= Lossless H.264 =
    149149
    150 You can use `-crf 0` to create a lossless video. Two useful presets for this are `ultrafast` or `veryslow` since either a fast encoding speed or best compression are usually the most important factors.
     150If the profile is High 4:4:4 Predictive you can use `-crf 0` to create a lossless video, otherwise use -qp 0 (High 10 profile does not support lossless, https://code.videolan.org/videolan/x264/-/blob/master/x264.c#L579). Two useful presets for this are `ultrafast` or `veryslow` since either a fast encoding speed or best compression are usually the most important factors.
    151151
    152152Fast encoding example:
    153153
    154154{{{
    155 ffmpeg -i input -c:v libx264 -preset ultrafast -crf 0 output.mkv
     155ffmpeg -i input -c:v libx264 -preset ultrafast -qp 0 output.mkv
    156156}}}
    157157
     
    159159
    160160{{{
    161 ffmpeg -i input -c:v libx264 -preset veryslow -crf 0 output.mkv
     161ffmpeg -i input -c:v libx264 -preset veryslow -qp 0 output.mkv
    162162}}}
    163163