{"record":{"id":"6a90e66c209fe056","repo":"remotion-dev/remotion","slug":"the-transcription-asset-must-be-audio-or-video","errorCode":null,"errorMessage":"The transcription asset must be audio or video.","messagePattern":"The transcription asset must be audio or video\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":506,"sourceCode":"\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnoRepeatNgramSize: {type: 'integer', minimum: 0, default: 0},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t\tannotations: {readOnlyHint: false},\n\t\t\t\t\texecute: async (input) => {\n\t\t\t\t\t\tif (!isOptionalPackageInstalled(WHISPER_WEBGPU_PACKAGE)) {\n\t\t\t\t\t\t\treturn missingOptionalPackageResult(WHISPER_WEBGPU_PACKAGE);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst assetPath = resolveAssetPath({\n\t\t\t\t\t\t\tassetPath: input.assetPath,\n\t\t\t\t\t\t\tcurrentContent: currentContentRef.current,\n\t\t\t\t\t\t\tstaticFiles: staticFilesRef.current,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconst fileType = getPreviewFileType(assetPath);\n\t\t\t\t\t\tif (fileType !== 'audio' && fileType !== 'video') {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t'The transcription asset must be audio or video.',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst whisper = await import('@remotion/whisper-webgpu');\n\t\t\t\t\t\tconst modelName = input.model ?? 'small.en';\n\t\t\t\t\t\tif (typeof modelName !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('model must be a string.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst model = whisper\n\t\t\t\t\t\t\t.getAvailableModels()\n\t\t\t\t\t\t\t.find((candidate) => candidate.name === modelName);\n\t\t\t\t\t\tif (!model) {\n\t\t\t\t\t\t\tthrow new Error(`Unknown Whisper model: ${modelName}.`);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst task = input.task ?? 'transcribe';","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L488-L524","documentation":"The WebMcp transcription tool resolves the asset then checks its preview file type. Whisper can only transcribe audio/video, so assets of other types (images, fonts, JSON, etc.) are rejected with this error.","triggerScenarios":"Calling the WebMcp transcribe tool with assetPath (or a selected Studio asset) pointing to a non-media file in public/ — e.g. a .png, .json, or .ttf file.","commonSituations":"Agents picking the wrong asset from public/; users selecting a thumbnail or data file in Studio; assets with misleading extensions (e.g. a .txt containing a transcript).","solutions":["Pass assetPath pointing at an audio or video file (e.g. .mp3, .wav, .mp4, .mov).","Select the correct media asset in Studio before invoking the tool.","If the source is a different format, convert it to audio first.","Verify the file's actual media type matches its extension."],"exampleFix":"// before\nawait tool.execute({assetPath: 'poster.png'});\n// after\nawait tool.execute({assetPath: 'voiceover.mp3'});","handlingStrategy":"validation","validationCode":"const fileType = getPreviewFileType(assetPath);\nif (fileType !== 'audio' && fileType !== 'video') {\n  throw new Error('Transcription requires an audio or video asset.');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await transcribeTool({assetPath});\n} catch (e) {\n  if (e.message.includes('must be audio or video')) {\n    chooseMediaAssetInstead();\n  }\n}","preventionTips":["Check getPreviewFileType before calling.","Keep media assets organized separately in public/.","Never point transcription at images/fonts/data files."],"tags":["mcp","media","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}