From 3031644607ba06ad5760b6f33c5cdea63eae4d75 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Wed, 5 Aug 2020 10:16:54 -0700 Subject: [PATCH] feat: Add Overlay API. fix!: Remove an internal API GetPublicKeys PiperOrigin-RevId: 325044572 --- .../video/transcoder/v1beta1/resources.proto | 103 ++++++++++++++++++ .../transcoder_grpc_service_config.json | 3 +- 2 files changed, 104 insertions(+), 2 deletions(-) diff --git a/google/cloud/video/transcoder/v1beta1/resources.proto b/google/cloud/video/transcoder/v1beta1/resources.proto index 84bb3e1b..f3f4b884 100644 --- a/google/cloud/video/transcoder/v1beta1/resources.proto +++ b/google/cloud/video/transcoder/v1beta1/resources.proto @@ -163,6 +163,9 @@ message JobConfig { // List of output sprite sheets. repeated SpriteSheet sprite_sheets = 9; + + // List of overlays on the output video, in descending Z-order. + repeated Overlay overlays = 10; } // Input asset. @@ -353,6 +356,106 @@ message SpriteSheet { } } +// Overlay configuration. +message Overlay { + // 2D normalized coordinates. Default: `{0.0, 0.0}` + message NormalizedCoordinate { + // Normalized x coordinate. + double x = 1; + + // Normalized y coordinate. + double y = 2; + } + + // Overlaid jpeg image. + message Image { + // Required. URI of the image in Cloud Storage. For example, + // `gs://bucket/inputs/image.jpeg`. + string uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Normalized image resolution, based on output video resolution. Valid + // values: `0.0`–`1.0`. To respect the original image aspect ratio, set + // either `x` or `y` to `0.0`. To use the original image resolution, set + // both `x` and `y` to `0.0`. + NormalizedCoordinate resolution = 2; + + // Target image opacity. Valid values: `1` (solid, default), + // `0` (transparent). + double alpha = 3; + } + + // Display static overlay object. + message AnimationStatic { + // Normalized coordinates based on output video resolution. Valid + // values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay + // object. + NormalizedCoordinate xy = 1; + + // The time to start displaying the overlay object, in seconds. Default: 0 + google.protobuf.Duration start_time_offset = 2; + } + + // Display overlay object with fade animation. + message AnimationFade { + // Required. Type of fade animation: `FADE_IN` or `FADE_OUT`. + FadeType fade_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Normalized coordinates based on output video resolution. Valid + // values: `0.0`–`1.0`. `xy` is the upper-left coordinate of the overlay + // object. + NormalizedCoordinate xy = 2; + + // The time to start the fade animation, in seconds. Default: 0 + google.protobuf.Duration start_time_offset = 3; + + // The time to end the fade animation, in seconds. Default: + // `start_time_offset` + 1s + google.protobuf.Duration end_time_offset = 4; + } + + // End previous overlay animation from the video. Without AnimationEnd, the + // overlay object will keep the state of previous animation until the end of + // the video. + message AnimationEnd { + // The time to end overlay object, in seconds. Default: 0 + google.protobuf.Duration start_time_offset = 1; + } + + // Animation types. + message Animation { + // Animations can be static or fade, or they can end the previous animation. + oneof animation_type { + // Display static overlay object. + AnimationStatic animation_static = 1; + + // Display overlay object with fade animation. + AnimationFade animation_fade = 2; + + // End previous animation. + AnimationEnd animation_end = 3; + } + } + + // Fade type for the overlay: `FADE_IN` or `FADE_OUT`. + enum FadeType { + // The fade type is not specified. + FADE_TYPE_UNSPECIFIED = 0; + + // Fade the overlay object into view. + FADE_IN = 1; + + // Fade the overlay object out of view. + FADE_OUT = 2; + } + + // Image overlay. + Image image = 1; + + // List of Animations. The list should be chronological, without any time + // overlap. + repeated Animation animations = 2; +} + // Preprocessing configurations. message PreprocessingConfig { // Color preprocessing configuration. diff --git a/google/cloud/video/transcoder/v1beta1/transcoder_grpc_service_config.json b/google/cloud/video/transcoder/v1beta1/transcoder_grpc_service_config.json index 92e4b90e..32cd3927 100644 --- a/google/cloud/video/transcoder/v1beta1/transcoder_grpc_service_config.json +++ b/google/cloud/video/transcoder/v1beta1/transcoder_grpc_service_config.json @@ -19,8 +19,7 @@ { "service": "google.cloud.video.transcoder.v1beta1.TranscoderService", "method": "CreateJobTemplate" }, { "service": "google.cloud.video.transcoder.v1beta1.TranscoderService", "method": "ListJobTemplates" }, { "service": "google.cloud.video.transcoder.v1beta1.TranscoderService", "method": "GetJobTemplate" }, - { "service": "google.cloud.video.transcoder.v1beta1.TranscoderService", "method": "DeleteJobTemplate" }, - { "service": "google.cloud.video.transcoder.v1beta1.TranscoderService", "method": "GetPublicKeys" } + { "service": "google.cloud.video.transcoder.v1beta1.TranscoderService", "method": "DeleteJobTemplate" } ], "timeout": "60s" }]