Skip to content

Instantly share code, notes, and snippets.

@nugget
Created August 14, 2026 15:06
Show Gist options
  • Select an option

  • Save nugget/0a4ad6dd6922e2bb575a704460f1e7d9 to your computer and use it in GitHub Desktop.

Select an option

Save nugget/0a4ad6dd6922e2bb575a704460f1e7d9 to your computer and use it in GitHub Desktop.
LotR AI-assisted disc-to-Jellyfin processing report

The Lord of the Rings

A personal archive of the trilogy, assembled from fifteen purchased discs into three folders. Both cuts of each film in 4K, the twelve audio commentaries, and just under twenty-seven hours of supplementary material.

Theatrical Extended Extras
The Fellowship of the Ring 82.45 GiB · 2:58:25 146.02 GiB · 3:48:11 22 items · 7:46:34
The Two Towers 82.82 GiB · 2:59:25 141.71 GiB · 3:55:26 19 items · 8:45:18
The Return of the King 84.75 GiB · 3:21:01 165.99 GiB · 4:23:12 21 items · 10:12:33

754.3 GiB · 62 extras · 26:44:27 of supplements.

Nothing here is re-encoded. Every join and every mux is a stream copy.


Why this needed assembling

The 4K UHD release carries no supplements whatsoever. Across all nine 4K discs, every non-feature title is a copyright warning card, a menu background loop, a black filler or a studio logo. The extended 4K discs expose twelve audio tracks and all twelve are language dubs — there is not a single commentary track anywhere on the 4K set.

The Blu-ray Extended Edition box has all of it: four commentaries per film, the six Appendices discs, and Costa Botes' behind-the-scenes documentaries. But at 1080p, with the Appendices on standard-definition DVD.

Neither box gives you both. This library is the 4K picture with the Blu-ray's supplements fitted to it.

Sources

Set Discs Contributed
4K UHD, theatrical 3 × BD-100 the three theatrical features
4K UHD, extended 6 × BD-100 the three extended cuts, two discs per film
Blu-ray Extended Edition 6 BD + 6 DVD 12 commentaries, the Appendices
Limited Edition (per film) 3 DVD the Costa Botes documentaries

All six features are HEVC Main 10, 3840×2160, 23.976 fps, BT.2020 / PQ, Dolby Vision Profile 7 (dvhe.07.06 BL+MEL+RPU).


Rejoining the extended cuts

Each extended cut ships split across two discs with a fade to black at the break. The three files here are single continuous features, rejoined losslessly — every cut point placed exactly on a keyframe, so nothing was re-encoded and no frame of film was discarded.

The disc break behaves differently on all three films. On Fellowship the picture and soundtrack stop together, so the dead black could be removed outright. On the other two the soundtrack keeps running over the black picture — still at −19.3 dB on Return of the King — so cutting at the picture boundary would have chopped the score mid-fade at a plainly audible level. There the cut was placed at the keyframe where Part One's fading audio matches the level Part Two begins at, so the fade-out runs into the fade-in without a step.

Film Audio at picture-black Cut at Result
Fellowship −90 dB (stopped with picture) 6338.374s black removed entirely
The Two Towers −36.6 dB 6395.931s → −60 dB, meeting Part 2's −59.6 dB 1.738s dip to black
The Return of the King −19.3 dB 7656.983s → −44.5 dB, meeting Part 2's −47.0 dB 1.738s dip to black

Finished joins against arithmetic prediction: +9 ms, +13 ms, −4 ms — all well under one frame (41.7 ms). Chapters merged correctly at 48, 68 and 78.


Fitting the commentaries to the 4K picture

The twelve commentaries exist only on the Blu-ray, timed to the extended cut. The 4K extended cut is the same cut from a different master, so nothing was assumed to line up. Alignment was measured by cross-correlating the Blu-ray's main audio against the 4K's in short RMS bins, sweeping lag for the peak, repeated at several points across each runtime so drift would appear as a lag that changes with position.

Every part correlated at zero lag with no drift. The largest offset found anywhere was 0–50 ms on Fellowship Part One — under one frame, smaller than the measurement resolution. No sync correction was applied to anything; correcting by less than the measurement error would be false precision.

The two releases carry genuinely different main mixes — DTS-HD MA 6.1 on the Blu-ray against TrueHD 7.1 on the 4K. That is why correlation peaks at 0.89–0.99 rather than ~1.0: the timing matches, the mixes do not.

The disc-break value is not a constant

Each commentary spans two Blu-ray discs and had to be rejoined at the same narrative frame as the picture, which means knowing exactly where each Part Two's content begins.

4K Part 2 leading black Blu-ray Part 2 leading black
Fellowship 2.002s 2.002s
The Two Towers 2.002s 1.001s
The Return of the King 2.002s 1.001s

Fellowship's halves matched, so its join worked first time. Carrying that figure forward would have placed eight commentaries a full second early across the back half of two films — comfortably perceptible, and invisible to a duration check or a seam inspection. It was caught because every part was measured against the 4K independently rather than inheriting the previous film's value: Part One correlated at zero lag, Part Two came back at a consistent −1.00s across five windows, and the leading-black measurement then explained the discrepancy to the millisecond.

Joined commentary tracks landed within 647 ms, 37 ms and 105 ms of their features — all trailing-edge differences, not sync.

Which commentary is which

The four tracks on each disc arrive unnamed and indistinguishable: four English 2.0 tracks at 192 kbit. Each was identified by transcribing its opening seconds, where the participants introduce themselves, on both halves of every disc pair rather than assuming Part Two follows Part One.

