You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/librav1e: Use the framerate when available for ratecontrol
Rav1e currently uses the time base given to it only for ratecontrol... where the inverse is taken and used as a framerate. So, do what we do in other wrappers and use the framerate if we can. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
@@ -186,10 +186,21 @@ static av_cold int librav1e_encode_init(AVCodecContext *avctx)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
rav1e_config_set_time_base(cfg, (RaRational) {
|
||||
avctx->time_base.num * avctx->ticks_per_frame,
|
||||
avctx->time_base.den
|
||||
});
|
||||
/*
|
||||
* Rav1e currently uses the time base given to it only for ratecontrol... where
|
||||
* the inverse is taken and used as a framerate. So, do what we do in other wrappers
|
||||
* and use the framerate if we can.
|
||||
*/
|
||||
if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
|
||||
rav1e_config_set_time_base(cfg, (RaRational) {
|
||||
avctx->framerate.den, avctx->framerate.num
|
||||
});
|
||||
} else {
|
||||
rav1e_config_set_time_base(cfg, (RaRational) {
|
||||
avctx->time_base.num * avctx->ticks_per_frame,
|
||||
avctx->time_base.den
|
||||
});
|
||||
}
|
||||
|
||||
if (avctx->flags & AV_CODEC_FLAG_PASS2) {
|
||||
if (!avctx->stats_in) {
|
||||
|
Reference in New Issue
Block a user