Skip to content
Alkl58 edited this page Sep 8, 2020 · 4 revisions

Welcome to the official AOMedia community wiki!

To view the aom codebase, you can go here

Disclaimer: This is a community driven wiki. This wiki may not represent the AOMedia Alliance.

Get the latest Windows Builds of libaom here:

Table of Contents

  1. Running the encoder
  2. Sample command lines
  3. Common and important command lines
  4. How to make Encoding faster

Running the encoder

This section describes how to run the encoder application aomenc from the command line, including descriptions of the most commonly used input parameters and outputs.

The sample application typically takes the following command line parameters:

Basic Usage: aomenc <options> -o dst_filename src_filename

src_filename is a Y4M file (e.g. 8 bit 4:2:0 planar) containing the video sequence that will be encoded.

The Y4M File can be obtained with e.g. ffmpeg (ffmpeg -i input.mp4 -r 24000/1000 -pix_fmt yuv420p output.y4m) Another option would be directly piping through ffmpeg to aomenc: ffmpeg -i "input.mkv" -pix_fmt yuv420p -f yuv4mpegpipe - | aomenc.exe -

-o dst_filename is the resulting video output of the encoder. The container is typically ivf. E.g. output.ivf

Sample command lines

2-Pass VBR 10bit 23.976fps

1st Pass: aomenc.exe --passes=2 --pass=1 --width=1920 --height=1080 --bit-depth=10 --fps=24000/1001 --target-bitrate=250 --fpf=stats.log --output=NUL input.y4m

2nd Pass: aomenc.exe --passes=2 --pass=2 --width=1920 --height=1080 --bit-depth=10 --fps=24000/1001 --target-bitrate=250 --fpf=stats.log --output=out.ivf input.y4m

1-Pass Constant Quality 10bit 23.976fps

aomenc.exe --passes=1 --bit-depth=10 --fps=24000/1001 --end-usage=q --cq-level=20 --output=out.ivf input.y4m

Common and important command lines

Command Line Description
--help Show usage options and exit
--output=arg Output filename
--passes=arg Number of passes (1/2)
--pass=arg Pass to execute (1/2)
--fpf=arg First pass statistics file name
--width=arg Frame width
--height=arg Frame height
--fps=arg Stream frame rate (rate/scale) e.g. 24000/1001 = 23.976
--bit-depth=arg Bit depth (8, 10, 12)
--end-usage=arg Rate control mode (vbr, cbr, cq, q)
--target-bitrate=arg Bitrate (kbps)
--cq-level=arg Constant/Constrained Quality level
--cpu-used=arg CPU Used (0..9) - Speed/Quality Setting - Recommended: 4 - 0 = slowest - 9 = fastest
--tile-columns=arg Number of tile columns to use, log2
--tile-rows=arg Number of tile rows to use, log2
--aq-mode=arg Adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3: cyclic refresh)

<options> All Encoder Options can be found with --help

How to make Encoding faster

Due to the slow encoding, many people may ask themself, how to improve the encoding time.

Here are some examples how to do so:

  1. --cpu-used=arg The cpu-used setting is a speed setting. With lowering the encoder values encoding will be slower and visual quality will increase at the same bitrate. Recommended: 4 (Range: 0-9)
  2. --tile-columns=arg and --tile-rows=arg - these settings split the video-image into columns and rows. Higher values may improve multi-threading capability and encoding speed, but the video quality decreases slightly and the resulting file size is slightly bigger.
  3. Instead of splitting the video-image into pieces, it's also possible to cut the video file into chunks, encode them parallel and Concatenate them later. ffmpeg Concatenate. The Resulting size may be a little bit bigger, due the fact it may have a little overhead. A tool like NEAV1E, qEncoder or Av1an may also be a viable option.