【问题标题】:Handling Long Running Task in Cloud Function - Google Cloud Video Intelligence API在 Cloud Function 中处理长时间运行的任务 - Google Cloud Video Intelligence API
【发布时间】:2019-10-19 16:31:43
【问题描述】:

我们目前在视频中使用cloud intelligence api 表示tracking objects,但对于大型视频,这可能需要超过 10 分钟。

我很好奇 Google Cloud 产品是否有任何功能可以在作业完成后发布到各种发布/订阅队列。

似乎唯一的 API 让我们等待await operation.promise()

亚马逊有一个解决方案可以让函数进入睡眠状态,你可以稍后检查工作是否完成。

有人知道这是否适用于 Google 吗?

  const [operation] = await video.annotateVideo(request);
  console.log('Waiting for operation to complete...');
  const [operationResult] = await operation.promise();
  // Gets shot changes
  let shotChanges = operationResult.annotationResults[0];

【问题讨论】:

    标签: node.js google-cloud-platform video-intelligence-api


    【解决方案1】:

    您可以指定outputUri,它将结果写入您的 GCS 存储桶。如果您这样做,您的方法将不必等待。

    然后您可以在输出 GCS 存储桶上设置一个触发器来处理结果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-11
      • 2021-09-04
      • 1970-01-01
      • 2019-03-23
      • 1970-01-01
      • 2019-12-13
      • 2018-09-25
      • 1970-01-01
      相关资源
      最近更新 更多