Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected result with Nearest upscaling in ffmpeg #310

Closed
VD-NVencC opened this issue Dec 27, 2024 · 1 comment
Closed

unexpected result with Nearest upscaling in ffmpeg #310

VD-NVencC opened this issue Dec 27, 2024 · 1 comment

Comments

@VD-NVencC
Copy link

while going through a list of up-scaling options for ffmpeg I noticed libplacebo nearest wasn't the same output as scale and zscale
is there another step I'm not accounting for?

ff611 -hide_banner -i 4.png -vf scale=-1:4096*2:neighbor -vcodec bmp -f framemd5 - -nostats | findstr 0,
ff710 -hide_banner -i 4.png -vf scale=-1:4096*2:neighbor -vcodec bmp -f framemd5 - -nostats | findstr 0,
0,          0,          0,        1, 268435510, d524ad2f60c32b3201a444a0bc2bc8db

ff611 -hide_banner -i 4.png -vf zscale=w=4096*2:h=4096*2:filter=point -vcodec bmp -f framemd5 - -nostats | findstr 0,
ff710 -hide_banner -i 4.png -vf zscale=w=4096*2:h=4096*2:filter=point -vcodec bmp -f framemd5 - -nostats | findstr 0,
0,          0,          0,        1, 268435510, d524ad2f60c32b3201a444a0bc2bc8db

ff611 -hwaccel vulkan -hide_banner -i 4.png -vf libplacebo=w=4096*2:h=4096*2:upscaler=nearest -vcodec bmp -f framemd5 - -nostats | findstr 0,
ff710 -hwaccel vulkan -hide_banner -i 4.png -vf libplacebo=w=4096*2:h=4096*2:upscaler=nearest -vcodec bmp -f framemd5 - -nostats | findstr 0,
0,          0,          0,        1, 268435510, e0b1e7da015e2c4b59cb43d654e6a4a6

the difference as counted by Pixel Color Counter was 5,898,700
point-nearest-diff

source used below
4

@VD-NVencC
Copy link
Author

ff611 -hwaccel vulkan -hide_banner -i 4.png -vf libplacebo=w=4096*2:h=4096*2:upscaler=nearest:dithering=none -vcodec bmp -f framemd5 - -nostats | findstr 0,
0,          0,          0,        1, 268435510, d524ad2f60c32b3201a444a0bc2bc8db

I recently tried to playback a .png in mpv (v39) and it couldn't display it losslessly without adding dither-depth=no to my config with dither=off already, and that exercise helped me track this down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant