Reference documentation and code samples for the Cloud Video Intelligence V1p3beta1 API class Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client.
Client for the StreamingVideoIntelligenceService service.
Service that implements streaming Video Intelligence API.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the StreamingVideoIntelligenceService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all StreamingVideoIntelligenceService clients ::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the StreamingVideoIntelligenceService Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#initialize
def initialize() { |config| ... } -> Client
Create a new StreamingVideoIntelligenceService client object.
- (config) — Configure the StreamingVideoIntelligenceService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client.new do |config| config.timeout = 10.0 end
#streaming_annotate_video
def streaming_annotate_video(request, options = nil) { |response, operation| ... } -> ::Enumerable<::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoResponse>
Performs video annotation with bidirectional streaming: emitting results while sending video/audio bytes. This method is only available via the gRPC API (not REST).
- request (::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoRequest, ::Hash>) — An enumerable of Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoRequest instances.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
- (response, operation) — Access the result along with the RPC operation
- response (::Enumerable<::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoResponse>)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/video_intelligence/v1p3beta1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client.new # Create an input stream input = Gapic::StreamInput.new # Call the streaming_annotate_video method to start streaming. output = client.streaming_annotate_video input # Send requests on the stream. For each request, pass in keyword # arguments to set fields. Be sure to close the stream when done. input << Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoRequest.new input << Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoRequest.new input.close # Handle streamed responses. These may be interleaved with inputs. # Each response is of type ::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoResponse. output.each do |response| p response end