Scrub previews with nothing made ahead
Most media servers make scrub previews ahead: a sheet of small pictures for every title, made in the background after a scan. On a library of 40,000 titles those sheets took 68 GB, and about 4,000 of the titles were opened in six months. Leyla makes each picture when someone drags to it.
What making them ahead costs
Plex calls them video preview thumbnails and Jellyfin calls them trickplay images; either way they are made ahead, in the background. A preview sheet is a picture every few seconds of a film, stitched together and stored. Making one means decoding through the whole file, so a new library keeps the server busy for days, and the sheets fill a disk with pictures of films nobody scrubs. On our own test library: 68 GB of sheets for 40,000 titles, of which about a tenth were opened in half a year.
How Leyla does it
Ask for keyframes, not seconds
When a title opens, the app is given the times of the file's keyframes, read from its index, at most a few thousand. It only ever asks for one of those times, so every picture has one address and the second scrub is answered by the browser's cache.
Decode one frame
The server keeps a small helper running: a patched
ffprobewith a thumbnail mode that seeks to a keyframe, decodes that one frame, scales it and writes a JPEG over a pipe. That takes 8 to 30 ms, 25 to 60 ms for 1080p and 4K on our test machine, and seconds only when a sleeping disk has to wake.Show what you have, then the exact one
While you drag, the app shows the nearest picture it already holds at once and asks for the exact one, which arrives a few milliseconds later. Requests the finger has passed are cancelled.
Look ahead in the direction you move
A drag, or a TV remote's right button held down, moves one way. The server decodes the next few points in that direction when a worker is idle, so the next press is already in memory.
What is kept
A picture is kept in memory for a while, and once someone has actually looked at it, on disk for every viewer, for about a week unused and within a size limit. Nothing is made for a title nobody opens. The picture under the seek bar is the frame a seek there would land on, because both come from the same keyframe.
The same helper gives files without chapters their scene chapters, at background priority, only when no viewer is waiting.
Questions
How much space do preview thumbnails take?
On our test library, 68 GB for 40,000 titles. The size grows with the library and with how often a picture is taken.
Why does generating preview thumbnails take so long?
Making a sheet means decoding the whole film. Across a new library that keeps a server busy for days, on a NAS longer.
Can I turn them off?
In most media servers, yes, and you lose the picture under the seek bar. Leyla has none to turn off: each picture is made when someone drags to it.
The result
No background job after a scan, no 68 GB, and a picture under the seek bar the moment you drag, on the web, phones and TVs. Leyla's ffmpeg, with the thumbnail mode, is public at tropicalthink/leyla-ffmpeg.
Read next
- A media server on a NAS or a Raspberry PiA media server on Synology, QNAP, Unraid, TrueNAS or a Raspberry Pi: which models transcode, Docker setup, PUID and PGID, and what to buy.
- TrueHD and DTS in the browser, without converting on the serverBrowsers cannot play the TrueHD and DTS tracks on Blu-ray remuxes. Leyla's web app decodes them in WebAssembly and hands the browser FLAC, in sync.
- Hardware transcoding for a home media serverIntel Quick Sync, NVIDIA NVENC, AMD and the Raspberry Pi for a media server: when you need a GPU, what each handles, and what each server charges for it.
- The best self-hosted media servers in 2026Jellyfin, Plex, Emby and Leyla compared for 2026: price, remote streaming, hardware transcoding, apps, and which home each media server suits.
Something wrong or out of date here? Tell us.