Skip to content

Advanced Command Line Options

Alkl58 edited this page Sep 8, 2020 · 3 revisions

General / Global Options

Command Description Example Usage
--help Show usage options and exit --help
--output Output filename --output=encode.ivf
--passes Number of passes (1/2) --passes=2
--pass Pass to execute (1/2) --passes=2 --pass=1
--fpf First pass statistics file - needed for both passes --fpf=firstpass.log
--limit Stop encoding after n input frames --limit=100
--skip Skip the first n input frames --skip=50
--good Use Good Quality Deadline --good
--rt Use Realtime Quality Deadline --rt
--threads Max number of threads to use. --threads=4
--width Frame width --width=1920
--height Frame height --height=1080
--stereo-mode Stereo 3D video format - mono, left-right, bottom-top, top-bottom, right-left --stereo-mode=mono
--fps Stream frame rate (rate/scale) --fps=24000/1001 (=23.976)
--bit-depth Bit depth for codec - 8, 10, 12 - aomenc can convert 8bit to 10bit or 12bit, not the other way around --bit-depth=10
--lag-in-frames If set, this value allows the encoder to consume a number of input frames before producing output frames. This allows the encoder to base decisions for the current frame on future frames. This does increase the latency of the encoding pipeline, so it is not appropriate in all situations (ex: realtime encoding). Note that this is a maximum value -- the encoder may produce frames sooner than the given limit. Set this value to 0 to disable this feature. --lag-in-frames=0
--large-scale-tile Large scale tile coding (0: off (default), 1: on (ivf output only)) --large-scale-tile=0
--monochrome Monochrome video (no chroma planes) --monochrome
--full-still-picture-hdr Use full header for still picture --full-still-picture-hdr

Rate Control Options

Command Description
--drop-frame Temporal resampling allows the codec to "drop" frames as a strategy to meet its target data rate. This can cause temporal discontinuities in the encoded video, which may appear as stuttering during playback. This trade-off is often acceptable, but for many applications is not. It can be disabled in these cases. This threshold is described as a percentage of the target data buffer. When the data buffer falls below this percentage of fullness, a dropped frame is indicated.
--resize-mode Spatial resampling allows the codec to compress a lower resolution version of the frame, which is then upscaled by the decoder to the correct presentation resolution. This increases visual quality at low data rates, at the expense of CPU time on the encoder/decoder.
--resize-denominator Frame resize denominator. The denominator for resize to use, assuming 8 as the numerator. Valid denominators are 8 - 16 for now.
--resize-kf-denominator Keyframe resize denominator. The denominator for resize to use, assuming 8 as the numerator. Valid denominators are 8 - 16 for now.
--superres-mode Frame super-resolution scaling mode. Similar to spatial resampling, frame super-resolution integrates upscaling after the encode/decode process. Taking control of upscaling and using restoration filters should allow it to outperform normal resizing. (0: SUPERRES_NONE, 1: SUPERRES_FIXED, 2: SUPERRES_RANDOM, 3:S UPERRES_QTHRESH)
--superres-denominator Frame super-resolution denominator. The denominator for superres to use. If fixed it will only change if the cumulative scale change over resizing and superres is greater than 1/2; this forces superres to reduce scaling. Valid denominators are 8 to 16. Used only by SUPERRES_FIXED.
--superres-kf-denominator Keyframe super-resolution denominator. Similar to --superres-denominator
--superres-qthresh Frame super-resolution q threshold. The q level threshold after which superres is used. Valid values are 1 to 63. Used only by SUPERRES_QTHRESH
--superres-kf-qthresh Keyframe super-resolution q threshold. Similar to --superres-qthresh
--end-usage Rate control mode (vbr, cbr, cq, q) (cq = Constrained Quality (CQ); q = Constant Quality (Q); cbr = Constant Bit Rate; vbr = Variable Bit Rate)
--target-bitrate Target Bitrate, in kilobits per second. (kbps)
--min-q Minimum (Best Quality) Quantizer.
--max-q Maximum (Worst Quality) Quantizer.
--undershoot-pct Rate control adaptation undershoot control. This value, expressed as a percentage of the target bitrate, controls the maximum allowed adaptation speed of the codec. This factor controls the maximum amount of bits that can be subtracted from the target bitrate in order to compensate for prior overshoot. Valid values in the range 0-1000.
--overshoot-pct Rate control adaptation overshoot control. This value, expressed as a percentage of the target bitrate, controls the maximum allowed adaptation speed of the codec. This factor controls the maximum amount of bits that can be added to the target bitrate in order to compensate for prior undershoot. Valid values in the range 0-1000.
--buf-sz Decoder Buffer Size. This value indicates the amount of data that may be buffered by the decoding application. Note that this value is expressed in units of time (milliseconds). For example, a value of 5000 indicates that the client will buffer (at least) 5000ms worth of encoded data.
--buf-initial-sz Decoder Buffer Initial Size. This value indicates the amount of data that will be buffered by the decoding application prior to beginning playback. This value is expressed in units of time (milliseconds).
--buf-optimal-sz Decoder Buffer Optimal Size. This value indicates the amount of data that the encoder should try to maintain in the decoder's buffer. This value is expressed in units of time (milliseconds).

