Go and FFmpeg Service Cuts Mobile LCP from 4.1s by Owning Video Thumbnail Generation
A development team behind TrendVidStream rebuilt their video thumbnail pipeline after identifying that hotlinked third-party 1280x720 JPEGs were wasting roughly 90KB of transfer per card across 24 cards and eight regional page variants. Their PHP 8.4 shared-hosting front end was unsuitable for thumbnail extraction due to execution time caps, disabled shell access, and no concurrency control between cron jobs. To solve this, they built a lightweight Go service that uses FFmpeg to extract representative frames from source videos and re-encodes them at three widths in WebP format, writing outputs to content-addressed paths. Go was chosen specifically because it supports a long-lived bounded worker pool, reliable context deadlines for killing stalled FFmpeg processes, and in-process deduplication to prevent redundant decodes. The team also detailed critical FFmpeg flags — including input-side seeking, -nostdin, single-frame extraction, and the thumbnail filter — as essential to making the service production-safe and performant.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in