[FFmpeg-devel] [PATCH] doc/examples/vaapi_transcode: fix null framerate

Anton Khirnov anton at khirnov.net
Fri Mar 31 18:04:35 EEST 2023


Quoting jianfeng.zheng (2023-03-30 10:28:27)
> When framerate in codec layer is null, guess from stream.
> 
> Signed-off-by: jianfeng.zheng <jianfeng.zheng at mthreads.com>
> ---
>  doc/examples/vaapi_transcode.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/doc/examples/vaapi_transcode.c b/doc/examples/vaapi_transcode.c
> index 8367cb3040..cdcc4e263a 100644
> --- a/doc/examples/vaapi_transcode.c
> +++ b/doc/examples/vaapi_transcode.c
> @@ -103,6 +103,10 @@ static int open_input_file(const char *filename)
>          fprintf(stderr, "Failed to open codec for decoding. Error code: %s\n",
>                  av_err2str(ret));
>  
> +    if (decoder_ctx->framerate.num == 0 &&
> +			video->r_frame_rate.num > 0 && video->r_frame_rate.den > 0)
> +        decoder_ctx->framerate = video->r_frame_rate;

This field is to be set by decoder, not the API caller.

-- 
Anton Khirnov


More information about the ffmpeg-devel mailing list