Closed CrypticSignal closed 4 weeks ago
Hi, thanks for the heads up. I think we can change both to 25 no problem, and if you open a PR we'll welcome it.
For more detail on what's going on, that -r
sets the input framerate, which tells ffmpeg how to interpret the timestamps in the input file. In this case it doesn't really matter what we set it to, as long as we set both to the same number - that will make the timestamps match and ffmpeg's framesync mechanism will feed both frames to libvmaf correctly. The VMAF results are the same whether you set both to -r 24
or -r 25
.
@nilfm99 So the value of -r
doesn't need to match the framerate of the input video? We can pick any value for the framerate, as long as the same value is used for both the reference and distorted file?
If that's the case, it's fine to leave the documentation as-is.
I'm wondering if there is a benefit to picking a particular framerate value in terms of how quickly the ffmpeg vmaf calculation process takes to complete, or does the value of the input framerates have no effect on this?
I don't think it has any impact on speed at all - if the two inputs have the same number of frames, any value will do as long as it's the same. The frames will get matched up and passed to libvmaf, where the bulk of the computation happens. The same frames will be passed regardless of the -r
value.
There are cases where you may want to have different values - for example, if the reference has twice as many frames as the distorted, which can happen if you encode e.g. a 60fps source into a 30fps bitstream, you could use something like -r 2 -i <source> -r 1 -i <encode>
, or -r 60 -i <source> -r 30 -i <encode>
to control the decimation of frames.
I see. Let's leave the documentation as-is then as it's won't yield incorrect VMAF scores. Thank you for the the information and have a wonderful remainder of your day 🙂
In the Using VMAF with FFmpeg section, we have the following example:
We have
-r 24
in the command but the framerate ofSeeking_30_480_1050.mp4
andSeeking_10_288_375.mp4
is 25, so shouldn't the framerate be set to 25 with-r 25
? If so, I am happy to open a PR.