@remotion/install-whisper-cppv4.0.115
With Whisper.cpp, you can transcribe audio locally on your machine.
This package provides easy to use cross-platform functions to install Whisper.cpp and a model.
- Remotion CLI
- npm
- bun
- pnpm
- yarn
npx remotion add @remotion/install-whisper-cpp
This assumes you are currently using v4.0.417 of Remotion.npm i --save-exact @remotion/install-whisper-cpp@4.0.417
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.417 of Remotion.pnpm i @remotion/install-whisper-cpp@4.0.417
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.417 of Remotion.bun i @remotion/install-whisper-cpp@4.0.417
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.This assumes you are currently using v4.0.417 of Remotion.yarn --exact add @remotion/install-whisper-cpp@4.0.417
Also update
remotion and all `@remotion/*` packages to the same version.Remove all
^ character in front of the version numbers of it as it can lead to a version conflict.Example usage
Install Whisper 1.5.5 (the latest version at the time of writing that we find works well and supports token-level timestamps) and the medium.en model to the whisper.cpp folder.
install-whisper.cpptsximportpath from 'path';import {downloadWhisperModel ,installWhisperCpp ,transcribe ,toCaptions } from '@remotion/install-whisper-cpp';importfs from 'fs';constto =path .join (process .cwd (), 'whisper.cpp');awaitinstallWhisperCpp ({to ,version : '1.5.5',});awaitdownloadWhisperModel ({model : 'medium.en',folder :to ,});// Convert the audio to a 16KHz wav file first if needed:// import {execSync} from 'child_process';// execSync('ffmpeg -i /path/to/audio.mp4 -ar 16000 /path/to/audio.wav -y');constwhisperCppOutput = awaittranscribe ({model : 'medium.en',whisperPath :to ,whisperCppVersion : '1.5.5',inputPath : '/path/to/audio.wav',tokenLevelTimestamps : true,});// Optional: Apply our recommended postprocessingconst {captions } =toCaptions ({whisperCppOutput ,});fs .writeFileSync ('captions.json',JSON .stringify (captions , null, 2));
Functions
License
MIT