Changes between Version 4 and Version 5 of Encode/AV1


Ignore:
Timestamp:
Jun 3, 2018, 9:25:06 PM (4 months ago)
Author:
slhck
Comment:

add 2-pass example

Legend:

Unmodified
Added
Removed
Modified
  • Encode/AV1

    v4 v5  
    1010 
    1111- 1-pass average bitrate 
     12- 2-pass average bitrate 
    1213- Constant quality 
    1314 
     
    1617{{{ 
    1718#!div style="border: 1px solid #e5e5c7; margin: 1em; background-color: #ffd;" 
    18 '''Note:''' AV1 encoding is very slow in comparison to VP9 or H.264, and considered experimental at this stage. 
     19'''Note:''' AV1 encoding is very slow in comparison to VP9 or H.264, and considered experimental at this stage (hence the use of `-strict -2` is necessary). 
    1920}}} 
    2021 
     
    2425 
    2526{{{ 
    26 ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -strict -2 av1_test.mkv 
     27ffmpeg -i input.mp4 -c:v libaom-av1 -b:v 2M -strict -2 output.mkv 
    2728}}} 
    2829 
    2930Use this option if file size and encoding time are more important. 
     31 
     32=== Two-Pass ===#twopass 
     33 
     34In order to create more efficient encodes when a particular target bitrate should be reached, you should choose two-pass encoding. For two-pass, you need to run `ffmpeg` twice, with almost the same settings, except for: 
     35 
     36* In pass 1 and 2, use the `-pass 1` and `-pass 2` options, respectively. 
     37* In pass 1, output to a null file descriptor, not an actual file. (This will generate a logfile that ffmpeg needs for the second pass.) 
     38* In pass 1, you need to specify an output format (with `-f`) that matches the output format you will use in pass 2. 
     39* In pass 1, specify the audio codec used in pass 2; in many cases, `-an` in pass 1 will not work. 
     40 
     41{{{ 
     42ffmpeg -i input.mp4 -c:v libaom-av1 -strict -2 -b:v 2M -pass 1 -f matroska /dev/null && \ 
     43ffmpeg -i input.mp4 -c:v libaom-av1 -strict -2 -b:v 2M -pass 2 output.mkv 
     44}}} 
     45 
     46{{{ 
     47#!div style="border: 1px solid #e5e5c7; margin: 1em; background-color: #ffd;" 
     48'''Note:''' Windows users should use `NUL` instead of `/dev/null` and `^` instead of `\`. 
     49}}} 
    3050 
    3151=== Constant Quality ===#constantq