我已将视频上传到Google的Cloud Storage存储桶,并在Video Intelligence API中引用了它们的URL。当我尝试获取上载视频的视频时长时,Video Intelligence API不会返回任何内容。
这是我使用的代码:
require "google/cloud/video_intelligence"
video_intelligence_client = Google::Cloud::VideoIntelligence.new
features_element = :LABEL_DETECTION
features = [features_element]
operation = video_intelligence_client.annotate_video input_uri: input_uri, features: features
p "PROCESSING......"
p operation
raise operation.results.message? if operation.error?
operation.wait_until_done!
metadata = operation.metadata
puts metadata
是否可以使用Video Intelligence API获取视频时长?另外,我应该如何从Google Cloud Storage API中获取它?
答案 0 :(得分:0)