Skip to content

Proofread: transcribe a video and translate the transcript to editable SRTs - #84

Merged
spencer-zqian merged 2 commits into
mainfrom
feat/proofread
Sep 18, 2026
Merged

spencer-zqian merged 2 commits into
mainfrom
feat/proofread

Conversation

@spencer-zqian

Copy link
Copy Markdown
Contributor

Summary

Adds the new POST /v1/proofread endpoint to sonilo and sonilo-cli, the TypeScript twin of sonilo-ai/sonilo-python#45. Proofread transcribes a video and translates the transcript into editable .srt files, one per requested language plus the detected source language. It is the step before dubbing: correct the wording, then pass the files to dubbing as subtitles[<language>].

  • Core: client.proofread.submit(...) / generate(...) with exactly one of video / videoUrl (https), optional languages (sent as the JSON-array string part) and sourceLanguage; language codes are not validated client-side (server-owned, like dubbing).
  • Result: ProofreadResult with subtitles (language → URL), source_language, cue_count, warnings (language → ProofreadIssue[]), snake_case like every other result type here. No save helpers, matching DubbingResult.
  • CLI: sonilo proofread --video clip.mp4 --languages ja,zh_cn --output scripts/clip.srt writes scripts/clip.<lang>.srt through the same --output template as dubbing, then prints the source language, cue count and one line per warning.
  • Docs: both READMEs gain a Proofread section (billing: video seconds × target languages, transcript-only counts as one, $0.001/sec, 10 sec floor, 2 free trial calls; 300 sec / 300 MB limits; must have an audio track).
  • Changeset: sonilo minor, sonilo-cli minor.

Test plan

  • npm ci && npm run lint && npm run build && npm test: cli 205, sonilo 237 (13 new), video-kit 137 pass.
  • Result parsing verified against a real finished-task envelope from prod, typed as ProofreadResult.
  • No vendor names in the diff.

…e SRTs

Adds client.proofread (submit/generate) for POST /v1/proofread, mirroring
dubbing's shape: multipart with exactly one of video / videoUrl (https only,
checked locally because the pipeline rejects plain http), optional languages
sent as a JSON-array form field and omitted when unset — omitting it is what
asks for the source-language transcript alone — and optional sourceLanguage.
Language codes are not validated client-side; the server owns that list.

ProofreadResult carries subtitles (language -> .srt URL, always including the
detected source_language), source_language, cue_count and warnings, a map of
language to non-blocking ProofreadIssue (cue, code, severity, plus whatever
measurement the server-owned code brought with it). No save helpers, because
DubbingResult has none in this SDK either.

CLI: `sonilo proofread` with --video/--video-url, --languages,
--source-language and --output, a filename template defaulting to
proofread.srt that writes one .srt per language with the code inserted before
the extension (scripts/clip.srt -> scripts/clip.en.srt) and creates missing
directories. It then prints the detected source language, the cue count and
one line per warning, and waits with the SDK's normal default timeout rather
than dubbing's two hours.
@lightsage-app

lightsage-app Bot commented Sep 18, 2026

Copy link
Copy Markdown

Lightsage docs evals

Waiting for the staging docs URL before running evals.

Lightsage will start the selected PR evals automatically when GitHub reports a successful docs deployment for this PR. This usually happens within 15 minutes.

Commit: 54394f9
Status: waiting for staging docs URL

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.

1 participant