Как получить длительность видео для видео в Google Cloud Storage - PullRequest
5 голосов
/ 08 июля 2019

Я загрузил видео в корзину Google Cloud Storage и сослался на их URL в API Video Intelligence. Когда я попытался определить продолжительность видео для загруженного видео, API-интерфейс Video Intelligence ничего не возвращает.

Это код, который я использовал:

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?

...