diff --git a/plugins/obs-ffmpeg/texture-amf.cpp b/plugins/obs-ffmpeg/texture-amf.cpp index 7a698931b..0bdc71cc5 100644 --- a/plugins/obs-ffmpeg/texture-amf.cpp +++ b/plugins/obs-ffmpeg/texture-amf.cpp @@ -991,13 +991,12 @@ try { /* ------------------------------------ */ /* get video info */ - struct obs_video_info ovi; - obs_get_video_info(&ovi); - struct video_scale_info info; - info.format = ovi.output_format; - info.colorspace = ovi.colorspace; - info.range = ovi.range; + video_t *video = obs_encoder_video(enc->encoder); + const struct video_output_info *voi = video_output_get_info(video); + info.format = voi->format; + info.colorspace = voi->colorspace; + info.range = voi->range; if (enc->fallback) { if (enc->codec == amf_codec_type::AVC) @@ -1010,9 +1009,9 @@ try { enc->cx = obs_encoder_get_width(enc->encoder); enc->cy = obs_encoder_get_height(enc->encoder); - enc->amf_frame_rate = AMFConstructRate(ovi.fps_num, ovi.fps_den); - enc->fps_num = (int)ovi.fps_num; - enc->fps_den = (int)ovi.fps_den; + enc->amf_frame_rate = AMFConstructRate(voi->fps_num, voi->fps_den); + enc->fps_num = (int)voi->fps_num; + enc->fps_den = (int)voi->fps_den; enc->full_range = info.range == VIDEO_RANGE_FULL; switch (info.colorspace) {