mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-06 07:36:12 -05:00
UI: Add AMD AV1 to simple output mode
This commit is contained in:
@@ -950,6 +950,7 @@ Basic.Settings.Output.Simple.Encoder.Software="Software (x264)"
|
||||
Basic.Settings.Output.Simple.Encoder.Hardware.QSV.H264="Hardware (QSV, H.264)"
|
||||
Basic.Settings.Output.Simple.Encoder.Hardware.AMD.H264="Hardware (AMD, H.264)"
|
||||
Basic.Settings.Output.Simple.Encoder.Hardware.AMD.HEVC="Hardware (AMD, HEVC)"
|
||||
Basic.Settings.Output.Simple.Encoder.Hardware.AMD.AV1="Hardware (AMD, AV1)"
|
||||
Basic.Settings.Output.Simple.Encoder.Hardware.NVENC.H264="Hardware (NVENC, H.264)"
|
||||
Basic.Settings.Output.Simple.Encoder.Hardware.NVENC.AV1="Hardware (NVENC, AV1)"
|
||||
Basic.Settings.Output.Simple.Encoder.Hardware.NVENC.HEVC="Hardware (NVENC, HEVC)"
|
||||
|
||||
@@ -377,6 +377,8 @@ const char *get_simple_output_encoder(const char *encoder)
|
||||
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD_HEVC) == 0) {
|
||||
return "h265_texture_amf";
|
||||
#endif
|
||||
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD_AV1) == 0) {
|
||||
return "av1_texture_amf";
|
||||
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC) == 0) {
|
||||
return EncoderAvailable("jim_nvenc") ? "jim_nvenc"
|
||||
: "ffmpeg_nvenc";
|
||||
@@ -549,6 +551,9 @@ void SimpleOutput::Update()
|
||||
presetType = "NVENCPreset2";
|
||||
#endif
|
||||
|
||||
} else if (strcmp(encoder, SIMPLE_ENCODER_AMD_AV1) == 0) {
|
||||
presetType = "AMDAV1Preset";
|
||||
|
||||
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC_AV1) == 0) {
|
||||
presetType = "NVENCPreset2";
|
||||
|
||||
|
||||
@@ -829,6 +829,7 @@ void OBSBasic::CheckForSimpleModeX264Fallback()
|
||||
bool nve_hevc_supported = false;
|
||||
bool apple_hevc_supported = false;
|
||||
#endif
|
||||
bool amd_av1_supported = false;
|
||||
bool apple_supported = false;
|
||||
bool changed = false;
|
||||
size_t idx = 0;
|
||||
@@ -847,6 +848,8 @@ void OBSBasic::CheckForSimpleModeX264Fallback()
|
||||
else if (strcmp(id, "ffmpeg_hevc_nvenc") == 0)
|
||||
nve_hevc_supported = true;
|
||||
#endif
|
||||
else if (strcmp(id, "av1_texture_amf") == 0)
|
||||
amd_av1_supported = true;
|
||||
else if (strcmp(id,
|
||||
"com.apple.videotoolbox.videoencoder.ave.avc") ==
|
||||
0)
|
||||
@@ -898,6 +901,12 @@ void OBSBasic::CheckForSimpleModeX264Fallback()
|
||||
name = SIMPLE_ENCODER_X264;
|
||||
return false;
|
||||
}
|
||||
} else if (strcmp(name, SIMPLE_ENCODER_AMD_AV1) == 0) {
|
||||
if (!amd_av1_supported) {
|
||||
changed = true;
|
||||
name = SIMPLE_ENCODER_X264;
|
||||
return false;
|
||||
}
|
||||
} else if (strcmp(name, SIMPLE_ENCODER_APPLE_H264) == 0) {
|
||||
if (!apple_supported) {
|
||||
changed = true;
|
||||
|
||||
@@ -70,6 +70,7 @@ class OBSBasicStats;
|
||||
#define SIMPLE_ENCODER_NVENC_HEVC "nvenc_hevc"
|
||||
#define SIMPLE_ENCODER_AMD "amd"
|
||||
#define SIMPLE_ENCODER_AMD_HEVC "amd_hevc"
|
||||
#define SIMPLE_ENCODER_AMD_AV1 "amd_av1"
|
||||
#define SIMPLE_ENCODER_APPLE_H264 "apple_h264"
|
||||
#define SIMPLE_ENCODER_APPLE_HEVC "apple_hevc"
|
||||
|
||||
|
||||
@@ -1729,6 +1729,8 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
|
||||
"NVENCPreset2");
|
||||
const char *amdPreset =
|
||||
config_get_string(main->Config(), "SimpleOutput", "AMDPreset");
|
||||
const char *amdAV1Preset = config_get_string(
|
||||
main->Config(), "SimpleOutput", "AMDAV1Preset");
|
||||
const char *custom = config_get_string(main->Config(), "SimpleOutput",
|
||||
"x264Settings");
|
||||
const char *recQual =
|
||||
@@ -1748,6 +1750,7 @@ void OBSBasicSettings::LoadSimpleOutputSettings()
|
||||
curQSVPreset = qsvPreset;
|
||||
curNVENCPreset = nvPreset;
|
||||
curAMDPreset = amdPreset;
|
||||
curAMDAV1Preset = amdAV1Preset;
|
||||
|
||||
audioBitrate = FindClosestAvailableAACBitrate(audioBitrate);
|
||||
|
||||
@@ -3491,6 +3494,8 @@ void OBSBasicSettings::SaveOutputSettings()
|
||||
#endif
|
||||
else if (encoder == SIMPLE_ENCODER_AMD)
|
||||
presetType = "AMDPreset";
|
||||
else if (encoder == SIMPLE_ENCODER_AMD_AV1)
|
||||
presetType = "AMDAV1Preset";
|
||||
else if (encoder == SIMPLE_ENCODER_APPLE_H264
|
||||
#ifdef ENABLE_HEVC
|
||||
|| encoder == SIMPLE_ENCODER_APPLE_HEVC
|
||||
@@ -4776,6 +4781,10 @@ void OBSBasicSettings::FillSimpleRecordingValues()
|
||||
ui->simpleOutRecEncoder->addItem(
|
||||
ENCODER_STR("Hardware.AMD.H264"),
|
||||
QString(SIMPLE_ENCODER_AMD));
|
||||
if (EncoderAvailable("av1_texture_amf"))
|
||||
ui->simpleOutRecEncoder->addItem(
|
||||
ENCODER_STR("Hardware.AMD.AV1"),
|
||||
QString(SIMPLE_ENCODER_AMD_AV1));
|
||||
if (EncoderAvailable("com.apple.videotoolbox.videoencoder.ave.avc")
|
||||
#ifndef __aarch64__
|
||||
&& os_get_emulation_status() == true
|
||||
@@ -4892,6 +4901,15 @@ void OBSBasicSettings::SimpleStreamingEncoderChanged()
|
||||
ui->simpleOutAdvanced->setVisible(false);
|
||||
ui->simpleOutPreset->setVisible(false);
|
||||
ui->simpleOutPresetLabel->setVisible(false);
|
||||
|
||||
} else if (encoder == SIMPLE_ENCODER_AMD_AV1) {
|
||||
ui->simpleOutPreset->addItem("Speed", "speed");
|
||||
ui->simpleOutPreset->addItem("Balanced", "balanced");
|
||||
ui->simpleOutPreset->addItem("Quality", "quality");
|
||||
ui->simpleOutPreset->addItem("High Quality", "highQuality");
|
||||
|
||||
defaultPreset = "balanced";
|
||||
preset = curAMDAV1Preset;
|
||||
} else {
|
||||
|
||||
#define PRESET_STR(val) \
|
||||
|
||||
@@ -146,6 +146,7 @@ private:
|
||||
QString curQSVPreset;
|
||||
QString curNVENCPreset;
|
||||
QString curAMDPreset;
|
||||
QString curAMDAV1Preset;
|
||||
|
||||
QString curAdvStreamEncoder;
|
||||
QString curAdvRecordEncoder;
|
||||
|
||||
Reference in New Issue
Block a user