From cab9e7b45f3c3858a25aee2f610d3b59290ebfda Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 1 Oct 2025 13:56:49 +0200 Subject: [PATCH] vcap/file: set FPS from avg_frame_rate The [file] (URL few commits below) has actually set r_frame_rate as 1/1200k, which causes the libavcodec JPEG decoder crash (received is something like 1792i due to overflow). avg_frame_rate contains 1/25. --- src/video_capture/file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video_capture/file.c b/src/video_capture/file.c index 85c160651..87d063030 100644 --- a/src/video_capture/file.c +++ b/src/video_capture/file.c @@ -695,7 +695,8 @@ static bool setup_video(struct vidcap_state_lavf_decoder *s) { AVStream *st = s->fmt_ctx->streams[s->video_stream_idx]; s->video_desc.width = st->codecpar->width; s->video_desc.height = st->codecpar->height; - s->video_desc.fps = (double)st->r_frame_rate.num / st->r_frame_rate.den; + s->video_desc.fps = + (double) st->avg_frame_rate.num / st->avg_frame_rate.den; s->video_desc.tile_count = 1; if (s->no_decode) { s->video_desc.color_spec =