[FFmpeg-cvslog] lavc/ratecontrol: use AVCodecContext.framerate when available
Anton Khirnov
git at videolan.org
Mon May 15 11:36:44 EEST 2023
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu May 4 10:59:18 2023 +0200| [dc20baa0491d190a68d73f4da931205490e344bb] | committer: Anton Khirnov
lavc/ratecontrol: use AVCodecContext.framerate when available
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc20baa0491d190a68d73f4da931205490e344bb
---
libavcodec/ratecontrol.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index 6a40f9cbdc..890ae33cb3 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -57,6 +57,9 @@ void ff_write_pass1_stats(MpegEncContext *s)
static double get_fps(AVCodecContext *avctx)
{
+ if (avctx->framerate.num > 0 && avctx->framerate.den > 0)
+ return av_q2d(avctx->framerate);
+
return 1.0 / av_q2d(avctx->time_base) / FFMAX(avctx->ticks_per_frame, 1);
}
More information about the ffmpeg-cvslog
mailing list