瀏覽代碼

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.
Ryan Foster 7 年之前
父節點
當前提交
1f592d12aa
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c

+ 1 - 0
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;