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


Ignore:
Timestamp:
Apr 11, 2017, 8:34:41 PM (6 months ago)
Author:
slhck
Comment:

add example for two-pass

Legend:

Unmodified
Added
Removed
Modified
  • Encode/H.265

    v7 v8  
    1717* Constant Rate Factor (CRF) 
    1818 
    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. 
    2020 
    2121=== Constant Rate Factor (CRF) === 
     
    3232}}} 
    3333 
     34=== Two-Pass Encoding === 
     35 
     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`: 
     37 
     38{{{ 
     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 
     41}}} 
     42 
     43You can also forgo the bitrate calculation if you already know what final (average) bitrate you need. 
     44 
     45=== Two-Pass Example === 
     46 
     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): 
     48 
     49{{{ 
     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 
     52}}} 
     53 
     54{{{ 
     55#!div style="border: 1pt dotted; margin: 1em; background-color: #fffff9;" 
     56'''Note:''' Windows users should use `NUL` instead of `/dev/null`. 
     57}}} 
     58 
     59As with CRF, choose the slowest preset you can tolerate. 
     60 
     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. 
     62 
     63 
     64=== Passing Options === 
     65 
    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 [http://x265.readthedocs.org/en/default/ 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. 
     67 
    3568 
    3669=== Setting profiles ===