From f29f28640213018bed6ef3e8f89bc8898bce56d8 Mon Sep 17 00:00:00 2001 From: vividnightmare Date: Mon, 6 Apr 2015 11:41:42 -0700 Subject: [PATCH] obs-ffmpeg: Only set x264 opts if actually x264 Check the actual name of the codec before applying an x264-specific preset so we don't encounter an "Invalid argument" error when using other h264 encoders in FFmpeg (such as NVEnc). Closes jp9000/obs-studio#412 --- plugins/obs-ffmpeg/obs-ffmpeg-output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-output.c b/plugins/obs-ffmpeg/obs-ffmpeg-output.c index d07f8d133..7b24a0d27 100644 --- a/plugins/obs-ffmpeg/obs-ffmpeg-output.c +++ b/plugins/obs-ffmpeg/obs-ffmpeg-output.c @@ -150,7 +150,7 @@ static bool open_video_codec(struct ffmpeg_data *data) char **opts = strlist_split(data->config.video_settings, ' ', false); int ret; - if (data->vcodec->id == AV_CODEC_ID_H264) + if (strcmp(data->vcodec->name, "libx264") == 0) av_opt_set(context->priv_data, "preset", "veryfast", 0); if (opts) {