dirkvdb / ffmpegthumbnailer

Lightweight video thumbnailer that can be used by file managers to create thumbnails for video files
GNU General Public License v2.0
489 stars 70 forks source link

Add PNG compression level command line option #214

Open DarjanKrijan opened 2 years ago

DarjanKrijan commented 2 years ago

Would it be possible to add a PNG compression level option?

I measured the time of PngWriter::writeFrame for a 256x192 image between default compression (6) and 0 compressoin by adding png_set_compression_level(m_PngPtr, 0); there:

default compression: 15.6ms 0 compression: 1.6ms

I have my ~/.cache containing the thumbnails directory symlinked to a volatile ramdisk and rather have the generated thumbnails be generated quicker uncompressed and also loaded quicker by the file manager, saving a good bunch of seconds for larger video directories. For other people an even better compression than the default level 6 might be desired.

I'd do this myself and do a PR but I think someone that worked with this before gets this passed down way quicker.

DarjanKrijan commented 2 years ago

I just noticed gnome based DEs re-read and compress the output of the thumbnailer again before putting them in ~/.cache/thumbnails, adding metadata to the PNG header doing so. In my opinion there's no reason whatsoever to use compression for the actual thumbnailers at all.