npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

media-transcriber

v1.1.0

Published

Batch transcribe audio/video files using pluggable AI backends (Whisper, OpenAI API, and more)

Downloads

104

Readme

media-transcriber

Transcribe audio and video files to text and subtitles using pluggable AI backends, including local Whisper and the OpenAI Whisper API.

Quick Start

# Run directly with npx (no install)
npx media-transcriber doctor

# Or install globally
npm install -g media-transcriber

# Check readiness for the default local backend
media-transcriber doctor

# If readiness fails, run guided setup
media-transcriber setup whisper-local

# Transcribe a single file
media-transcriber transcribe ./meeting.mp4

# Transcribe a folder
media-transcriber transcribe ./data/input ./data/output

Requirements

  • Node.js >= 18
  • FFmpeg and ffprobe in PATH
    • Windows: winget install ffmpeg or scoop install ffmpeg
    • macOS: brew install ffmpeg
    • Linux: sudo apt install ffmpeg

Backend requirements:

  • whisper-local: A usable local Whisper installation. This can come from PATH, uv tool installs, pipx, pip, or an active Python environment. Use media-transcriber setup whisper-local for guided setup.
  • whisper-api: OpenAI API key (OPENAI_API_KEY env var or --api-key)

uv add openai-whisper is only appropriate inside a Python project. For general CLI setup, prefer a tool-style install such as uv tool install openai-whisper, pipx install openai-whisper, or python -m pip install -U openai-whisper.

Usage

Transcribe

# Single file, output written next to the input file
media-transcriber transcribe ./recordings/interview.mp4

# Single file, explicit output folder
media-transcriber transcribe ./recordings/interview.mp4 ./transcripts

# Folder input
media-transcriber transcribe ./recordings ./transcripts

# Preset, model, and device
media-transcriber transcribe ./data/input ./data/output --preset accurate
media-transcriber transcribe ./data/input ./data/output -m medium -d cpu

# Custom local Whisper command
media-transcriber transcribe ./meeting.mp4 --whisper-command "whisper"

# OpenAI API backend
media-transcriber transcribe ./data/input ./data/output -b whisper-api --api-key <key>

# Split long files before transcription
media-transcriber transcribe ./data/input ./data/output --split-threshold 900

# Enable audio enhancement
media-transcriber transcribe ./data/input ./data/output --enhance-audio

# Keep temporary files in ./data/output/temp
media-transcriber transcribe ./data/input ./data/output --keep-temp

# Output only subtitles
media-transcriber transcribe ./data/input ./data/output -f srt

# JSON output for agents
media-transcriber transcribe ./data/input ./data/output --json

Doctor

Check readiness for the default or selected transcription path:

media-transcriber doctor
media-transcriber doctor --backend whisper-api
media-transcriber doctor --backend whisper-api --api-key <key>
media-transcriber doctor --whisper-command "whisper"
media-transcriber doctor --all
media-transcriber doctor --json

Setup

Run guided setup when readiness fails:

media-transcriber setup whisper-local
media-transcriber setup whisper-api

Setup can offer to run package managers after confirmation, validates the result, and can run an optional smoke test. It does not write Media Transcriber config files or store API keys.

Execution Options

All parameters are passed at execution time (stateless CLI).

| Field | Type | Default | Description | | ---- | ---- | ---- | ---- | | input | string | required | Input file or folder | | output | string | optional for files, required for folders | Output folder | | backend | string | whisper-local | Transcription backend | | whisperModel | string | backend default | Model name | | preset | fast, balanced, or accurate | unset | Friendly quality preset | | device | auto, cuda, or cpu | auto | Processing device policy | | maxDurationSeconds | number | 1200 | Split files longer than this threshold | | enableAudioEnhancement | boolean | false | Enable enhancement filters | | keepIntermediateFiles | boolean | false | Keep temp files with --keep-temp | | tempFolder | string | <outputFolder>/temp | Temp working folder | | outputFormats | txt, srt, or both | txt,srt | Output transcript formats | | openaiApiKey | string | env/flag | API key for OpenAI backend | | localWhisperCommand | string | env/flag | Override command for local Whisper |

Commands

transcribe <input> [output]

  • Accepts either a single file or a directory.
  • For a single input file, [output] is optional. If omitted, output files are written next to the source file.
  • For a directory input, [output] is required.

Options:

  • -m, --model <name>: Backend model name
  • --preset <name>: Quality preset: fast, balanced, or accurate
  • -d, --device <type>: Processing device: auto, cuda, or cpu
  • -b, --backend <name>: Transcription backend
  • --split-threshold <seconds>: Split files longer than this duration before transcription
  • --enhance-audio: Apply audio enhancement before transcription
  • --keep-temp: Keep intermediate files in the temp folder
  • --api-key <key>: API key for API-based backends
  • --whisper-command <command>: Override local Whisper command; can also use MEDIA_TRANSCRIBER_WHISPER_COMMAND
  • -f, --format <formats>: Comma-separated output formats, such as txt, srt, or txt,srt
  • --json: Emit machine-readable output to stdout and NDJSON progress events to stderr

doctor

  • Checks ffmpeg and ffprobe
  • Shows system information
  • Checks readiness for the default backend, or a selected backend with --backend <name>
  • Accepts --api-key and --whisper-command so readiness can match a stateless transcribe invocation
  • Use --all to show backend inventory without making optional missing backends fatal
  • Use --json for machine-readable readiness output
  • Exits with a non-zero code when the selected/default transcription path is not ready

setup [backend]

  • Guides FFmpeg/ffprobe installation when missing
  • Guides local Whisper setup through uv tool, pipx, pip, or existing installs
  • Validates API credentials without storing secrets
  • Offers an optional smoke test after readiness succeeds

AI Agent Integration

Structured JSON

media-transcriber transcribe ./data/input ./data/output --json 2>/dev/null

Progress Events (stderr)

In --json mode, NDJSON progress events are emitted to stderr.

Example:

media-transcriber transcribe ./data/input ./data/output --json 1>result.json

Exit Codes

| Code | Meaning | | ---- | ------- | | 0 | Success (all files transcribed) | | 1 | General error | | 2 | Missing dependency | | 3 | Configuration/argument error | | 4 | No input files found | | 10 | Partial success |

Supported Formats

Input: .m4a, .mp3, .mp4, .mkv, .wav, .flac, .ogg, .webm

Output: .txt, .srt

Development

npm install
npm run dev
npm run typecheck
npm test
npm run build

Development workflow:

# Terminal 1: rebuild dist/ on changes
npm run dev

# Terminal 2: run the built CLI
node dist/index.js --help
node dist/index.js doctor
node dist/index.js transcribe ./test/input ./test/output

Available scripts:

npm run dev        # tsup --watch
npm run typecheck
npm test
npm run build

License

MIT