Skip to content

feat: file transcription core (ffmpeg convert, whisper segments, srt/vtt export)#32

Merged
ElbertePlinio merged 2 commits into
mainfrom
feat/file-transcription-core
Jul 9, 2026
Merged

feat: file transcription core (ffmpeg convert, whisper segments, srt/vtt export)#32
ElbertePlinio merged 2 commits into
mainfrom
feat/file-transcription-core

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

Refs #30 — PR 1 of 2 (core library slice; PR 2 adds the Tauri commands + UI).

What changed

  • src/engine/media.rs (new): ffmpeg resolution with actionable error, cancellable conversion of any audio/video file to 16 kHz mono s16 WAV (partial output + logs removed on cancel/failure), WAV duration reader for history.
  • src/engine/transcript.rs (new): FileSegment, whisper --output-json parsing (drops non-speech markers), TXT/SRT/VTT formatters — pure and unit-tested, so exports can be regenerated from History at any time.
  • src/engine/stt.rs: transcribe_file_with_cancel — whisper-cli with --output-json --print-progress --no-prints, progress callback parsed from the stderr log tail (UTF-8-lossy), same cancel/cleanup discipline as the existing dictation path (untouched).
  • src/history.rs: additive migration adding nullable source_file + segments_json (guarded ALTER TABLE for legacy DBs, columns in CREATE TABLE for fresh ones); insert/list updated.
  • src-tauri/src/engine.rs: dictation insert passes None for the two new fields — no behavior change.

Tested

  • cargo test --workspace --locked --all-targets: 74 passed (baseline 67; new tests cover JSON parsing, SRT/VTT exact output incl. >1 h rollover, WAV duration, progress-line parsing, legacy-DB migration + fresh-DB round-trips).
  • Live checks against the installed whisper-cli: output filename convention (<prefix>.json appending), progress = N% stderr format, and that --no-prints keeps progress lines.

Not tested yet

No user-facing change; release notes drafted under Internal in docs/releases/UNRELEASED.md.

@ElbertePlinio

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 6c07135a2b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ElbertePlinio ElbertePlinio merged commit 16510f5 into main Jul 9, 2026
1 check passed
@ElbertePlinio ElbertePlinio deleted the feat/file-transcription-core branch July 9, 2026 21:47
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