1

i'd like to extract thumbnails from videos. the problem i'm running into is that the boundaries of the reduced images aren't clear due to edge effects in the scaling algorithm. here is a simple mire test pattern to show what i mean : ffmpeg-extracted image of test pattern you can see here especially on the edges of the blue, red, and magenta fields that the borders have become indistinct due to blending from aliasing in the original video.

i want it to look more like this : same test pattern, idealised

i've tried all of the different scaling algorithms ; fast_bilinear and neighbor appear to work best, w/sws_dither set to none. however, i still can't get the results i'm looking for. is there some sort of 'fuzz' factor one can specify, as with image magick, or some way to have ffmpeg change the colours of edges to the same as other near colours, in order to 'flatten' or reduce the number and complexity of colours in the final image ?

EXAMPLE COMMAND LINE :
ffmpeg -hide_banner -i "$infile" -vf "scale=w=100:h=-1:sws_dither=none:sws_flags=neighbor" -y $output

5
  • 1
    This one of those tasks i'd just do in VLC.
    – Tetsujin
    Commented Dec 17, 2021 at 13:41
  • ffmpeg is not really optimized for still image tasks: it will first calculate the video frame (with all associated problems) and then write the image. You'd better extract full res stills and then use an image app to reduce to thumbnails.
    – 1NN
    Commented Dec 17, 2021 at 13:56
  • Which format are you extracting to?
    – Gyan
    Commented Dec 18, 2021 at 4:29
  • thanks to all for the replies. Tetsujin - unfortunately this needs to be scripted so treatment of the videos can be batched. @Gyan - PNG. Commented Dec 19, 2021 at 13:59
  • Insert format=rgb24 before the scale filter and check.
    – Gyan
    Commented Dec 20, 2021 at 4:51

0

You must log in to answer this question.

Browse other questions tagged .