LinuxCommandLibrary

avifenc

AV1 Image File Format (AVIF) encoder.

TLDR

Convert a specific PNG image to AVIF

$ avifenc [path/to/input.png] [path/to/output.avif]
copy


Encode with a specific speed (6=default, 0=slowest and 10=fastest)
$ avifenc --speed [2] [path/to/input.png] [path/to/output.avif]
copy

Help

Syntax: avifenc [options] input.[jpg|jpeg|png|y4m] output.avif 
Options:
    -h,--help                         : Show syntax help 
    -V,--version                      : Show the version number 
    -j,--jobs J                       : Number of jobs (worker threads, default: 1. Use "all" to use all available cores) 
    -o,--output FILENAME              : Instead of using the last filename given as output, use this filename 
    -l,--lossless                     : Set all defaults to encode losslessly, and emit warnings when settings/input don't allow for it 
    -d,--depth D                      : Output depth [8,10,12]. (JPEG/PNG only; For y4m or stdin, depth is retained) 
    -y,--yuv FORMAT                   : Output format [default=auto, 444, 422, 420, 400]. Ignored for y4m or stdin (y4m format is retained) 
                                        For JPEG, auto honors the JPEG's internal format, if possible. For all other cases, auto defaults to 444 
    -p,--premultiply                  : Premultiply color by the alpha channel and signal this in the AVIF 
    --stdin                           : Read y4m frames from stdin instead of files; no input filenames allowed, must set before offering output filename 
    --cicp,--nclx P/T/M               : Set CICP values (nclx colr box) (3 raw numbers, use -r to set range flag) 
                                        P = color primaries 
                                        T = transfer characteristics 
                                        M = matrix coefficients 
                                        (use 2 for any you wish to leave unspecified) 
    -r,--range RANGE                  : YUV range [limited or l, full or f]. (JPEG/PNG only, default: full; For y4m or stdin, range is retained) 
    --min Q                           : Set min quantizer for color (0-63, where 0 is lossless) 
    --max Q                           : Set max quantizer for color (0-63, where 0 is lossless) 
    --minalpha Q                      : Set min quantizer for alpha (0-63, where 0 is lossless) 
    --maxalpha Q                      : Set max quantizer for alpha (0-63, where 0 is lossless) 
    --tilerowslog2 R                  : Set log2 of number of tile rows (0-6, default: 0) 
    --tilecolslog2 C                  : Set log2 of number of tile columns (0-6, default: 0) 
    -g,--grid MxN                     : Encode a single-image grid AVIF with M cols & N rows. Either supply MxN identical W/H/D images, or a single 
                                        image that can be evenly split into the MxN grid and follow AVIF grid image restrictions. The grid will adopt 
                                        the color profile of the first image supplied. 
    -s,--speed S                      : Encoder speed (0-10, slowest-fastest, 'default' or 'd' for codec internal defaults. default speed: 6) 
    -c,--codec C                      : AV1 codec to use (choose from versions list below) 
    --exif FILENAME                   : Provide an Exif metadata payload to be associated with the primary item 
    --xmp FILENAME                    : Provide an XMP metadata payload to be associated with the primary item 
    --icc FILENAME                    : Provide an ICC profile payload to be associated with the primary item 
    -a,--advanced KEY[=VALUE]         : Pass an advanced, codec-specific key/value string pair directly to the codec. avifenc will warn on any not used by the codec. 
    --duration D                      : Set all following frame durations (in timescales) to D; default 1. Can be set multiple times (before supplying each filename) 
    --timescale,--fps V               : Set the timescale to V. If all frames are 1 timescale in length, this is equivalent to frames per second (Default: 30) 
                                        If neither duration nor timescale are set, avifenc will attempt to use the framerate stored in a y4m header, if present. 
    -k,--keyframe INTERVAL            : Set the forced keyframe interval (maximum frames between keyframes). Set to 0 to disable (default). 
    --ignore-icc                      : If the input file contains an embedded ICC profile, ignore it (no-op if absent) 
    --pasp H,V                        : Add pasp property (aspect ratio). H=horizontal spacing, V=vertical spacing 
    --crop CROPX,CROPY,CROPW,CROPH    : Add clap property (clean aperture), but calculated from a crop rectangle 
    --clap WN,WD,HN,HD,HON,HOD,VON,VOD: Add clap property (clean aperture). Width, Height, HOffset, VOffset (in num/denom pairs) 
    --irot ANGLE                      : Add irot property (rotation). [0-3], makes (90 * ANGLE) degree rotation anti-clockwise 
    --imir MODE                       : Add imir property (mirroring). 0=top-to-bottom, 1=left-to-right 

aom-specific advanced options:
    1. = applies to both the color (YUV) planes and the alpha plane (if present). 
    2. color:= or c:= applies only to the color (YUV) planes. 
    3. alpha:= or a:= applies only to the alpha plane (if present). 
       Since the alpha plane is encoded as a monochrome image, the options that refer to the chroma planes, 
       such as enable-chroma-deltaq=B, should not be used with the alpha plane. In addition, the film grain 
       options are unlikely to make sense for the alpha plane. 

    When used with libaom 3.0.0 or later, any key-value pairs supported by the aom_codec_set_option() function 
    can be used. When used with libaom 2.0.x or older, the following key-value pairs can be used: 

    aq-mode=M                         : Adaptive quantization mode (0: off (default), 1: variance, 2: complexity, 3: cyclic refresh) 
    cq-level=Q                        : Constant/Constrained Quality level (0-63, end-usage must be set to cq or q) 
    enable-chroma-deltaq=B            : Enable delta quantization in chroma planes (0: disable (default), 1: enable) 
    end-usage=MODE                    : Rate control mode (vbr, cbr, cq, or q) 
    sharpness=S                       : Bias towards block sharpness in rate-distortion optimization of transform coefficients (0-7, default: 0) 
    tune=METRIC                       : Tune the encoder for distortion metric (psnr or ssim, default: psnr) 
    film-grain-test=TEST              : Film grain test vectors (0: none (default), 1: test-1  2: test-2, ... 16: test-16) 
    film-grain-table=FILENAME         : Path to file containing film grain parameters 

Version: 0.10.1 (dav1d [dec]:1.0.0, aom [enc/dec]:v3.4.0, rav1e [enc]:0.4.1 (v0.4.1), svt [enc]:v1.1.0-dirty) 
libyuv : available (1813) 

Copied to clipboard