Skip to content

Fast Emby / Jellyfin libraries with .strm (recommended)

If your library scans are slow, this is the setup you want.

Instead of mounting ClearStream and letting your media server read every file's header over the network, you sync a tiny local library of .strm shortcut files (plus the matching posters and artwork). Your media server scans that local folder — which is fast, because nothing crosses the network during a scan — and the actual video only streams from your CDN node when someone presses Play.

Why this is faster

A mounted library makes the scanner open every file over a high-latency link, so a full scan of a large catalog can take hours or days. With a local .strm library the scanner only touches small local files, so the same catalog scans in minutes. Playback is unchanged — it still streams direct from your CDN node.

How it works

ClearStream (origin)                  Your server
────────────────────                  ─────────────────────────────
.strm + artwork  ──  rclone sync  ──▶  /library  ◀── Emby / Jellyfin scans this
(tiny files)                                            (fast, all local)

                                       Press Play ─▶ CDN node ─▶ video streams
                                                      (only the bytes you watch)
  • A .strm file is a one-line text file containing the streaming URL of one video. Emby, Jellyfin, Plex, and Silo all understand .strm natively and treat it like a playable video.
  • The .strm files and artwork are pre-generated for you on the ClearStream side, so your server never has to probe videos or download metadata to build the library.
  • Each .strm is addressed to your own CDN node as you download it, with your private playback token in the URL. Playback goes straight to your node from any address, with nothing for you to configure or rewrite. See Playback works from any address.
  • Only .strm stubs and images live on your disk. The video files never do — they stream from your CDN node on demand.
  • Alongside the stubs you get the full local metadata set: .nfo details, posters, fanart, season art, episode thumbnails, and subtitles. That's what lets your server build a complete-looking library with internet metadata turned off.

Mount or .strm? Pick one per library

The rclone mount and this .strm method are two ways to reach the same content. Use .strm when scan speed matters (large libraries, low-powered servers, high-latency links). Use a mount when you want the raw files to appear as real files on disk. Don't point two libraries at the same content with both methods — pick one per library.

Sync the .strm library to local disk — never mount it

Don't read the .strm tree through a mount: not WinFsp, not rclone mount, and not Mountain Duck, Cloudmounter, or a mount inside WSL. Each .strm is rewritten with your node's address as it's delivered, so it's longer than the size the bucket listing reports (the same reason the sync below needs --ignore-size). A mount tells your media server the listed size, so the player reads a URL that stops partway through and the title won't play. Sync the tree to a local folder instead. That works the same on Windows, and you don't need WinFsp for .strm at all.

Playback works from any address

Your service has its own private playback token. When you sync the library with your ClearStream keys, every .strm file points at your own CDN node with that token in the path:

https://cdn-<id>.clearstreamer.com/strm/~<token>/movies/...

Your node plays that URL from any address: at home, on your phone, on a friend's TV, or in an app that plays the file directly. Playback isn't tied to your whitelist IP.

The sync still is. It's signed S3 access with your keys, like any other client, so if you have a whitelist IP, the server that runs rclone sync has to connect from it.

Treat your .strm files like a password

Anyone who has one of your .strm files can play it on your node, from anywhere, using your bandwidth. Don't share .strm files or your library folder publicly: no public shares, cloud-drive links, torrents, or Git repositories.

Synced before 14 October 2026? Re-sync once

Playback tokens went live on 14 October 2026. .strm files synced before then hold the old URL, which still plays, but only from your whitelist IP, and not at all if you've removed your whitelist. Your scheduled sync won't replace them on its own, so run the one-time re-sync to get the new ones.

If your token leaks

Open a support ticket and ask us to rotate your playback token. The old token stops working within 30 seconds, and so does every .strm file that holds it. Then run the one-time re-sync again to get .strm files with the new token.

Regenerating your S3 keys doesn't change your playback token, so your .strm files keep playing. Put the new keys in rclone.conf before your next sync.

Before you start

