Browse Source

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
vividnightmare 10 years ago
parent
commit
f29f286402
1 changed files with 1 additions and 1 deletions
  1. 1 1
      plugins/obs-ffmpeg/obs-ffmpeg-output.c

+ 1 - 1
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) {