remotion-dev/remotion · error · Error

Input file does not exist at ${inputPath}

Error message

Input file does not exist at ${inputPath}

What it means

The transcribe() function from @remotion/install-whisper-cpp verifies that the input audio file exists at inputPath before proceeding. After confirming whisper exists, it checks fs.existsSync(inputPath) and throws if the wav file is missing. This prevents launching the whisper process against a non-existent file.

Source

Thrown at packages/install-whisper-cpp/src/transcribe.ts:321

	modelFolder?: string;
	translateToEnglish?: boolean;
	printOutput?: boolean;
	tokensPerItem?: true extends HasTokenLevelTimestamps ? never : number | null;
	language?: Language | null;
	splitOnWord?: boolean;
	signal?: AbortSignal;
	onProgress?: TranscribeOnProgress;
	flashAttention?: boolean;
	additionalArgs?: AdditionalArgs;
}): Promise<TranscriptionJson<HasTokenLevelTimestamps>> => {
	if (!existsSync(whisperPath)) {
		throw new Error(
			`Whisper does not exist at ${whisperPath}. Double-check the passed whisperPath. If you havent installed whisper, check out the installWhisperCpp() API at https://www.remotion.dev/docs/install-whisper-cpp/install-whisper-cpp to see how to install whisper programatically.`,
		);
	}

	if (!existsSync(inputPath)) {
		throw new Error(`Input file does not exist at ${inputPath}`);
	}

	if (!isWavFile(inputPath)) {
		throw new Error(
			'Invalid inputFile type. The provided file is not a wav file! Convert the file to a 16KHz wav file first: "ffmpeg -i input.mp4 -ar 16000 output.wav -y"',
		);
	}

	const tmpJSONDir = path.join(process.cwd(), 'tmp');

	const {outputPath: tmpJSONPath} = await transcribeToTemporaryFile({
		fileToTranscribe: inputPath,
		whisperPath,
		whisperCppVersion,
		model,
		tmpJSONPath: tmpJSONDir,
		modelFolder: modelFolder ?? null,
		translate: translateToEnglish,

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Verify the file exists with fs.existsSync(inputPath) before calling transcribe(), and log the absolute path via path.resolve(inputPath) to catch working-directory issues.
  2. Ensure any upstream step that generates the wav file (e.g. ffmpeg conversion, media download) completed successfully and wrote to the expected location.
  3. Use an absolute path for inputPath rather than a relative one to avoid cwd ambiguity.
  4. Check file permissions and that the path is accessible from the process running transcribe().

Example fix

// before
await transcribe({
  inputPath: './tmp/audio.wav', // may not exist from this cwd
  whisperPath,
  whisperCppVersion: 'v1.5.4',
  model: 'base.en',
  tokenLevelTimestamps: false,
});

// after
const inputPath = path.resolve('./tmp/audio.wav');
if (!fs.existsSync(inputPath)) {
  throw new Error(`Expected wav file not found at ${inputPath}`);
}
await transcribe({
  inputPath,
  whisperPath,
  whisperCppVersion: 'v1.5.4',
  model: 'base.en',
  tokenLevelTimestamps: false,
});
Defensive patterns

Strategy: validation

Validate before calling

import fs from 'fs';
import path from 'path';

function assertInputFileExists(inputPath: string): void {
  const abs = path.resolve(inputPath);
  if (!fs.existsSync(abs)) {
    throw new Error(`Input file not found at resolved path: ${abs}`);
  }
}

// Before calling transcribe():
assertInputFileExists(inputPath);

Type guard

import fs from 'fs';

function isExistingFile(p: string): boolean {
  try {
    return fs.statSync(p).isFile();
  } catch {
    return false;
  }
}

Try / catch

try {
  await transcribe({inputPath, whisperPath, ...});
} catch (err) {
  if (err instanceof Error && err.message.includes('Input file does not exist')) {
    // Regenerate the wav file or fix the path, then retry
    throw new Error(`Transcription aborted: input file missing. Verify upstream ffmpeg/download step.`);
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling transcribe({inputPath, ...}) where inputPath does not point to an existing file. Common causes include a typo in the path, a relative path resolved from the wrong working directory, a file that was generated in a prior step that failed or was cleaned up, or a path to a file on a different machine/instance.

Common situations: Audio conversion step (ffmpeg) produced an output to a different path than expected; temp file was garbage-collected before transcription runs; path uses a different separator or case on case-sensitive filesystems; inputPath was never generated because the upstream media download or extraction failed silently.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/ec1bfb150174cb70. Report an issue: GitHub.