[FFmpeg-user] How to get 4-bit PNG frames?

Rocky Ji rockyji3438 at gmail.com
Fri Jan 1 12:57:33 EET 2021


Hi,

I am using:

ffmpeg -i /dev/video2 -r 4 -vf format=pal8 -pix_fmt pal8 -f image2
s-%04d.png

to get 4 8-bit PNG screenshots every second from game capture device (if I
am understanding it correctly). For my purposes, I need to reduce size
further. So I want to get 4-bit PNGs (or 5-bit is also ok).

According to [https://trac.ffmpeg.org/wiki/colorspace] I should use
colorspaces or zscale to achieve this. Unfortunately I can't find any
information on color depth manipulation at [https://ffmpeg.org/ffmpeg-
filters.html#colorspace]. So I look at zscale and there may be something at
[https://github.com/sekrit-twc/zimg#depth] but I am unable to understand it
(too technical).

So, can I get 4-bit PNGs using ffmpeg only? If so how? Or I am doomed with
needing to program python/go/node ...

Thanks.


More information about the ffmpeg-user mailing list