Overview
Creating a simple video transcriber using OpenAI’s Whisper API and the popular JavaScript library ffmpeg.
Project Setup
Dependencies
- ffmpeg
- OpenAI’s Whisper library
- fs-extra to work with file system
Logic
- Extract audio from the video file first using
fluent-ffmpeg
- Use the Whisper API to transcribe the audio file
- Bring it all together as a simple app
Code
- Initialize the project
> mkdir whisper-transcriber > cd whisper-transcriber > npm init -y
- Install the necessary dependencies
> npm install openai fluent-ffmpeg fs-extra dotenv