Netflix / vmaf

Perceptual video quality assessment based on multi-method fusion.
Other
4.64k stars 755 forks source link

inf fps value on low-resolution streams #1114

Closed Kr1eg3 closed 1 year ago

Kr1eg3 commented 2 years ago

Hello!

I encountered a problem when calculating psnr on QCIF streams. When calculating psnr for low resolution streams in .json dump in the field fps gets incorrect value "inf". Moreover, this error does not appear all the time, but occurs randomly. I attached the archive with the dump file and two test streams. I want to note that this error is repeated not only for 422 color space, but also for 420, 444.

Screen Shot 2022-11-11 at 15 49 04

I hope I described it correctly =)

Command line:

C:\vmaf-install\bin\vmaf.exe -r MissionControlClip3_176x144_60_422_8bit.yuv -d MissionControlClip3_176x144_80_422_8bit.hevc.yuv -w 176 -h 144 -p 422 -b 8 -o vmaf_dump.json --json -n --feature psnr

Files to recreate error.zip

nilfm commented 2 years ago

Hi! I am unfortunately unable to reproduce your issue on my laptop: I consistently get very high FPS numbers on that input (in the order of 20,000), but never inf. Could you please checkout this branch, build, run, and report the info it prints to screen when the problem occurs?

I think this is simply a problem with clock() having finite accuracy and returning the same value at the start/end of the feature computation, which is indeed "infinite FPS".

Kr1eg3 commented 1 year ago

Hi nilfm! I heard your answer and tried to build this branch on the machine, but ran into a bug on the meson side :D I wrote them a ticket today, so I will wait for their response in order not to change the state of the computer to be able to reproduce the error. I will try it on the other machines I have and report back to you.

chAlices commented 1 year ago

Hi all! I also have the same problem. When i try to read this output json it will occur a decode error json.decoder.JSONDecodeError: Expecting value: line 3 column 10 (char 33) And this is because of this line "fps" : inf I think it should be "fps" : "inf" That will be better :)

nilfm commented 1 year ago

Hi @Kr1eg3 and @chAlices, thanks for pointing this out. I put up a PR addressing this by outputting null instead of inf (which is consistent with how we output floats in other cases). That should give you valid JSON on the output, you can treat it as a special case in your code. You can check out the branch and see if it helps (I can't reproduce the issue on my machine).

nilfm commented 1 year ago

Merged the changes, this should be fixed now. Just make sure to take into account that fps can be null in this corner case if you are parsing the output JSON.

nilfm commented 1 year ago

Closing this as it seems resolved, if the problem remains do let us know and I'll reopen.