{"record":{"id":"ec1bfb150174cb70","repo":"remotion-dev/remotion","slug":"input-file-does-not-exist-at-inputpath","errorCode":null,"errorMessage":"Input file does not exist at ${inputPath}","messagePattern":"Input file does not exist at (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/install-whisper-cpp/src/transcribe.ts","lineNumber":321,"sourceCode":"\tmodelFolder?: string;\n\ttranslateToEnglish?: boolean;\n\tprintOutput?: boolean;\n\ttokensPerItem?: true extends HasTokenLevelTimestamps ? never : number | null;\n\tlanguage?: Language | null;\n\tsplitOnWord?: boolean;\n\tsignal?: AbortSignal;\n\tonProgress?: TranscribeOnProgress;\n\tflashAttention?: boolean;\n\tadditionalArgs?: AdditionalArgs;\n}): Promise<TranscriptionJson<HasTokenLevelTimestamps>> => {\n\tif (!existsSync(whisperPath)) {\n\t\tthrow new Error(\n\t\t\t`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.`,\n\t\t);\n\t}\n\n\tif (!existsSync(inputPath)) {\n\t\tthrow new Error(`Input file does not exist at ${inputPath}`);\n\t}\n\n\tif (!isWavFile(inputPath)) {\n\t\tthrow new Error(\n\t\t\t'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\"',\n\t\t);\n\t}\n\n\tconst tmpJSONDir = path.join(process.cwd(), 'tmp');\n\n\tconst {outputPath: tmpJSONPath} = await transcribeToTemporaryFile({\n\t\tfileToTranscribe: inputPath,\n\t\twhisperPath,\n\t\twhisperCppVersion,\n\t\tmodel,\n\t\ttmpJSONPath: tmpJSONDir,\n\t\tmodelFolder: modelFolder ?? null,\n\t\ttranslate: translateToEnglish,","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/install-whisper-cpp/src/transcribe.ts#L303-L339","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","Ensure any upstream step that generates the wav file (e.g. ffmpeg conversion, media download) completed successfully and wrote to the expected location.","Use an absolute path for inputPath rather than a relative one to avoid cwd ambiguity.","Check file permissions and that the path is accessible from the process running transcribe()."],"exampleFix":"// before\nawait transcribe({\n  inputPath: './tmp/audio.wav', // may not exist from this cwd\n  whisperPath,\n  whisperCppVersion: 'v1.5.4',\n  model: 'base.en',\n  tokenLevelTimestamps: false,\n});\n\n// after\nconst inputPath = path.resolve('./tmp/audio.wav');\nif (!fs.existsSync(inputPath)) {\n  throw new Error(`Expected wav file not found at ${inputPath}`);\n}\nawait transcribe({\n  inputPath,\n  whisperPath,\n  whisperCppVersion: 'v1.5.4',\n  model: 'base.en',\n  tokenLevelTimestamps: false,\n});","handlingStrategy":"validation","validationCode":"import fs from 'fs';\nimport path from 'path';\n\nfunction assertInputFileExists(inputPath: string): void {\n  const abs = path.resolve(inputPath);\n  if (!fs.existsSync(abs)) {\n    throw new Error(`Input file not found at resolved path: ${abs}`);\n  }\n}\n\n// Before calling transcribe():\nassertInputFileExists(inputPath);","typeGuard":"import fs from 'fs';\n\nfunction isExistingFile(p: string): boolean {\n  try {\n    return fs.statSync(p).isFile();\n  } catch {\n    return false;\n  }\n}","tryCatchPattern":"try {\n  await transcribe({inputPath, whisperPath, ...});\n} catch (err) {\n  if (err instanceof Error && err.message.includes('Input file does not exist')) {\n    // Regenerate the wav file or fix the path, then retry\n    throw new Error(`Transcription aborted: input file missing. Verify upstream ffmpeg/download step.`);\n  }\n  throw err;\n}","preventionTips":["Use absolute paths (path.resolve) for inputPath to avoid cwd mismatches.","Verify the upstream audio conversion/download step completed before transcription.","Add a pre-flight fs.existsSync() check with a descriptive error.","Avoid passing temp files that may be cleaned up by another process."],"tags":["install-whisper-cpp","filesystem","validation","precondition","input-file"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}