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.
This commit is contained in:
Ryan Foster 2018-05-27 00:45:05 -04:00
parent 32d2aeb4ee
commit 1f592d12aa

View File

@ -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;