Repository navigation
feat: Add Whisper speech-to-text captioning for video and audio (.srt) - #774
rohitLovesKrishna wants to merge 4 commits into
Conversation
…itle burn-in - Add Whisper speech recognition converter (WhisperConverter) integrating whisper-cli and GGML models - Support multi-source discovery (Filee engines folder, own copies, ChiCaption, system PATH) - Extract 16kHz mono audio WAV, transcribe speech to SRT in any language, and burn high-visibility yellow subtitles (&H0000FFFF) with black outline - Register whisper package and model in engines.json with on-demand download support in Settings and first-run setup - Add 'caption-video' preset to video toolbar donut profile and library - Expose 'Caption' option in PresetEditorView and ViewModel for video targets - Add unit tests for caption route planning and Whisper engine metadata
…agari restoration
KnifeLemon
left a comment
There was a problem hiding this comment.
Thanks a lot for this, @rohitLovesKrishna! Captions from speech would be a great addition to Filee, and the demo video looks good. I'd like to get this merged, but a few basics need fixing first. I've approved the CI run, so you'll see the results on this PR.
Must fix
-
Existing translations are deleted. In all 18
i18n/*.jsonfiles the diff removes keys that are onmain:crop.perspective,crop.perspective_tip,crop.perspective_pdf,crop.hint_keys_perspectivecrop.corner_*
It also re-indents the
toolbar.chip_tip.*block. Please rebase onmainand only add the new keys. Each language also needs the new strings translated:fr.json,ko.jsonand the others currently have the English text. -
No paths from other apps.
LocateCliandLocateModelsearchD:\ChiCaption\…,%LOCALAPPDATA%\ChiCaption\…and%LOCALAPPDATA%\Filee\models. Filee should only use its own engine folder, the user's own copy (Settings → Engines) andPATH. The same goes for FFmpeg: useFfmpegConverter.Locate(), and when FFmpeg is missing say so. Don't fall back to a bare"ffmpeg". -
Remove the Urdu → Devanagari rewrite.
UrduToDevanagariruns on every transcript that contains Perso-Arabic letters. That turns real Urdu (and possibly Arabic or Persian) subtitles into Devanagari, which is wrong for those users. If Hindi comes out in Urdu script, set the language instead: whisper.cpp's-l hi. A "spoken language" option on the preset (defaultauto) would cover every language the same way. -
Pin the model download.
huggingface.co/…/resolve/main/ggml-base.bincan change under the same URL, and then the SHA-256 check fails for everyone. Please use a commit URL (resolve/<commit>/ggml-base.bin). -
macOS and Linux.
whisper-bin-x64.zipis Windows only. On other platforms the package and the Caption slice should not be offered, and the engine should reportengine.reason.unsupported_platformthe way other Windows-only engines do. Please say in the PR what macOS and Linux show. -
One scope per PR. The preset makes SRT, but the converter also has a video → MP4 burn-in edge (
Cost: 14). It also has a second audio → SRT edge without theCaptionflag, so any audio → SRT route goes through Whisper. Please keep this PR to SRT only and remove both. Burn-in can be its own PR later. The doc comments inIConverter.csandRoutePlanner.cssay "burns styled captions into the video" and need the same change. -
Schema migration.
AddCaptionPresetstill carries leftovers from an earlier version: the{name}_captionedcheck, the preset added in two places, andOffercalled as well as the manual inserts. Please reduce it to what the other migrations do:- add the preset;
Offerit to the video and audio profiles;- add a test that a v56 library learns it once.
One note: #705 also needs a schema step. Whichever lands second moves to the next number.
Also needed
THIRD-PARTY-NOTICES.md: add whisper.cpp (MIT) and the ggml Whisper model (MIT).docs/ENGINES.md: a short Whisper section covering the download size (~150 MB with the model), that it runs offline, and the need for FFmpeg.
Results
When you push the changes, please add to the PR:
- a screenshot of Settings → Engines with the Whisper package;
- the donut with the Caption slice;
- the
.srtfrom a short English clip and from one other language (Hindi is fine), with the CLI command or the steps you used.
Thanks again! Tag me when it's ready for another look.
3455a41 to
9f64f2d
Compare
9f64f2d to
7554dee
Compare
feat: Add Whisper speech-to-text captioning for video and audio (.srt) (Continues #774)
2026-10-29.21-49-12_compressed.mp4
Summary
This PR introduces speech-to-text AI captioning for both video and audio files using Whisper (
whisper.cpp). It allows users to drop video or audio files onto the Caption preset slice on the donut to generate.srtsubtitle files directly.Key Changes
Whisper Engine Integration:
whispertoengines.jsonand engine download/environment infrastructure.WhisperConverter(src/Filee.Engines/Media/WhisperConverter.cs) usingwhisper-cli.exewith automatic 16kHz mono audio extraction via FFmpeg.Direct SRT Subtitle Output:
caption-videopreset configured with target formatsrt..srtsubtitle files in the target directory (e.g.,sample.mp4->sample.srt).Hindi Devanagari Script Transliteration (
UrduToDevanagari):Settings & Schema Migration:
57with migrations ensuring existing user profiles receive the caption preset on their video and audio profiles without resetting customizations.Localization & Testing:
ar,de,en,es,fr,hi,it,ja,ko,ne,pl,pt-BR,pt-PT,ru,th,tr,zh-CN,zh-TW).CaptionRouteTests.csandWhisperTests.cs. All unit test suites pass (730+ tests).Verification
filee-cli convertand within the desktop UI for both video (.mp4) and audio (.wav) files..srtoutput and Hindi Devanagari subtitle correctness.