From: Steinar H. Gunderson Date: Mon, 10 Jul 2017 10:07:05 +0000 (+0200) Subject: Fix frame duration calculation in Kaeru; could throw speedcontrol off. X-Git-Tag: 1.6.2~9 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=870d32ed4c8a9ccba8b2a76cad1c6c4d5958b23c;p=nageru Fix frame duration calculation in Kaeru; could throw speedcontrol off. --- diff --git a/kaeru.cpp b/kaeru.cpp index 23b3c87..7bf0ae9 100644 --- a/kaeru.cpp +++ b/kaeru.cpp @@ -82,7 +82,7 @@ void video_frame_callback(FFmpegCapture *video, X264Encoder *x264_encoder, Audio ts.ts.push_back(steady_clock::now()); video_pts = av_rescale_q(video_pts, video_timebase, AVRational{ 1, TIMEBASE }); - int64_t frame_duration = TIMEBASE * video_format.frame_rate_nom / video_format.frame_rate_den; + int64_t frame_duration = TIMEBASE * video_format.frame_rate_den / video_format.frame_rate_nom; x264_encoder->add_frame(video_pts, frame_duration, video->get_current_frame_ycbcr_format().luma_coefficients, video_frame.data + video_offset, ts); } if (audio_frame.len > 0) {