Switch the codec for .webm samples from VP8 to VP9. All modern browsers support VP9 (Safari was the last to add support in ~2020), so it should be safe to provide only VP9 .webms without a fallback. VP9 lets us use two-pass encoding, which should offer better compression. Fixes ugoira samples still having poor quality even after4c652cf3e.4c652cf3etried to remove the max bitrate limit by setting `-b:v 0`, but this only worked in FFmpeg 4.2. In production Danbooru uses FFmpeg 4.4, and apparently in 4.4 `-b:v 0` means "use the default max bitrate of 256kb/s" instead of "no bitrate limit". https://trac.ffmpeg.org/wiki/Encode/VP9 https://developers.google.com/media/vp9/bitrate-modes https://developers.google.com/media/vp9/settings/vod http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide https://www.reddit.com/r/AV1/comments/k7colv/encoder_tuning_part_1_tuning_libvpxvp9_be_more/
Logical
This directory contains library code used through Danbooru. This includes things like defining API clients, dealing with sources, parsing tag searches, storing and resizing images, and so on.
Many of the files here use the Service Object pattern. Instead of putting complex code in models or controllers, it goes here, in plain old Ruby objects (POROs). This keeps models and controllers simpler, and keeps domain logic isolated and independent from the database and the HTTP request cycle.