Plugin idea: Image optimization with WebP

Hello,

This plugin is part of my proposal for this year’s Outreachy / GSoC. I consider that this plugin might improve user’s experience significantly when browsing on a forum with lots of GIFs. Users will no longer have to wait for big GIFs to download. Moreover, the video can be streamed whilst it is downloaded.

Community managers will also see an improvement in their bandwidth usage and used disk space, although they may need slightly more processing power. NOTE: The used disk space will be improved only if the original GIFs will be no longer stored.

The goal is to create a lightweight service that can convert GIFs to MP4s. It would be ideal if it would support multiple backends for converting files from GIF to MP4 (e.g. ffmpeg, Cloudinary)

Conversion flow:

  • User uploads or links a GIF. Depending on site settings, only the user uploads, linked files or both will be converted. In some cases, the plugin can get smart. For example services like Imgur serve both GIFs and MP4s. Consider: last Night... - GIF on Imgur. Replacing “.gif” with “.mp4” will “convert” the GIF to an MP4 immediately.
  • The GIFs are queued for conversion. A processing queue is required because multiple ffmpeg instances may be a resource hog and make Discourse unresponsive. The conversion service has to carefully manage resources. I believe this is the most difficult part of this project.
  • After the conversion changes, the GIF is replaced with the MP4 video.
4 إعجابات