mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-16 20:07:04 +00:00
lavc/libx264: Use avctx->framerate first for frame rate setting
perfer avctx->framerate first than use avctx->time_base when setting the frame rate to encoder. 1/time_base is not the average frame rate if the frame rate is not constant. In this case, we need to setting avctx->framerate and avctx->time_base both, but avctx->framerate not equal to 1/(avctx->time_base). Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
parent
ab648f79c8
commit
1e6338c2da
@ -821,8 +821,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
x4->params.vui.i_sar_height = sh;
|
x4->params.vui.i_sar_height = sh;
|
||||||
x4->params.i_timebase_den = avctx->time_base.den;
|
x4->params.i_timebase_den = avctx->time_base.den;
|
||||||
x4->params.i_timebase_num = avctx->time_base.num;
|
x4->params.i_timebase_num = avctx->time_base.num;
|
||||||
x4->params.i_fps_num = avctx->time_base.den;
|
if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
|
||||||
x4->params.i_fps_den = avctx->time_base.num * avctx->ticks_per_frame;
|
x4->params.i_fps_num = avctx->framerate.num;
|
||||||
|
x4->params.i_fps_den = avctx->framerate.den;
|
||||||
|
} else {
|
||||||
|
x4->params.i_fps_num = avctx->time_base.den;
|
||||||
|
x4->params.i_fps_den = avctx->time_base.num * avctx->ticks_per_frame;
|
||||||
|
}
|
||||||
|
|
||||||
x4->params.analyse.b_psnr = avctx->flags & AV_CODEC_FLAG_PSNR;
|
x4->params.analyse.b_psnr = avctx->flags & AV_CODEC_FLAG_PSNR;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user