From 6851f2321a2d40ef278ef786e0e15407fd7052d3 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 21 Jul 2019 13:07:30 +0200 Subject: [PATCH] encoders/generic: Set the time base correctly There is a small but important difference in the way OBS Studio and FFmpeg handle the FPS time base. This change fixes the problem and makes all encoders go back to sanity. --- source/encoders/generic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/encoders/generic.cpp b/source/encoders/generic.cpp index 94314bd..05fa0f9 100644 --- a/source/encoders/generic.cpp +++ b/source/encoders/generic.cpp @@ -454,8 +454,8 @@ encoder::generic::generic(obs_data_t* settings, obs_encoder_t* encoder) } // Framerate - this->context->time_base.num = voi->fps_num; - this->context->time_base.den = voi->fps_den; + this->context->time_base.num = voi->fps_den; + this->context->time_base.den = voi->fps_num; this->context->ticks_per_frame = 1; } else if (this->codec->type == AVMEDIA_TYPE_AUDIO) { }