A simple Electron application to transcribe and translate video files using OpenAI's Whisper API.
- Load local video files.
- Extract audio using ffmpeg.
- Transcribe audio using OpenAI Whisper.
- Display transcript synchronized with video playback.
- Highlight words in the transcript as they are spoken.
- Prompts for OpenAI API key on first run and stores it securely.
- Node.js and npm (or yarn)
- An OpenAI API Key
- Clone the repository (or download the source code).
- Navigate to the project directory in your terminal.
- Install dependencies:
npm install
To run the application locally for development:
npm start
The application will launch, and you may be prompted for your OpenAI API key if it's the first time or the key is invalid.
To build the application package (e.g., for macOS, Windows, Linux):
npm run build
This command uses electron-builder
to create distributable files in the dist/
directory based on the configuration in package.json
.
- Icons: Place your custom icons (
icon.icns
,icon.ico
,icon.png
) in thebuild/
directory before running the build command. - Output: For macOS, this command (as currently configured) creates a
.zip
file and a directory containing the.app
bundle (e.g.,dist/mac-arm64/
).
To create a user-friendly .pkg
installer for macOS that handles permissions correctly for unsigned apps:
-
Ensure the app is built: Run
npm run build
first to generate the.app
bundle (e.g., indist/mac-arm64/
). -
Ensure the postinstall script exists: Make sure
scripts/postinstall
exists and is executable (chmod +x scripts/postinstall
). This script runsxattr -cr
on the installed application. -
Ensure the component plist exists: Make sure
component.plist
exists in the project root, correctly referencing the app bundle details. -
Run pkgbuild: Execute the following command in the project root directory:
pkgbuild --root "dist/mac-arm64/" \ --component-plist "component.plist" \ --install-location "/Applications" \ --scripts "scripts" \ --version "1.0.0" \ --identifier "com.yourapp.videotranscriber.pkg" \ dist/VideoTranscriberInstaller-1.0.0.pkg
- (Adjust
--root
,--version
, and--identifier
if necessary)
- (Adjust
-
Distribute: Share the generated
dist/VideoTranscriberInstaller-*.pkg
file.
This installer will copy the application to /Applications
and run the post-install script to remove the quarantine attribute, allowing users to run the unsigned app after installation (they might still need to right-click -> Open the very first time).