浏览代码

obs-ffmpeg: Fix nvenc_h264 deprecated message

The encoder name was changed from "nvenc_h264" to "h264_nvenc", and will
throw a warning in the log file if you use the former, so try the latter
first, then the former.
jp9000 9 年之前
父节点
当前提交
cef4cba576
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c

+ 3 - 1
plugins/obs-ffmpeg/obs-ffmpeg-nvenc.c

@@ -272,7 +272,9 @@ static void *nvenc_create(obs_data_t *settings, obs_encoder_t *encoder)
 
 	enc = bzalloc(sizeof(*enc));
 	enc->encoder = encoder;
-	enc->nvenc = avcodec_find_encoder_by_name("nvenc_h264");
+	enc->nvenc = avcodec_find_encoder_by_name("h264_nvenc");
+	if (!enc->nvenc)
+		enc->nvenc = avcodec_find_encoder_by_name("nvenc_h264");
 	enc->first_packet = true;
 
 	blog(LOG_INFO, "---------------------------------");