Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Building a Video Thumbnail Generator Service with Go and FFmpeg Workers

Every video card on our category grids was hotlinking a 1280x720 JPEG from a third-party CDN and then letting CSS scale it down to about 320 device-independent pixels. That is roughly 90 KB of wasted transfer per card, 24 cards per page, across eight regional page variants that each carry their own cache key. Mobile LCP on the busiest category pages sat at 4.1s, and the largest single contributor…

The narrative discusses the challenges and solutions behind creating a video thumbnail generation service using Go and FFmpeg. The service was created due to the poor performance of third-party CDN images hotlinking and scaling. The solution involved building a small Go service that extracts a representative frame from a source video using FFmpeg, encodes it in WebP format at three different widths, and stores the result in a content-addressed path accessible by the frontend.

The article highlights the importance of optimizing FFmpeg invocations, the limitations of PHP in handling such tasks, and how Go provides better control over concurrency, execution time, and deduplication. The article concludes by emphasizing the separation of concerns, where FFmpeg handles image processing and Go manages traffic control.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Tuesday 18 August →