谷歌云视频智能语音转录

时间:2021-01-22 12:30:39

标签: google-cloud-platform google-cloud-speech video-intelligence-api

我尝试通过 Video Inteligence 使用语音转录,但出现以下错误:

input_uri: "/supereye1.appspot.com/video/8rsxVe23pzQ/videofile.mp4"
error {
  code: 3
  message: "Invalid SpeechTranscription request argument(s)."
}
segment {
  start_time_offset {
  }
  end_time_offset {
    nanos: 673378000
  }
}

这是我的代码:

video_client = videointelligence.VideoIntelligenceServiceClient()
features = [videointelligence.enums.Feature.OBJECT_TRACKING,
            videointelligence.enums.Feature.TEXT_DETECTION,
            videointelligence.enums.Feature.SPEECH_TRANSCRIPTION,
            videointelligence.enums.Feature.SHOT_CHANGE_DETECTION]
operation = video_client.annotate_video(gs_video_path, features=features)

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

以下设置是使用 Google Cloud 进行语音转录的先决条件。

现在,我在通话之前设置了它们,我可以成功执行视频智能通话。

config = videointelligence.types.SpeechTranscriptionConfig(
    language_code = "en-GB",
    enable_automatic_punctuation=True,
)
context = videointelligence.types.VideoContext(
    segments=None,
    speech_transcription_config=config,
)