From 1f592d12aae7181b54e886ffe4a33ff9c29b147e Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Sun, 27 May 2018 00:45:05 -0400 Subject: [PATCH] obs-ffmpeg: Set average framerate in video stream This commit fixes an issue where videos created with OBS will appear as having 1000 FPS in some media players. --- plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c b/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c index 755b67c2f..b3c5c8857 100644 --- a/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c +++ b/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c @@ -316,6 +316,7 @@ static void create_video_stream(struct ffmpeg_mux *ffm) (AVRational){ffm->params.fps_den, ffm->params.fps_num}; ffm->video_stream->time_base = context->time_base; + ffm->video_stream->avg_frame_rate = av_inv_q(context->time_base); if (ffm->output->oformat->flags & AVFMT_GLOBALHEADER) context->flags |= CODEC_FLAG_GLOBAL_H;