Twopass Rate Control Options

Command Description Example Usage
--bias-pct Two-pass mode CBR/VBR bias. Bias, expressed on a scale of 0 to 100, for determining target size for the current frame. The value 0 indicates the optimal CBR mode value should be used. The value 100 indicates the optimal VBR mode value should be used. Values in between indicate which way the encoder should "lean." --bias-pct=60
--minsection-pct Two-pass mode per-GOP minimum bitrate. This value, expressed as a percentage of the target bitrate, indicates the minimum bitrate to be used for a single GOP (aka "section") --minsection-pct=20
--maxsection-pct Two-pass mode per-GOP maximum bitrate. This value, expressed as a percentage of the target bitrate, indicates the maximum bitrate to be used for a single GOP (aka "section") --maxsection-pct=70

Keyframe Placement Options

Command Description Example Usage
--enable-fwd-kf Enable forward reference keyframes. This value indicates whether the encoder should place keyframes at a fixed interval, or determine the optimal placement automatically. --enable-fwd-kf=1
--kf-min-dist Minimum keyframe interval (frames). This value, expressed as a number of frames, prevents the encoder from placing a keyframe nearer than kf_min_dist to the previous keyframe. Set kf_min_dist equal to kf_max_dist for a fixed interval. --kf-min-dist=100 (100frames/25fps=4s)
--kf-max-dist Maximum keyframe interval (frames). A value of 0 implies all frames will be keyframes. --kf-max-dist=1000 (1000frames/25fps=40s)
--disable-kf Disable keyframe placement. --disable-kf

AV1 Specific Options

Command Description Example Usage
--cpu-used Speed setting (0..5 in good mode, 6..8 in realtime mode) --cpu-used=3
--auto-alt-ref Enable automatic alt reference frames. --auto-alt-ref=0
--sharpness Loop filter sharpness (0..7) --sharpness=2
--static-thresh Motion detection threshold
--row-mt Enable row based multi-threading (0: off, 1: on (default)) --row-mt=1
--tile-columns Number of tile columns to use, log2 --tile-columns=2 (log2 of 2 = 4)
--tile-rows Number of tile rows to use, log2 --tile-rows=1 (log2 of 1 = 2)
--enable-tpl-model RDO based on frame temporal dependency (0: off, 1: backward source based). This is required for deltaq mode. --enable-tpl-model=1
--arnr-maxframes AltRef max frames (0..15) --arnr-maxframes=8
--arnr-strength AltRef filter strength (0..6) --arnr-strength=3
--tune Distortion metric tuned with psnr, ssim, vmaf_with_preprocessing, vmaf_without_preprocessing, vmaf --tune=ssim
--cq-level Constant OR Constrained Quality level (set with --end-usage) --cq-level=30
--max-intra-rate Max I-frame bitrate (pct). Maximum Percentage of the Target Bitrate given to I-Frames. --max-intra-rate=80
--max-inter-rate Max P-frame bitrate (pct). Maximum Percentage of the Target Bitrate given to P-Frames. --max-inter-rate=50
--gf-cbr-boost Boost for Golden Frame in CBR mode (pct) --gf-cbr-boost=80
--lossless Lossless mode (0: false (default), 1: true) --lossless=0
--sframe-dist S-Frame interval (frames) --sframe-dist=15
--sframe-mode S-Frame insertion mode (1..2) - useful for Livestreaming --sframe-mode=0