1

I am using the following commandline under windows to convert a video file to individual frames for use of a project. But the project will eventually use a 16bit RGB565 palette. Is it possible to use palettegen to create a 256 colour rgb565 palette instead of rgb888? I want to cut down the colour depth before reducing the images to 256 colours in the hopes of a slightly better fit for the palette.

ffmpeg -y -i "input.mpg" -filter_complex "fps=15,scale=220:-1:flags=bilinear:sws_dither=none[x];[x]split[x1][x2];[x1]palettegen=reserve_transparent=off:stats_mode=single:max_colors=256[p];[x2][p]paletteuse=new=1:dither=none" frames/%%03d.bmp

Thanks.

Spinal
  • 11
  • 1

1 Answers1

1
  • paletteuse outputs pal8 which is paletteized 8-bits (see ffmpeg -pix_fmts).
  • The bmp encoder supports these pixel formats: bgra bgr24 rgb565le rgb555le rgb444le rgb8 bgr8 rgb4_byte bgr4_byte gray pal8 monob (see ffmpeg -h encoder=bmp).
  • By default the output encoder will automatically select the closest matching pixel format supported by the encoder. In this case the bmp encoder directly supports pal8, so pal8 will be used.

If you want to force conversion to a different pixel format use the format filter:

ffmpeg -i "input.mpg" -filter_complex "fps=15,scale=220:-1:flags=bilinear:sws_dither=none[x];[x]split[x1][x2];[x1]palettegen=reserve_transparent=off:stats_mode=single:max_colors=256[p];[x2][p]paletteuse=new=1:dither=none,format=rgb565le" frames/%03d.bmp
llogan
  • 121,796
  • 28
  • 232
  • 243