Skip to content

Commit

Permalink
UI: Use new NVENC encoder ids
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Apr 21, 2024
1 parent 5837c79 commit de34c28
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
14 changes: 8 additions & 6 deletions UI/window-basic-main-outputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -569,15 +569,17 @@ const char *get_simple_output_encoder(const char *encoder)
} 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";
return EncoderAvailable("obs_nvenc_h264_tex")
? "obs_nvenc_h264_tex"
: "ffmpeg_nvenc";
#ifdef ENABLE_HEVC
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC_HEVC) == 0) {
return EncoderAvailable("jim_hevc_nvenc") ? "jim_hevc_nvenc"
: "ffmpeg_hevc_nvenc";
return EncoderAvailable("obs_nvenc_hevc_tex")
? "obs_nvenc_hevc_tex"
: "ffmpeg_hevc_nvenc";
#endif
} else if (strcmp(encoder, SIMPLE_ENCODER_NVENC_AV1) == 0) {
return "jim_av1_nvenc";
return "obs_nvenc_av1_tex";
} else if (strcmp(encoder, SIMPLE_ENCODER_APPLE_H264) == 0) {
return "com.apple.videotoolbox.videoencoder.ave.avc";
#ifdef ENABLE_HEVC
Expand Down Expand Up @@ -1750,7 +1752,7 @@ void AdvancedOutput::UpdateStreamSettings()
blog(LOG_WARNING, "User is ignoring service settings.");
}

if (dynBitrate && astrcmpi(streamEncoder, "jim_nvenc") == 0)
if (dynBitrate && strstr(streamEncoder, "nvenc") != nullptr)
obs_data_set_bool(settings, "lookahead", false);

video_t *video = obs_get_video();
Expand Down
7 changes: 4 additions & 3 deletions UI/window-basic-settings-stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1463,8 +1463,9 @@ bool OBSBasicSettings::ServiceAndACodecCompatible()
/* we really need a way to find fallbacks in a less hardcoded way. maybe. */
static QString get_adv_fallback(const QString &enc)
{
if (enc == "jim_hevc_nvenc" || enc == "jim_av1_nvenc")
return "jim_nvenc";
if (enc == "obs_nvenc_hevc_tex" || enc == "obs_nvenc_av1_tex" ||
enc == "jim_hevc_nvenc" || enc == "jim_av1_nvenc")
return "obs_nvenc_h264_tex";
if (enc == "h265_texture_amf" || enc == "av1_texture_amf")
return "h264_texture_amf";
if (enc == "com.apple.videotoolbox.videoencoder.ave.hevc")
Expand Down Expand Up @@ -1720,7 +1721,7 @@ void OBSBasicSettings::ResetEncoders(bool streamOnly)
ui->simpleOutStrEncoder->addItem(
ENCODER_STR("Hardware.NVENC.H264"),
QString(SIMPLE_ENCODER_NVENC));
if (service_supports_encoder(vcodecs, "jim_av1_nvenc"))
if (service_supports_encoder(vcodecs, "obs_nvenc_av1_tex"))
ui->simpleOutStrEncoder->addItem(
ENCODER_STR("Hardware.NVENC.AV1"),
QString(SIMPLE_ENCODER_NVENC_AV1));
Expand Down
2 changes: 1 addition & 1 deletion UI/window-basic-settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5330,7 +5330,7 @@ void OBSBasicSettings::FillSimpleRecordingValues()
ui->simpleOutRecEncoder->addItem(
ENCODER_STR("Hardware.NVENC.H264"),
QString(SIMPLE_ENCODER_NVENC));
if (EncoderAvailable("jim_av1_nvenc"))
if (EncoderAvailable("obs_nvenc_av1_tex"))
ui->simpleOutRecEncoder->addItem(
ENCODER_STR("Hardware.NVENC.AV1"),
QString(SIMPLE_ENCODER_NVENC_AV1));
Expand Down

0 comments on commit de34c28

Please sign in to comment.