The published running order proved correct throughout. That was worth verifying rather than trusting — on other discs in this collection the mux order has run opposite to the distributor's own listing, and a mislabelled commentary is undetectable after the fact.

The lead speaker changes between films and even between halves — Ian McKellen opens Fellowship's cast track, Elijah Wood opens Two Towers' Part One and Dominic Monaghan its Part Two, and Return of the King's begins with the hobbits jostling over who speaks first. Track names reflect each film's own participants.

Verified against the picture

Sync was confirmed by content, not by arithmetic alone. For each film, a frame and the directors' commentary were sampled at the same instant:

Film Picture Commentary at that moment
Fellowship, 2:30:00 the Fellowship walking through forest into Lothlórien "the smaller ones are real, but the large big ones are actually big rubber trees… introducing Galadriel and the concept of Lothlórien"
The Two Towers, 2:15:00 Faramir studying a map in Henneth Annûn "I drew a map of Middle-earth on a bit of paper, and I went into the billiard room of this house we were at"
The Return of the King, 3:00:00 the tower of Cirith Ungol "There's a bit of silliness around Cirith Ung—"

Track naming

Every feature carries named, flagged tracks rather than the anonymous "Surround 5.1 / Stereo" a plain rip produces:

  • Surround 7.1 — the TrueHD mix
  • Surround 5.1 - Dolby Digital companion — the AC-3 track carried inside the TrueHD stream, named explicitly rather than identically to its parent, because the channel counts differ and calling a 5.1 track "7.1" would misstate it
  • English SDH — flagged hearing-impaired
  • Four Commentary - … tracks on each extended cut, carrying the Matroska commentary flag so players present them as commentaries rather than as alternate language options

The Dolby Digital track was verified as the companion rather than assumed, on every file, by measuring envelope correlation against the main mix with the foreign dubs as controls: companions measured r=0.993–0.997, dubs on the same discs 0.883–0.972.

SDH status was confirmed by rendering subtitle cues and reading them. Markers found included [SPEAKING IN ROHIRRIM], [OLIPHAUNTS TRUMPETING], [ORCS CHANTING] and speaker labels such as GANDALF:.


The supplements

Six Appendices discs and three Costa Botes documentaries, all standard-definition DVD. They have never been remastered — they look like 2002 DVD because they are.

Storyboard sequences, pre-visualisation animatics and photo galleries were excluded. They are menu-driven browsing material rather than documentaries and do not present usefully as library items.

"Play All" compilations were excluded. Several Appendices discs expose one, and they are not obvious: Two Towers' Part Three carries a 2:59:09 title with 47 chapters that looks like legitimate content until you notice its five documentaries sum to exactly that figure. Return of the King's Part Five has a 3:23:42 equivalent. Taken at face value they would have added 11 GB duplicating everything beside them.

Location compilations were kept, their chapters were not. Each film's "New Zealand as Middle-earth" is a compilation whose individual location segments also appear as separate titles — six or seven short items summing to the compilation's runtime. Keeping both would have produced a folder of redundant fragments.

Every extra carries a container title and a .jpg thumbnail sidecar. The sidecars matter: disc extras almost universally open on black, so a media server generating its own thumbnail gets nothing usable and falls back to something generic.

Identification

Every title's opening was transcribed. This was not belt-and-braces — it corrected real errors that runtime and published listings could not:

  • Designing Middle-earth (41:13) and Weta Workshop (43:04) would have been filed under each other's names. The published listing carries no runtimes and the two are three minutes apart; only the transcripts separated them.
  • The Andy Serkis Animation Reference shares its entire soundtrack with another item on the same disc — the Sméagol/Gollum argument. Audio could not distinguish them. Frames could: Serkis in the motion-capture suit above, finished animation below, split-screen.
  • Two short films by Cameron Duncan — DFK6498 and Strike Zone — transcribe as a garbled number and as "(speaking in foreign language)" respectively, and would plausibly have been discarded as unidentifiable fragments. Duncan was a young New Zealand filmmaker who died at seventeen; Jackson included his work as a tribute and "Into the West" was written for him.

Where published listings did carry runtimes, disc durations matched within two seconds and the transcripts agreed independently — two confirmations rather than one.

The Costa Botes documentaries are credited in their filenames because they are separate works by a different filmmaker, not part of the Michael Pellerin-directed Appendices, and the distinction is invisible from a title list otherwise.

Names shared across films

Cameras in Middle-earth, Weta Digital, Miniatures, Music for Middle-earth and The Soundscapes of Middle-earth each exist in two or three versions, one per film. They are distinct documentaries, filed under their own films.


Notes on the discs

Every 4K disc exposes the feature twice — once as a playlist carrying chapters, once as a bare stream without them. Only the playlist was taken; roughly 480 GB of redundant duplicate features were skipped across the nine discs.

One Blu-ray exposes a third variant. On a disc outside this trilogy the second copy carried a DTS Express track — the Blu-ray secondary-audio codec — marking it as a picture-in-picture playlist rather than a plain duplicate. Worth checking the streams before assuming which copy to take.

The Return of the King extended Part 2 disc has a physical bad zone around the 29.9 GB mark. Cleaning did not help; a second pass produced more read errors than the first (22 against 12) including a drive-level hardware error. The rip is nonetheless correct: two independent passes that failed on different sectors produced byte-identical video and audio streams, which could not happen if data were being substituted. MakeMKV recovered the sectors on both attempts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment