Skip to content

[DOCS] Desktop: captions track and the caption preset catalogue #696

Closed

Description

@edenreich

Summary

inference-gateway/desktop#288 (closes inference-gateway/desktop#279) adds captions to content projects: a captions track kind in <stem>.timeline.json, four style presets shared by the preview and the export, burned-in captions via a generated .ass file plus a sidecar .srt, and captions generation documented in the bundled video-editing skill.

Behavior to document:

  • Timeline contract: a track with "kind": "captions", a style preset name and an optional position (bottom default, center, top). Its clips have id, start, end, text and optional words (per-word { text, start, end } in absolute seconds). One captions track per timeline; caption clips never carry src or status. Unknown style names fall back to the default preset.
  • Preset catalogue: classic (white text on a dark band), bold (large uppercase with a thick outline), highlight (words pop to the accent colour as spoken and stay), karaoke (words fill as spoken, dim ahead of the playhead). highlight and karaoke need words; without it both render the whole line.
  • Editor: the captions lane sits with the overlay lanes above the video, the preset is a select on the lane header, and + on the lane inserts a caption at the playhead (starting after any clip the playhead sits in, so captions never overlap). Caption clips are edited in place in the inspector and move, trim and delete like the other kinds. "Speak this" turns a caption into a draft spoken clip with the same text and range for the existing TTS flow; the two tracks are independent afterwards.
  • Generation: the toolbar's captions button asks the agent; the video-editing skill takes the text from the spoken clips when the timeline has them, otherwise from the whisper transcript, in chunks of about 5 s and at most ~12 words, breaking at sentence ends and pauses. Word timing for the two word presets comes from a second whisper-cli -ml 1 pass.
  • Export: captions are burned in with subtitles=<stem>.ass chained onto the picture, one ASS style per preset, \k/\kf karaoke tags timed from words (a pause before a word gets its own tag). A sidecar export/<stem>.srt is written for platforms that accept uploaded subtitles. The ffmpeg check now also requires the subtitles filter (libass); a missing one is an error, not a silent skip.

Affected pages:

  • Desktop > Content projects > Timeline: add the captions track to the contract section, the preset catalogue and the editor description.
  • Desktop > Content projects > Skills: add the captions rules to the video-editing page.
  • Desktop > Troubleshooting: "Export fails with no ffmpeg with libass found" (install a full ffmpeg), "Highlight and Karaoke show a plain line" (the clips have no words).

Source: inference-gateway/desktop#288 (.agents/skills/video-editing/SKILL.md has the reference text).

Acceptance Criteria

  • The timeline contract page lists the captions track, style, position and every clip field above.
  • The preset catalogue is documented with which presets need words.
  • The video-editing skill page covers where caption text comes from and the chunking rules.
  • The troubleshooting page covers the libass prerequisite and the missing-words fallback.

Activity

  1. added
    documentation
    on Sep 18, 2026
  2. edenreich commented on Sep 18, 2026

    @edenreich
    ContributorAuthor

    Contract update after review feedback on inference-gateway/desktop#288:

    • The captions track also accepts x/y - the centre of the caption block as fractions of the frame, set by dragging the block on the preview. When both are set they win over position, and the export burns them in as {\an5\pos(X,Y)} instead of the style's alignment and margin. Double-clicking the block clears them back to position.
    • The four presets were pulled apart so they read as different looks rather than one look with different word colouring. Each now carries a size (fraction of the frame height), weight, case, outline (fraction of the font size) and colour: classic a broadcast subtitle on a translucent box, bold a huge uppercase yellow punch line with a thick outline, highlight white turning green per word as spoken and staying, karaoke dim until spoken then white.
  3. edenreich commented on Sep 19, 2026

    @edenreich
    ContributorAuthor

    @claude Can you review the changes in the actual repo and document the changes?

  4. inference-gateway-maintainer commented on Sep 19, 2026

    @inference-gateway-maintainer
    Contributor

    Claude finished @edenreich's task in 5m 6s —— View job • docs/issue-696-20260919-1812 • Create PR ➔


    Captions documented - PR #697

    • Read the issue and the docs repo layout
    • Review the real implementation on inference-gateway/desktop@main
    • Write the captions docs into desktop.md
    • Lint (lint:md), format (format:check), build - all pass
    • Commit and open the PR

    What I found reviewing the desktop repo

    The implementation has moved past the issue body. Captions are not burned in with libass or an .ass file any more:

    • backend/src/timeline.rs - "The burn-in itself is drawn on the canvas with the rest of the frame, so there is no ASS file and no libass any more". The ffmpeg check wants adelay, amix, apad and the libx264, aac encoders, and the error is "no ffmpeg that can mix audio and encode H.264 found".
    • frontend/lib/export.ts - the frontend composes every frame on a canvas at exactly n / fps and pushes raw RGBA into a waiting ffmpeg, so there is no video filter in the export at all.
    • frontend/lib/render.ts + timeline.ts - one renderer and one preset table for both the preview and the export, so they cannot drift.
    • .agents/skills/video-editing/SKILL.md - confirms the same: "Captions no longer need libass - the desktop draws them itself."

    So I documented what ships rather than the .ass pipeline, and the libass troubleshooting entry became the ffmpeg error users actually see.

    What went into desktop.md

    • Contract: a captions track in the sample JSON; the captions track kind; a field table for track style / position / x,y and clip id, start, end, text, words; one track per timeline, never src or status.
    • Preset catalogue: classic, bold, highlight, karaoke as four whole looks, with highlight and karaoke needing words and falling back to a plain line without it. Unknown names fall back to classic.
    • Editor: preset select on the lane header, + inserting at the playhead (after any caption the playhead sits in, so they never overlap), in-place text editing, drag to place / double-click to reset, Speak this, and the + Captions lane button.
    • Skill rules: text from the spoken clips or the whisper transcript, ~5 s and ~12 words per chunk breaking at sentence ends and pauses, the whisper-cli -ml 1 word pass only for the two word presets.
    • Export: the canvas pipeline, plus the export/<stem>.srt sidecar.
    • Troubleshooting: the ffmpeg prerequisite with the real error and checks, and Highlight/Karaoke showing a plain line.

    Two adjacent statements were corrected because captions made them contradictory: the ffmpeg scale/pad/overlay description, and the claim that a VP9 .webm card keeps its alpha on export (it does not - same renderer as the preview).

    Remaining drift in that section that I did not touch (fps, video clip scale/x/y, Fit and Fill, offset trims, multi-clip video track) is tracked in #698.

    | Branch

  5. moved this from Todo to In progress in 2026on Sep 19, 2026
  6. moved this from In progress to QA in 2026on Sep 19, 2026
  7. moved this from QA to Done in 2026on Sep 20, 2026
  8. inference-gateway-releaser commented on Sep 22, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.14 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions