[FFmpeg-devel] [PATCH] Fix wrong time_base bug

Anton Khirnov anton at khirnov.net
Sun Mar 14 13:14:29 EET 2021


Quoting Donough Liu (2021-03-12 18:47:09)
> Set time_base to inv of frame rate is only valid when input video have fixed frame rate.
> 
> Signed-off-by: Donough Liu <donoughliu at gmail.com>
> ---
>  doc/examples/transcoding.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c
> index 5aff08c135..d6fed63421 100644
> --- a/doc/examples/transcoding.c
> +++ b/doc/examples/transcoding.c
> @@ -170,7 +170,7 @@ static int open_output_file(const char *filename)
>                  else
>                      enc_ctx->pix_fmt = dec_ctx->pix_fmt;
>                  /* video time_base can be set to whatever is handy and supported by encoder */
> -                enc_ctx->time_base = av_inv_q(dec_ctx->framerate);
> +                enc_ctx->time_base = dec_ctx->time_base;

This is wrong, the use of time_base for decoding is deprecated.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list