From 746ee657d70899000daf34730ad15af5c9baac6c Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Wed, 15 Jul 2020 01:27:25 -0700 Subject: [PATCH] FFmpeg: Fix encoding of time base --- CHANGES | 1 + src/feature/ffmpeg/ffmpeg-encoder.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index fb075d3a9..7b5b62412 100644 --- a/CHANGES +++ b/CHANGES @@ -37,6 +37,7 @@ Other fixes: - Core: Ensure ELF regions can be written before trying - Debugger: Don't skip undefined instructions when debugger attached - FFmpeg: Fix some small memory leaks + - FFmpeg: Fix encoding of time base - GB Core: Fix extracting SRAM when none is present - GBA Savedata: Fix extracting save when not yet configured in-game - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) diff --git a/src/feature/ffmpeg/ffmpeg-encoder.c b/src/feature/ffmpeg/ffmpeg-encoder.c index 7f58d28df..04501c901 100644 --- a/src/feature/ffmpeg/ffmpeg-encoder.c +++ b/src/feature/ffmpeg/ffmpeg-encoder.c @@ -365,6 +365,8 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) { encoder->video->height = encoder->height; encoder->video->time_base = (AVRational) { VIDEO_TOTAL_LENGTH * encoder->frameskip, GBA_ARM7TDMI_FREQUENCY }; encoder->video->framerate = (AVRational) { GBA_ARM7TDMI_FREQUENCY, VIDEO_TOTAL_LENGTH * encoder->frameskip }; + encoder->videoStream->time_base = encoder->video->time_base; + encoder->videoStream->avg_frame_rate = encoder->video->framerate; encoder->video->pix_fmt = encoder->pixFormat; encoder->video->gop_size = 60; encoder->video->max_b_frames = 3;