0

I'm trying to downscale a video with nearest-neighbour scaling, but the results are very poor.

To try and get to the bottom of it, I created this image which is a repeating pattern of various colours. The expected result is that the output image, when downscaled from 1080p to 360p, is solid green (#00ff00). Or possibly red, if it samples from the top-left instead of the centre.

Instead, the resulting image is green with vertical bars of #25e525 and #44c383, neither of which are present anywhere in the original image.

I've applied various other things to my command, as seen below, but it makes no difference.

ffmpeg -i 1080.png -vf scale=-1:360:flags=neighbor+accurate_rnd:sws_dither=none -pix_fmt rgb24 360.png

Upscaling works fine - it's just downscaling that goes wrong. Any ideas?

2 Answers 2

0

After some more back-and-forth with Bing, it seems zscale works far better than scale.

ffmpeg -i 1080.png -vf "zscale=-1:360:filter=point" 360.png

With video, add format=pix_fmts=rgb24, to the start of the vf chain.

0

It also seems that full_chroma_inp works with scale. Another option in case zscale isn't available.

ffmpeg -i 1080.png -vf scale=-1:360:flags=neighbor+full_chroma_inp 360.png

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.