You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
lavc/ratecontrol: use AVCodecContext.framerate when available
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user