Opened 4 months ago

Last modified 3 months ago

#10150 open defect

Variable framerate with a maximum value

Reported by: Zoont Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: fps framerate vfr cfr vsync
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
I have been using the -fps_mode option together with -fps_max to to allow my videos to have variable framerate while at the same time limiting it to 30 fps, similar to how handbrake have a peak framerate setting. But now when I do that it gives this error message "One of -r/-fpsmax was specified together a non-CFR -vsync/-fps_mode. This is contradictory.". I found out that this was a recent change, specifically This commit on git master. The description of this commit talks about how -r should always give constant framerate but it doesn't talk about -fpsmax. If this is intentional I would like to know how to achieve something like handbrake's peak framerate option with ffmpeg with this new restriction. Thanks in advance!

How to reproduce:

% ffmpeg -i input -fps_mode vfr -fpsmax 30 -c:v libx264 -crf 20 -c:a copy output
ffmpeg version git-master
built on 22/1/2023

Change History (2)

comment:1 by Balling, 4 months ago

Status: newopen

I propose to introduce -allowrvfr to bypass

            av_log(NULL, AV_LOG_FATAL, "One of -r/-fpsmax was specified "
                   "together a non-CFR -vsync/-fps_mode. This is contradictory.\n");

comment:2 by elenril, 3 months ago

Are you entirely sure this worked as you wanted? I see no indication that -fpsmax was ever intended to work with VFR. As per the manpage:

-fpsmax[:stream_specifier] fps (output,per-stream)

Set maximum frame rate (Hz value, fraction or abbreviation).

Clamps output frame rate when output framerate is auto-set and is higher than this value. Useful in batch processing or when input framerate is wrongly detected as very high. It cannot be set together with "-r". It is ignored during streamcopy.

In other words, it affects the way the output framerate is selected, but there still is a fixed output framerate.

Note: See TracTickets for help on using tickets.