RMI-PACTA / app

API + web frontend for PACTA infrastructure
MIT License
2 stars 0 forks source link

Make Loading Animation Smaller if the Browser can Handle It (i.e. `webp`) #8

Closed gbdubs closed 1 year ago

gbdubs commented 1 year ago

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture

gbdubs commented 1 year ago

Hm... the first two online webp converters I tried increased size by 50% (to a bit less than 1MB). @bcspragu do you have a recommended webp converter?

bcspragu commented 1 year ago

I played around with a few different formats.

WebP:

ffmpeg -i logo_loading_animation_v1.gif -vcodec webp -loop 0 -pix_fmt yuv420p -compression_level 6 -lossless 0 -quality 50 test.webp

Results in a ~decent looking, 440kb file, not ideal

WebM

ffmpeg -i logo_loading_animation_v1.gif -c vp9 -b:v 0 -crf 41 test.webm

Results in a 55Kb (e.g. 1/10th the size!) video that looks more or less identical:

test.webm

I'll cut a few different formats (basically like this) and we can use those, probably in order of WebM -> MP4 -> GIF