Sorry about the necropost, but this article inspired me to a) backorder an A380 for video transcoding (which should hopefully ship some day but its date keeps getting pushed back), and b) try out ffmpeg/VMAF to do some comparisons of my own with various Handbrake settings for place-shifting my media library. I'm having trouble getting meaningful results out of VMAF though. Can you share the command you're running?
I'm using these options:
Code:
ffmpeg.exe -i compressed.mkv -i original.mkv -lavfi "[0:v]scale=1920:1080,setpts=PTS-STARTPTS[reference];[1:v]scale=1920:1080,setpts=PTS-STARTPTS[distorted];[distorted][reference]libvmaf=model_path=vmaf_v0.6.1.json:n_threads=12" -f null -
scaling to 1920x1080 as the compressed file is slightly cropped.
I'm talking with people that perhaps understand things better than I do over on Reddit:
View: https://www.reddit.com/r/ffmpeg/comments/yj9szj/nvidia_av1_encoding_support_8th_gen_ada_lovelace/
From that, I got a
new command that seems to give slightly higher VMAF results than my original testing, but I haven't gone back to redo everything.
Code:
ffmpeg -i [encoded file] -i [source file] -lavfi [0:v]setpts=PTS-STARTPTS[reference];[1:v]setpts=PTS-STARTPTS[distorted];[distorted][reference]libvmaf=n_threads=20 -f null -
However, that's for 1080p and lower resolutions. For 4K comparisons, you should use:
Code:
ffmpeg -i [encoded file] -i [source file] -lavfi [0:v]setpts=PTS-STARTPTS[reference];[1:v]setpts=PTS-STARTPTS[distorted];[distorted][reference]libvmaf=model='path="./vmaf-master/model/vmaf_4k_v0.6.1.json"':n_threads=20 -f null -
I
think that works. Originally, I converted the files to raw YUV to get a working VMAF scores but that's not necessary with all the setpts stuff. Scaling the resolution isn't something I've tried yet, so I'm not sure how much that might change things. Someone suggested this:
Code:
ffmpeg -i [Encoded] -i [Source] -lavfi [0:v]scale=1920:1080:flags=bicubic,setpts=PTS-STARTPTS[reference];[1:v]scale=1920:1080:flags=bicubic,setpts=PTS-STARTPTS[distorted];[distorted][reference]libvmaf=n_threads=12 -f null -
That looks similar to your original code but explicitly says to use :flags=bicubic for the scaling. I don't know how critical that might be. The default model should be fine for 1080p and lower so you don't need to specify it. If you use the 4K model with 1080p content, your VMAF score also shoots up (and is technically invalid AFAIK, since you're using it incorrectly). Hope that helps.