You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Cloud Video Intelligence多特征标注异常:仅返回最后一个特征结果

问题解答

Google Cloud Video Intelligence支持同时请求多个标注特征,并非一次只能执行单个操作。你遇到的问题大概率是因为请求中缺少SPEECH_TRANSCRIPTION必需的配置参数,导致服务未正确处理TEXT_DETECTION的请求,或者返回的结果中该特征无匹配内容。

解决步骤:

  • 必须为SPEECH_TRANSCRIPTION添加speechTranscriptionConfig配置,指定语言代码等关键参数,示例代码修改如下:
const gcsUri = 'gs://path-to-the-video-on-gcs'
const request = {
  inputUri: gcsUri,
  features: ['TEXT_DETECTION', 'SPEECH_TRANSCRIPTION'],
  speechTranscriptionConfig: {
    languageCode: 'en-US', // 根据你的视频语言调整,比如'zh-CN'
    enableAutomaticPunctuation: true
  }
};

// Detects text in a video
const [operation] = await video.annotateVideo(request);
const [operationResult] = await operation.promise();

const annotationResult = operationResult.annotationResults[0]
const textAnnotations  = annotationResult.textAnnotations
const speechTranscriptions  = annotationResult.speechTranscriptions

console.log(textAnnotations)
console.log(speechTranscriptions)
  • 确认你的视频中确实包含可被检测的文本内容(比如画面中的字幕、标识等),排除因视频本身无文本导致结果为空的情况。
  • 检查operationResult.annotationResults数组是否有多个元素,部分场景下视频分段处理会生成多个结果条目,可遍历数组确认所有结果。

内容的提问来源于stack exchange,提问作者Chukwuma Nwaugha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 10:10:26