It names only when it is sure.
A face is compared with the episode's credited cast alone, and named when it clearly resembles one of them. A voice is named when the faces agree on it at three thresholds. Doubt leaves the spot empty.
Laterna knows who is on screen, and who is speaking.
X-Ray watches your films and episodes once, on your server: it splits the picture into shots and scenes, recognises the credited cast, listens to the soundtrack and ties each voice to a face. During playback, Laterna knows who is there.
Laterna sends an order: this file, with this cast. X-Ray returns the scenes, the voices and a report that explains every decision.
A face is compared with the episode's credited cast alone, and named when it clearly resembles one of them. A voice is named when the faces agree on it at three thresholds. Doubt leaves the spot empty.
Started at minute 25, the episode is analysed from there to the end, then from the beginning. The first chunk is ready in under a minute, and scenes arrive as the analysis goes.
X-Ray runs one analysis at a time, at low priority and with a bounded thread count. When Jellyfin transcodes on the iGPU, X-Ray steps aside and moves to the processor.
Shots and face and voice fingerprints are kept: a changed naming rule, a growing series or a reset memory are all redone from the database.
For viewers, it all happens in the player: one tap tells you who plays whom.
The player shows one pill per person in the scene, with their photo, the actor's name and the character's. Those on screen longest come first, and the row changes with the scene.
Tap a pill to see the actor's age, birthplace, a short biography and two or three of their other titles in your library.
Lost the thread? One or two sentences remind you who this character is, based on what you have already watched and never beyond the start of the current scene.
Ask how two characters in the scene are connected from a person's panel, or ask anything about the title with the round button at the end of the row. Answers draw on what you have watched.
X-Ray analyses the whole library in the background, tier by tier: your priority list, then what is being watched, arrivals from the last fourteen days and finally the rest. The page shows the speed, the time remaining and the naming quality of each series.
Subtitles early or late? "Scan" compares them with the detected speech and tells whether they are offset, drifting or follow a different cut. "Realign" corrects them on display, and the file stays untouched.
After a break of four hours or more, a button offers to resume at the start of the current scene, only towards a boundary the service judges safe. Shipped switched off.
Laterna aligns subtitles, in any language, with the voices: a line gets the speaker's name when a confident voice covers at least 60% of it. The AI features then know who says what.
Start with administrators, then open it to everyone. A share link sees the row and the panel, without the library's other titles and without any AI feature.
A single ffmpeg per two-minute chunk outputs picture and sound at once. The picture gives the people and the scenes, the sound gives the voices, and the two meet to name who is speaking.
/items/{id}/scenes/items/{id}/voices/items/{id}/reportX-Ray skips the credits, recaps and previews Jellyfin has marked: credits often roll over faces that have nothing to do with the scenes.
The picture is scaled to 640 px and sampled at four frames per second, skipping non-reference frames. HDR (PQ, HLG, Dolby Vision with an HDR10 layer) is mapped to SDR after scaling: four small frames per second cost almost nothing.
From one frame to the next, colour histograms change at once at a cut and stay steady during a camera move. A contrast-normalised thumbnail catches shot-reverse-shots in dark sets.
X-Ray analyses two or three frames per shot. Each face is detected with five landmarks, aligned, scored, then tracked from frame to frame. Only the two best faces of a track get a 512-number fingerprint.
All tracks are grouped by hierarchical clustering, without knowing how many people there are. Clustering is redone at each chunk, incrementally, byte-identical to the full computation.
Each group is compared with the photos of every credited actor: the score is the mean of its three best similarities. The Hungarian algorithm assigns at most one group per actor, maximising the total score.
Faces and voices named with confidence in other episodes serve as references: they look more like the series than a posed portrait does. One contribution per episode, bounded, auditable and resettable.
A shot joins the scene when it resembles one of the last four shots, or shows someone just seen there. Scenes that are too short are merged, those that are too long are split at their weakest boundary.
On the original-language track, Silero finds speech and WeSpeaker takes a fingerprint every 0.5 s. Segments are grouped into voices at three thresholds, named by contrast with the faces present, and keep a name when two thresholds out of three agree.
For voices still undecided, X-Ray looks at who moves their lips: ten moments at most, decoded at 25 frames per second with their sound, scored by Light-ASD. Three votes and 70% agreement give a name.
Steps 4 to 9 are redone from the database, without decoding: the same result as a fresh analysis, in batches of 20 s, never ahead of a viewer. A whole series is renamed once its plan is done.
Each boundary is judged: an authored chapter, or colours and people changing together. A sentence begun just before moves the entry point back to it. The "Back to the start of the scene" button shows up at 3% of positions, each time in the right place.
The weights live outside the repository and the image: the container downloads them on first start, from their official release, and checks each one against its SHA-256 fingerprint.
XRAY_MODELbuffalo_l detector (InsightFace) finds faces and their landmarks. Quantised to INT8 on your machine, it detects in 40% less time.XRAY_MODEL: auraface.XRAY_VOICE_MODELXRAY_ASDIntel's engine, shipped in the image, computes on the processor or on the iGPU. ONNX Runtime takes over if it fails to load, with the same fingerprints to a cosine of 0.99999.
The image ships Jellyfin's ffmpeg and its Intel iHD driver: there is nothing to install on the host. The iGPU decodes H.264, HEVC Main 10, VP9 and VC-1.
The detector is quantised on first start from 224 frames of your library, and kept if it finds at least 95% of the original network's faces while inventing no more than 5%.
For each item, the report gives the models and devices used, and the reason behind every missing name. Laterna's "Naming quality" page links to it, series by series.
INT8 quantisation finds 72 faces out of 72, 136 out of 137 and 73 out of 74 on the bench: the only misses are under 36 pixels. The fingerprint stays at full precision, measured unusable in INT8.
With XRAY_OV_DEVICE=GPU, the networks run in half precision on the Intel iGPU, and processor time drops from 200 to 8 ms per frame. Detections and fingerprints stay identical to within 0.9994.
While the iGPU analyses one item, a second lane takes another on the processor, 1080p at most. Measured: 21.9 times real time instead of 20.8 on three 1080p episodes. The gain grows with the core count.
A name on screen is a decision made by crossing the file, the official cast, the actors' photos, the series memory and what Jellyfin knows. Each source has its role, and none decides alone.
Each pair of a face group and a credited actor gets a score: the mean of its three best similarities with the actor's photos. The threshold T is 0.30 with the default model.
The Hungarian algorithm then assigns one group per actor, looking for the highest total score. The confidence returned is 0.5 at the threshold and approaches 1 above it.
Speech segments are grouped into voices at three thresholds. At each threshold, a voice takes the name of the person most present on screen while it speaks, and least present during the other voices of the same scenes. A segment keeps its name when two thresholds out of three give it.
# scenes: people sorted by screen time 720.0 - 765.3 s Actor A 18.8 s (0.99) Actress B 15.0 s (0.98) Actor C 7.5 s (0.99) 765.3 - 840.0 s Actor A 22.3 s (0.99) Actress D 12.0 s (0.99) # voices: every speech segment 731.2 - 733.9 s voice 7 → Actor A (1.00) 734.4 - 735.1 s voice 9 → no name conflict_memory: faces and memory disagree 736.0 - 739.8 s voice 4 → Actress B (0.67) via: lip reading # report: models and SHA-256, devices, # thresholds, and why each name is missing
Moving the threshold by 0.05, a single threshold loses correct names. The consensus holds.
An episode is named with help from the next episode, already analysed.
On a film, it named voices the faces had left undecided.
These measurements were made on 9 and 10 November 2026 on a Core i7-8700 (6 cores, 12 threads, UHD 630 iGPU), with the default model, on files from a real library.
At 16.8 times real time, a 31-minute episode takes under two minutes of compute.
Four safeguards give it priority, from the scheduler to the iGPU.
nice and ionice. A transcode goes first.of compute estimated for a library of about ten thousand films and episodes, 7,600 h of video, in the background without rushing anyone.
for the first chunk, the one at the playback position: the "On screen" row fills in while you watch.
of weights for faces, plus voices and lips. About 4.3 MB of database per analysed hour, and a log capped at 30 MB.
Laterna receives TMDB identifiers, times and confidences. Fingerprints and images stay in the service's volume.
Face and voice fingerprints, reference photos and lip votes live in the service's volume. The only downloads are the model weights and the cast photos, from image.tmdb.org.
A face is compared with the cast Laterna provides for that title. An anonymous face stays in the database: the service names the actors of a title, and nobody else.
The service lives on Laterna's Docker network, with no published port, and every request carries the shared key.
The library is mounted read-only, under an unprivileged user. Subtitle sync corrects on display.
The rest goes without saying: model weights checked by SHA-256, no telemetry, secrets masked in the log, and a title hidden by parental controls stays hidden.
All it takes is a compose file, a key and a docker compose up -d. The service gets itself ready on first start, then Laterna sends it the work.
In a separate folder, save this file as docker-compose.yml, then adjust three lines: the library path, the user and the render group number.
# laterna-xray - next to Jellyfin and Laterna services: laterna-xray: image: ghcr.io/lk59/laterna-xray:latest container_name: laterna-xray restart: unless-stopped # The library's owner (like Jellyfin, Sonarr, Radarr). user: "1000:1000" env_file: .env environment: # buffalo_l (default, non-commercial weights) or auraface (Apache-2.0) XRAY_MODEL: buffalo_l XRAY_THREADS: "4" XRAY_VOICE_THREADS: "2" # XRAY_OV_DEVICE: GPU # inference on the iGPU, and mem_limit: 8g HOME: /data # No published port: only Laterna, on the same network, talks to it. networks: [media_net] volumes: # Read-only, at the SAME path as in the Jellyfin container. - /path/to/your/library:/media:ro # Database, model weights, reference photos, log. - xray_data:/data # Intel VA-API decoding. Without an iGPU, remove these two blocks. devices: - /dev/dri:/dev/dri group_add: - "993" # getent group render cpus: 6 # 4 for the picture, 2 for the voices mem_limit: 4g # 8g with XRAY_OV_DEVICE=GPU cpu_shares: 256 # below Jellyfin's 1024 volumes: xray_data: networks: media_net: external: true
If Jellyfin sees /media/tv/…, X-Ray must see /media/tv/…: Laterna passes paths on exactly as Jellyfin knows them.
Next to the compose file, a .env file. The key is the only secret: Laterna will present the same one. The two optional Jellyfin lines let it keep the iGPU while it transcodes, and provide the credits to skip.
printf 'XRAY_API_KEY=%s\n' "$(openssl rand -hex 32)" > .env
getent group render # the number to put in group_add
XRAY_API_KEY=<shared key> JELLYFIN_URL=http://jellyfin:8096 # optional JELLYFIN_API_KEY=<Jellyfin API key> # optional
On first start, the container downloads the model weights, verifies them, then builds the INT8 detector from frames of your library. It takes a few minutes, once.
docker compose up -d
docker logs -f laterna-xray # "buffalo_l ready" after about a minute
The service then answers at http://laterna-xray:8000 on the Docker network. /health reports ready: false while it gets ready, then the model, its licence, and where inference runs.
An order failing with "file not found": the mount is at a different path than in Jellyfin, or the user cannot read the folder.
Connecting it takes two places in Laterna.
The address http://laterna-xray:8000 and the key from .env. "Test connection" reads /health: the model, whether it is ready, and whether hardware decoding works.
Choose the feature's audience: admins to begin with, then everyone. Analysis of the whole library starts in the background, with its progress, its pause and its priority list.
"So far" and the questions are set separately, in Smart features → Artificial intelligence, with the provider, the key and the monthly ceiling.
XRAY_OV_DEVICE: GPU and mem_limit: 8g. Moves back to the processor during Jellyfin transcodes.XRAY_MODEL: auraface. Results already computed stay readable.XRAY_LANES: auto opens them with the iGPU, cpus: 8 and mem_limit: 7g at least.XRAY_VOICE: "0" turns off "who is speaking", XRAY_ASD: "0" lip reading alone.docker compose pull && docker compose up -d
Results already computed keep being served, each with the version that produced it. A new naming rule replays without decoding, through POST /relabel.
Settings, troubleshooting and the API contract: xray/README.md, PIPELINE.md, ARCHITECTURE.md and API.md (in French).
What X-Ray sees, and what escapes it.
buffalo_l weights are for non-commercial use only: your call, or switch to auraface.Add a container next to Jellyfin and a key in Laterna: your library will know who is on screen.