Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Configuration

Xaymar edited this page Oct 26, 2020 · 1 revision

The tool comes with a relatively simple configuration based on the JSON format. Almost every aspect of the tool is configurable.

Paths

paths.ffmpeg

Where to find both the FFmpeg binaries as well as the VMAF model directory.

paths.videos

The location of the video files used as input.

paths.cache

Where to store the intermediate cache videos to speed up the encoding process and waste less energy and time on identical work.

paths.output

The directory to store the resulting .JSON files in that VMAF generates.

Encoders

An object of encoder objects with the structure:

"encoder_name": {
	<options>
}

encoders.<encoder>.enabled

Enable or disable a certain encoder. Enabled encoders will be ignored if they are not supported by the tool or FFmpeg binary.

encoders.<encoder>.pool

The resource pool to put this encoder into in order to prevent

Encoder: libx264

encoders.libx264.cost_scale

encoders.libx264.threads

The number of threads to let libx264 to use. If this is reduced below 32 or increased above 32, the cost for an encode is adjusted by the formula cost *= (32.0 / n), as the original cost measurements were done at 32 threads.

encoders.libx264.presets

encoders.libx264.tunes

encoders.libx264.scenecut

Encoder: h264_nvenc

encoders.h264_nvenc.parallel

The maximum amount of encodes of this type to run in parallel.

encoders.h264_nvenc.gpu

The GPU index to run h264_nvenc on, or -1 to automatically select. You can figure out the proper index with the following FFmpeg command:

ffmpeg -hide_banner -f lavfi -i color=size=64x64:duration=1:rate=30:color=black -c:v h264_nvenc -gpu -2 -an -f null -

encoders.h264_nvenc.presets

Array of arguments to the -preset option.

encoders.h264_nvenc.tunes

Array of arguments to the -tune option, or null if the option should be omitted.

encoders.h264_nvenc.rc-lookahead

Array of arguments to the -rc-lookahead option, which controls the number of frames to look into the future.

encoders.h264_nvenc.bframes

Array of arguments to the -bf option, controlling the maximum amount of B-Frames to insert. If rc-lookahead is set to 0, controls the absolute number of B-Frames to insert.

encoders.h264_nvenc.bframe_reference_mode

Array of arguments to the -b_ref_mode option.

encoders.h264_nvenc.scenecut

Array of boolean options where true enables scenecut if rc-lookahead is greater than 0, and false disables it always.

Videos

An object of video objects with the structure:

"file_base_name": {
	<options>
}

videos.<video>.enabled

Enable or disable a certain video. Missing videos are ignored.

Options

options.transcode.format

The pixel format to transcode to. The current common streaming and VoD format is yuv420p or nv12.

options.transcode.color.matrix

Color Matrix to use for transcoded files.

options.transcode.color.trc

Transfer Characteristics to use for transcoded files.

options.transcode.color.primaries

Color Primaries to use for transcoded files.

options.transcode.color.range

Color range to use for transcoded files.

options.vmaf.model

Model that VMAF is using, relative to the <config.paths.ffmpeg>/vmaf/ directory. May not contain special symbols.

options.vmaf.threads

Number of threads that VMAF is allowed to use.

options.resolutions

Array of resolutions ([Width, Height]) to transcode to. Only the first element of the inner array is used, the height is calculated from the input video's aspect ratio.

options.framerate_scalings

Array of numbers to scale the framerate by. Values should be kept below 1.0, as values above 1.0 simply introduce duplicated frames and do not magically generate new information.

options.bitrates

Array of numbers to use as possible bitrates.

options.keyframeinterval

Array of numbers to multiply with the framerate to determine the keyframe interval with.