Skip to content

feat: mods give movies in WebM or Matroska - #1335

Merged
vdmkenny merged 2 commits into
mainfrom
feat/mod-movies-webm
Oct 24, 2026
Merged

vdmkenny merged 2 commits into
mainfrom
feat/mod-movies-webm

Conversation

@vdmkenny

Copy link
Copy Markdown
Collaborator

A mod can replace a Bink movie with a WebM or Matroska file of VP9 video, with Opus or Vorbis sound or none.

  • For name.bik, a mod's name.webm comes first, then name.mkv, then the Bink movie, as music takes the first of its formats.
  • src/formats/matroska.zig reads the container: tracks, clusters of known or unknown size, simple blocks and block groups, all three lacings.
  • FFmpeg's own VP9 decoder (profile 0, 8-bit 4:2:0) joins the static library, with CBS and the superframe split filter. Nothing new is linked.
  • A modern movie is drawn at the size of the Bink movie it replaces, read from its header alone, so a sharper movie lands in the same place, under --original too. One with nothing to replace is drawn at its own size.
  • Frames show at their own times, except where the game forces 15 frames a second (rooms, transitions, landing, ITAC).
  • Colours follow the video: BT.709 or full range where it says so, BT.601 limited otherwise.
  • A movie that can't be played is logged and the Bink plays; unknown sound codecs play silent with a warning. The mods log says replaces the movie warty_.bik.
  • Checked in the game: a 1280x960 WebM of the Warthog logo plays in the intro, fitted like the Bink.

Left for later: AV1 (#1334).

Closes #1179

… Vorbis sound

Mod makers work in modern formats, and a sharper movie made with an upscaler is easiest to ship as
WebM. For a movie name.bik, a mod's name.webm comes first, then name.mkv, then the Bink movie, as
music takes the first of its formats. OpenReliant reads the Matroska container itself and decodes
VP9 with FFmpeg's own decoder, so nothing new is linked. A modern movie is drawn at the size of the
Bink movie it replaces, read from that movie's header, and keeps the rates the rooms and the
transitions force, so it fits wherever the game's movie did. Its colours follow what the video
says, BT.709 or full range, and BT.601 otherwise. The mods log names the movie it replaces.

Closes #1179
The Matroska module joins the root's imports, so the suite always runs its tests. A movie's own
timing moves into its source, so the player never reads an inactive union field. The mods log's
lookups share one check of the game's files, the head readers mirror the stored readers and use
the standard library's Dir.readFile, and the movie player's log messages share one format.
@vdmkenny
vdmkenny merged commit aa9f972 into main Oct 24, 2026
4 checks passed
@vdmkenny
vdmkenny deleted the feat/mod-movies-webm branch October 24, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mods' movies in modern formats

1 participant