You need:

  • Your S3 endpoint, access key, and secret key (from your welcome email), and either your whitelist IP set to the server that will run the sync (recommended) or the whitelist removed — see Endpoint & credentials. Only the sync is affected by the whitelist; playback isn't.
  • rclone installed on the server that runs Emby/Jellyfin (Linux or Windows) — see S3 client examples and Step 1 below.
  • Local disk space. The .strm stubs are tiny, but the artwork is not. Budget for the artwork, not the videos.

How much disk you need

The .strm files are a few hundred bytes each; posters, fanart, episode thumbnails, and subtitles are the bulk. The whole library is roughly 390 GiB across ~8.9 million files — a rounding error next to the video itself, but not nothing. Approximate size per section:

Section Size
television ~215 GiB
movies ~150 GiB
xxx ~14 GiB
sports ~3 GiB
courses ~2 GiB

If disk is tight, sync only the sections you want — each is a separate top-level folder, so you can pull movies and television and skip the rest. To check a subtree yourself:

rclone size --fast-list clearstream:strm-tree/movies

Plan for the file count, not the byte count

390 GiB is small, but 8.9 million files is not. The first sync takes hours, and it is limited by per-file round-trips rather than bandwidth. Make sure the destination filesystem is comfortable with millions of small files (ext4/XFS/ZFS on Linux and NTFS on Windows are fine; avoid exFAT and most network shares).

Step 1 — Configure rclone

If you already mount ClearStream, you already have this remote and can skip ahead. Otherwise create an rclone config with this remote (clearstream here is just the remote's name — use whatever you called yours):

[clearstream]
type = s3
provider = Other
access_key_id = YOUR_ACCESS_KEY
secret_access_key = YOUR_SECRET_KEY
endpoint = https://YOUR-ENDPOINT/
force_path_style = true

Save it as ~/.config/rclone/rclone.conf, then check it works:

rclone lsd clearstream:strm-tree
  1. Download rclone for Windows from rclone.org/downloads and unzip rclone.exe into C:\rclone\. You don't need WinFsp for the .strm library.
  2. Save the config as C:\rclone\rclone.conf. The scheduled sync below runs as the SYSTEM account, which won't look in your user profile, so every command here names the file with --config.
  3. The file holds your secret key. In an elevated PowerShell, limit the folder to SYSTEM, Administrators, and you:

    icacls C:\rclone /inheritance:r /grant:r "*S-1-5-18:(OI)(CI)F" "*S-1-5-32-544:(OI)(CI)F" "$env:USERDOMAIN\$($env:USERNAME):(OI)(CI)F"
    

    (S-1-5-18 is SYSTEM and S-1-5-32-544 is Administrators, in any Windows language.)

  4. Check it works:

    C:\rclone\rclone.exe --config C:\rclone\rclone.conf lsd clearstream:strm-tree
    

You should see one folder per section (courses, movies, sports, television, xxx).

Your .strm library location

The examples use the strm-tree bucket. If the bucket or path for your service differs, it's listed in your welcome email / client area — substitute it wherever you see clearstream:strm-tree.

Step 2 — Sync the .strm library to local disk

Pull the pre-generated .strm + artwork tree to a local folder. Use sync so your local copy stays an exact mirror (titles removed upstream are removed locally too):

rclone sync clearstream:strm-tree /library \
  --ignore-size \
  --fast-list \
  --transfers 64 --checkers 64 \
  --use-server-modtime \
  --max-delete 50000 \
  --retries 3 --low-level-retries 10 \
  --stats 2m --stats-one-line

In PowerShell (a backtick continues the line). D:\library is an example; use any local NTFS folder that holds nothing else:

C:\rclone\rclone.exe --config C:\rclone\rclone.conf sync clearstream:strm-tree D:\library `
  --ignore-size `
  --fast-list `
  --transfers 64 --checkers 64 `
  --use-server-modtime `
  --max-delete 50000 `
  --retries 3 --low-level-retries 10 `
  --stats 2m --stats-one-line
Flag Why
--ignore-size Required — the sync fails without it. See the warning below.
--fast-list Reads the tree in batched LIST calls (one per ~1000 objects) instead of one call per directory — essential on a tree this large and deep. Costs ~1 KB RAM per object, so budget ~8 GB… see the note below if that's too much.
--transfers 64 --checkers 64 Millions of small files, so round-trips (not bandwidth) are the limit. Lower these if your server struggles.
--use-server-modtime Keeps each file's real date so "Recently Added" and date sorting work, and it's what the sync compares on. Never use --no-modtime — see the warning on the clients page.
--max-delete 50000 Safety cap: if something upstream looks catastrophically smaller than it should, the sync aborts instead of emptying your library.
--retries / --low-level-retries Survives transient network blips on a long sync.

--ignore-size is required, not optional

Each .strm file is personalised as it's delivered: the playback URL inside it is rewritten to point at your CDN node. That makes the delivered file a slightly different length than the catalog listing advertises, and rclone treats a size mismatch as a corrupt transfer:

ERROR : corrupted on transfer: sizes differ 142 vs 145

--ignore-size tells rclone to compare modification time instead of size, which is the correct check here. Leave it out and every .strm fails to transfer; use --size-only and every file re-downloads on every run, forever.

sync deletes local files that are gone upstream

rclone sync makes the destination match the source, which means it deletes local files no longer in the library. That's what you want for a mirror, but point it at a dedicated folder (like /library), never a folder that also holds your own files. If you'd rather only ever add files, use rclone copy instead.

If --fast-list uses too much memory

--fast-list holds the listing in RAM (~1 KB per object, so ~8 GB for the full library). On a smaller box, just drop the flag — rclone then walks the tree directory by directory, which uses far less memory at the cost of more requests and a longer run. Syncing one section at a time keeps both bounded.

The first sync takes hours — it's ~8.9 million files, and it's round-trip bound, not bandwidth bound. Later syncs only move what changed and finish far faster.

Keep it updated automatically (systemd)

Don't run the sync by hand — install it as a systemd timer so your library stays fresh on its own. This is the setup we recommend everyone use. On Windows, use Task Scheduler instead.

Already set this up from an earlier version of this page?

Earlier versions used different names for the script, the systemd units, and the Windows task. Keep your existing install and use its names in the commands below. Don't add a second copy under the new names: the two copies wouldn't share a lock, so both could sync the same folder at once.

1. The sync script — wrapped in a lock so a long run can never be started twice:

#!/usr/bin/env bash
# /usr/local/bin/clearstream-strm-sync.sh
set -uo pipefail

LOG=/var/log/clearstream-strm-sync.log
DST=/library

# Refuse to start if the previous run is still going.
exec 9>/tmp/clearstream-strm-sync.lock
if ! flock -n 9; then
  echo "$(date -Is) SKIP: previous sync still running" >>"$LOG"
  exit 0
fi

echo "$(date -Is) START" >>"$LOG"
/usr/bin/rclone sync clearstream:strm-tree "$DST" \
  --ignore-size \
  --fast-list \
  --transfers 64 --checkers 64 \
  --use-server-modtime \
  --max-delete 50000 \
  --retries 3 --low-level-retries 10 \
  --stats 2m --stats-one-line \
  --log-file "$LOG" --log-level INFO
echo "$(date -Is) END rc=$?" >>"$LOG"

Make it executable: sudo chmod +x /usr/local/bin/clearstream-strm-sync.sh

2. The service — a one-shot job that runs that script. Run it as the same user your media server runs as so the files it writes are readable by Emby/Jellyfin, and keep it gentle on the box while a large sync runs:

# /etc/systemd/system/clearstream-strm-sync.service
[Unit]
Description=Sync ClearStream .strm library to local disk
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot

# Run as your media-server account so /library is readable by Emby/Jellyfin.
# rclone reads that user's ~/.config/rclone/rclone.conf.
User=emby
Group=emby

# Be a good neighbour: never starve the media server of CPU or disk I/O.
Nice=10
IOSchedulingClass=best-effort
IOSchedulingPriority=6

ExecStart=/usr/local/bin/clearstream-strm-sync.sh

# A full reconcile of the whole library legitimately runs for many hours.
# Set this too low and systemd kills the job mid-run — see the warning below.
TimeoutStartSec=20h

3. The timer — starts a run 20 minutes after boot, then 6 hours after each run finishes. Persistent=true means a run missed while the machine was off fires as soon as it's back:

# /etc/systemd/system/clearstream-strm-sync.timer
[Unit]
Description=Periodic ClearStream .strm library sync

[Timer]
OnBootSec=20min
OnUnitInactiveSec=6h
Persistent=true
RandomizedDelaySec=10min

[Install]
WantedBy=timers.target

Don't shorten the interval or the timeout

These two settings look conservative and aren't. A full reconcile of the library walks ~8.9 million objects and can run for many hours — long enough that an hourly timer would simply stack runs on top of each other, and a short TimeoutStartSec makes systemd kill the job partway through, every time, so the library silently stops updating.

OnUnitInactiveSec (not OnUnitActiveSec) is deliberate: it measures the gap from when the last run finished, so runs can never overlap regardless of how long one takes. RandomizedDelaySec just avoids every server hitting the endpoint on the same tick.

4. Enable it:

sudo systemctl daemon-reload
sudo systemctl enable --now clearstream-strm-sync.timer

5. Check it's working:

systemctl list-timers clearstream-strm-sync.timer     # when it last ran / runs next
systemctl status clearstream-strm-sync.service        # result of the last run
journalctl -u clearstream-strm-sync.service -n 50     # sync output
sudo systemctl start clearstream-strm-sync.service     # force a run right now

Match User= / Group= to your media server

Replace emby with the account Emby or Jellyfin actually runs as (Docker users: run the sync as the same UID/GID you pass the container, or write to a volume it can read). If rclone can't find its config, add --config /home/emby/.config/rclone/rclone.conf to the ExecStart line.

Picking up the new files

After each sync, your media server's own scheduled library scan finds the changes — no extra step needed. To have new content appear within seconds instead of on the next scan, pair this with ZenLocalPoller, which reacts to library changes as they happen.

Keep it updated automatically (Windows Task Scheduler)

The Windows version of the systemd timer is a scheduled task that runs a small PowerShell script as SYSTEM.

1. The sync script. Save it as C:\rclone\strm-sync.ps1. Like the Linux script, it takes a lock so two runs can never overlap:

# C:\rclone\strm-sync.ps1
$Rclone = 'C:\rclone\rclone.exe'
$Config = 'C:\rclone\rclone.conf'
$Dst    = 'D:\library'
$Log    = 'C:\rclone\strm-sync.log'

# Refuse to start if the previous run is still going.
$lock = New-Object System.Threading.Mutex($false, 'Global\ClearStreamStrmSync')
try   { $owned = $lock.WaitOne(0) }
catch [System.Threading.AbandonedMutexException] { $owned = $true }  # last run was killed
if (-not $owned) {
    Add-Content $Log "$(Get-Date -Format s) SKIP: previous sync still running"
    exit 0
}

$rc = 1
try {
    Add-Content $Log "$(Get-Date -Format s) START"
    & $Rclone --config $Config sync clearstream:strm-tree $Dst `
        --ignore-size `
        --fast-list `
        --transfers 64 --checkers 64 `
        --use-server-modtime `
        --max-delete 50000 `
        --retries 3 --low-level-retries 10 `
        --stats 2m --stats-one-line `
        --log-file $Log --log-level INFO
    $rc = $LASTEXITCODE
    Add-Content $Log "$(Get-Date -Format s) END rc=$rc"
}
finally {
    $lock.ReleaseMutex()
}
exit $rc

2. The task. In an elevated PowerShell, register it to run 20 minutes after boot and then every 6 hours:

$action = New-ScheduledTaskAction -Execute 'powershell.exe' `
    -Argument '-NoProfile -ExecutionPolicy Bypass -File C:\rclone\strm-sync.ps1'

$boot = New-ScheduledTaskTrigger -AtStartup
$boot.Delay = 'PT20M'
$every6h = New-ScheduledTaskTrigger -Once -At (Get-Date) `
    -RepetitionInterval (New-TimeSpan -Hours 6)

# IgnoreNew: never start a run while one is still going.
# StartWhenAvailable: catch up on a run missed while the machine was off.
$settings = New-ScheduledTaskSettingsSet -MultipleInstances IgnoreNew -StartWhenAvailable

$principal = New-ScheduledTaskPrincipal -UserId 'SYSTEM' -LogonType ServiceAccount -RunLevel Highest

Register-ScheduledTask -TaskName 'ClearStream strm sync' `
    -Action $action -Trigger $boot, $every6h -Settings $settings -Principal $principal

Don't shorten the interval or the time limit

The advice for systemd applies here too. A full reconcile can run for many hours. IgnoreNew makes a trigger that fires mid-run skip that run instead of stacking a second one. The task's default 3-day time limit is deliberately long: lower it and Task Scheduler stops the sync partway through, so the library quietly stops updating.

3. Check it's working (elevated PowerShell):

Get-ScheduledTaskInfo -TaskName 'ClearStream strm sync'  # last/next run; LastTaskResult 0 = OK
Start-ScheduledTask -TaskName 'ClearStream strm sync'    # force a run right now
Get-Content C:\rclone\strm-sync.log -Tail 50             # sync output

Make sure your media server can read the folder

Files the sync writes inherit the permissions of D:\library, which normally lets any local account read them. If Emby or Jellyfin runs as a service account and can't see the files, give that account read access to D:\library.

Step 3 — Add the library in your media server

Point Emby or Jellyfin at the local folder — not at a mount. The settings below make the scan fast and stop the server from trying to fetch things over the network.

  1. Settings → Library → Add Media Library.
  2. Content type: Movies for a movies folder, Shows for TV. Add one library per content type, each pointing at the matching subfolder (e.g. /library/movies, /library/television).
  3. Folders: add the local path (e.g. /library/movies, or D:\library\movies on Windows).
  4. Open the library's options and set:
    • Enable real time monitoring: OFF (you rescan after each sync instead).
    • Metadata downloaders (internet): uncheck them all. The artwork and .nfo files are already in the folder, so the server reads titles and images locally and never calls TMDb/TVDb.
    • Metadata readers: make sure Nfo is enabled and first.
    • Save artwork/metadata into media folders: OFF (the folder is a read-only mirror; let the sync own it).
    • Chapter image extraction: OFF (extracting chapter images would read the video over the network).
  5. Save. Emby scans the folder.
  1. Dashboard → Libraries → Add Media Library.
  2. Content type: Movies or Shows. Add one library per content type, each pointing at the matching subfolder (e.g. /library/movies, /library/television).
  3. Folders: add the local path (e.g. /library/movies, or D:\library\movies on Windows).
  4. In the library settings:
    • Enable real time monitoring: OFF.
    • Metadata downloaders (Movie/Series/Season/Episode): uncheck them all so Jellyfin uses the local .nfo and artwork instead of the internet.
    • Metadata savers: leave Nfo as the reader; don't enable "Save artwork into media folders."
    • Chapter image extraction: OFF.
  5. Save. Jellyfin scans the folder.

Keep internet metadata off for the fastest, most reliable scans

The projection already ships posters, fanart, and .nfo details, so internet downloaders add nothing but network calls and rate-limit delays. If you specifically want the server to fetch extra metadata online you can turn a downloader back on, but expect slower scans.

Step 4 — Scan and verify

  • The scan starts automatically when you add the library, or trigger it from the library menu.
  • Play a title. It should start streaming from your CDN node within a second or two. Nothing was downloaded to your disk to make that happen — the .strm pointed the player straight at the CDN.

Large libraries: titles appear in minutes, the scan bar finishes later

On a very large library the items become browsable and playable within a few minutes, but the scan progress bar can keep moving for a good while afterward as the server finishes its internal bookkeeping over hundreds of thousands of items. This is normal — the library is fully usable while it finishes. It only happens on the first scan; later incremental scans are quick.

Re-sync your .strm files once

Run this once if you synced your library before 14 October 2026, and again after support rotates your playback token. A new install doesn't need it: its first sync already gets .strm files with your token.

A refreshed .strm file keeps the same listed size and date as the old one, so your scheduled sync sees nothing to update and leaves the old file in place. This command re-downloads every .strm file anyway, and leaves the artwork and .nfo files alone:

rclone copy clearstream:strm-tree /library \
  --include "*.strm" \
  --ignore-times --ignore-size \
  --use-server-modtime \
  --fast-list \
  --transfers 64 --checkers 64

In PowerShell:

C:\rclone\rclone.exe --config C:\rclone\rclone.conf copy clearstream:strm-tree D:\library `
  --include "*.strm" `
  --ignore-times --ignore-size `
  --use-server-modtime `
  --fast-list `
  --transfers 64 --checkers 64
Flag Why
copy, not sync Adds and replaces files, never deletes any.
--include "*.strm" Only the .strm files. The artwork and .nfo files haven't changed.
--ignore-times Re-downloads every .strm even though its size and date match. Use it only for this one-off run. In the scheduled sync it would re-download them all on every run.
--ignore-size Needed for the same reason as in Step 2.

Use your own remote name and library folder. Run it on the server that runs your scheduled sync (the one on your whitelist IP, if you have one), as the same account, and not while a scheduled sync is in progress. It still lists the whole library and fetches every .strm file, so on a full library it takes a while, though far less than the first sync.

Check it worked: open any .strm file in a text editor. Its URL should contain /strm/~ followed by your token. Emby and Jellyfin read the .strm file each time a title starts, so you don't need to rescan the library.

Troubleshooting

Symptom Fix
corrupted on transfer: sizes differ on every .strm You're missing --ignore-size. Add it to the sync command — see Step 2.
Every file re-downloads on every run You're using --size-only. Replace it with --ignore-size so rclone compares modification time.
Sync never finishes / library stops updating The run is being killed partway through. Check TimeoutStartSec is generous (20h) and that the timer uses OnUnitInactiveSec, not OnUnitActiveSec. On Windows, check the task's time limit wasn't lowered from its 3-day default.
A title won't play and its .strm holds a URL that stops partway You're reading the library through a mount (WinFsp, rclone mount, Mountain Duck, WSL…). Mounts report the listed size and cut the personalised URL short. Sync to a local folder instead — see the warning under How it works.
A title plays from your whitelisted server but nowhere else Its .strm file is from before 14 October 2026: its URL has no /strm/~ token, so it only plays from your whitelist IP. Run the one-time re-sync.
Older titles stopped playing after you removed your whitelist Their .strm files are from before 14 October 2026 and have no token, so with no whitelist they play from nowhere. Run the one-time re-sync.
No title plays, from anywhere If support just rotated your playback token, your .strm files still hold the old one: run the one-time re-sync. Otherwise check your node with the health check.
The sync fails with AccessDenied "Client IP … is not whitelisted" The sync is S3 access, so it needs your whitelist IP even though playback doesn't. Whitelist the server that runs the sync, then run the sync again. See Connection errors.
Scan is slow / server is probing videos You likely left an internet metadata downloader or chapter image extraction on, or you pointed the library at a mount instead of the synced folder. Recheck Step 3.
"Recently Added" / dates look wrong Make sure the sync uses --use-server-modtime (not --no-modtime).
Titles missing after an upstream change Re-run the sync (Step 2). Remember sync mirrors deletions; copy only adds.
Sync aborted with a max-delete error --max-delete did its job and stopped an unexpectedly large removal. Check the log to see what it wanted to delete before re-running.
Disk filling up Artwork is the bulk. Sync fewer sections, or drop the largest ones. Check with rclone size --fast-list clearstream:strm-tree/<section>.
out of memory during the sync --fast-list needs ~1 KB per object. Drop the flag, or sync one section at a time.

See also