Changes between Version 7 and Version 8 of Encode/H.265

Apr 11, 2017, 8:34:41 PM (3 years ago)

add example for two-pass


  • Encode/H.265

    v7 v8  
    1717* Constant Rate Factor (CRF)
    19 In this guide we are going to focus on CRF encoding.
     19In this guide we are going to focus on CRF and Two-Pass encoding.
    2121=== Constant Rate Factor (CRF) ===
     34=== Two-Pass Encoding ===
     36This method is generally used if you are targeting a specific output file size and output quality from frame to frame is of less importance. This is best explained with an example. Your video is 10 minutes (600 seconds) long and an output of 200 MiB is desired. Since `bitrate = file size / duration`:
     39(200 MiB * 8192 [converts MiB to kBit]) / 600 seconds = ~2730 kBit/s total bitrate
     402730 - 128 kBit/s (desired audio bitrate) = 2602 kBit/s video bitrate
     43You can also forgo the bitrate calculation if you already know what final (average) bitrate you need.
     45=== Two-Pass Example ===
     47For libx265, the `-pass` option (that you would use for libx264) is not applicable. Instead, use the private `pass` option with `-x265-params` (see below for more details):
     50ffmpeg -y -i input -c:v libx265 -preset medium -b:v 2600k -x265-params pass=1 -c:a aac -b:a 128k -f mp4 /dev/null && \
     51ffmpeg -i input -c:v libx265 -preset medium -b:v 2600k -x265-params pass=2 -c:a aac -b:a 128k output.mp4
     55#!div style="border: 1pt dotted; margin: 1em; background-color: #fffff9;"
     56'''Note:''' Windows users should use `NUL` instead of `/dev/null`.
     59As with CRF, choose the slowest preset you can tolerate.
     61In pass 1 specify a output format with `-f` that matches the output format in pass 2. Also in pass 1, specify the audio codec used in pass 2; in many cases `-an` in pass 1 will not work.
     64=== Passing Options ===
    3466Generally, options are passed to x265 with the `-x265-params` argument. For fine-tuning the encoding process, you can therefore pass any option that is listed in the [ x265 documentation]. Keep in mind that fine-tuning any of the options is generally not necessary, unless you absolutely know what you need to change.
    3669=== Setting profiles ===