Skip to content

Recommended encoding settings

Flaze edited this page Feb 3, 2023 · 8 revisions

Hardware encoding

Nvidia

Check NVENC compatibility here: https://en.wikipedia.org/wiki/Nvidia_NVENC

Generally, GTX 9xx or newer cards will have HEVC support while GTX 6xx or newer will have only H264 support.

H264:

"Encoder": "h264_nvenc",
"h264_nvenc": {
	"RateControl": "cq",
	"Bitrate": "400M",
	"CQ": 22,
	"Profile": "high",
	"Preset": "p7",
	"AdditionalOptions": ""
}

HEVC:

"Encoder": "hevc_nvenc",
"hevc_nvenc": {
	"RateControl": "cq",
	"Bitrate": "400M",
	"CQ": 24,
	"Preset": "p7",
	"AdditionalOptions": ""
}

Faster presets are not worth using, as they offer next to no performance benefits while significantly decreasing encoding efficiency. Sane values for CQ are from 16 to 30, where lower numbers mean higher quality. If you have a 900 series GPU, you need to use the slow preset for HEVC. Don't change the -b:v parameter - 400mbit is the max that can be set and you should increase CQ instead of decreasing the bitrate cap.

Intel

Check QuickSync compatibility here: https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video#Hardware_decoding_and_encoding

Generally, Skylake or newer will have HEVC support while Sandy Bridge or newer will have only H264 support.

H264:

"Encoder": "h264_qsv",
"h264_qsv": {
	"RateControl": "icq",
	"Bitrate": "10M",
	"Quality": 15,
	"Profile": "high",
	"Preset": "slow",
	"AdditionalOptions": ""
}

HEVC:

"Encoder": "hevc_qsv",
"hevc_qsv": {
	"RateControl": "icq",
	"Bitrate": "10M",
	"Quality": 20,
	"Preset": "slow",
	"AdditionalOptions": ""
}

Presets fast or medium are not worth using, as they offer next to no performance benefits while decreasing encoding efficiency. Sane values for Quality are from 5 to 25, where lower numbers mean higher quality.

AMD

As AMD's encoder is lacking compared to NVIDIA's or Intel's, it is no longer supported. You are required to use software encoding.

Software encoding

It's recommended to only use software encoding if your hardware doesn't support it, or if you have CPU power spare.

H264 (default):

"Encoder": "libx264",
"libx264": {
	"RateControl": "crf",
	"Bitrate": "10M",
	"CRF": 14,
	"Profile": "high",
	"Preset": "faster",
	"AdditionalOptions": ""
}

Presets range from ultrafast to placebo. Slowest sane preset is veryslow, ultrafast preset is only recommended if you need the highest speed possible and don't have any form of hardware encoding. Sane values for CRF are from 8 to 24, where lower numbers mean higher quality.

HEVC:

"Encoder": "libx265",
"libx265": {
	"RateControl": "crf",
	"Bitrate": "10M",
	"CRF": 18,
	"Preset": "fast",
	"AdditionalOptions": ""
}

Presets range from ultrafast to placebo. Slowest sane preset is slow, if you need faster to sustain normal speeds it's better off to use H264 instead. Sane values for CRF are from 10 to 28, where lower numbers mean higher quality.

Audio

AAC (default):

"AudioCodec": "aac",
"aac": {
	"Bitrate": "320k",
	"AdditionalOptions": ""
}

AAC is not a very efficient codec, nonetheless it is widely supported and as such is the default. Sane bitrates range from 128k to 320k.

Opus:

"AudioCodec": "libopus",
"libopus": {
	"RateControl": "vbr",
	"TargetBitrate": "192k",
	"AdditionalOptions": ""
}

Opus is much more efficient than AAC, however it isn't supported by many editing software and you might need to install a third party video player to play this. Sane bitrates range from 64k to 192k (there is almost no benefit from going over 192k, since beatmap audio and hitsounds are usually not very high quality).

Clone this wiki locally