Skip to content

Commit 874ec6a

Browse files
Google APIscopybara-github
authored andcommitted
feat: added TimecodeConfig for specifying the source of timecode used in media workflow synchronization
feat: added Encryption for enabling output encryption with DRM systems feat: added InputConfig to allow enabling/disabling automatic failover feat: added new tasks to Event: inputSwitch, returnToProgram, mute, unmute feat: added support for audio normalization and audio gain docs: clarify behavior when update_mask is omitted in PATCH requests PiperOrigin-RevId: 518110162
1 parent bb9feab commit 874ec6a

5 files changed

Lines changed: 368 additions & 73 deletions

File tree

google/cloud/video/livestream/v1/BUILD.bazel

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ proto_library(
3232
"//google/api:resource_proto",
3333
"//google/longrunning:operations_proto",
3434
"//google/rpc:status_proto",
35+
"//google/type:datetime_proto",
3536
"@com_google_protobuf//:duration_proto",
3637
"@com_google_protobuf//:empty_proto",
3738
"@com_google_protobuf//:field_mask_proto",
@@ -44,6 +45,7 @@ proto_library_with_info(
4445
deps = [
4546
":livestream_proto",
4647
"//google/cloud:common_resources_proto",
48+
"//google/cloud/location:location_proto",
4749
],
4850
)
4951

@@ -78,12 +80,14 @@ java_gapic_library(
7880
rest_numeric_enums = True,
7981
service_yaml = "livestream_v1.yaml",
8082
test_deps = [
83+
"//google/cloud/location:location_java_grpc",
8184
":livestream_java_grpc",
8285
],
8386
transport = "grpc+rest",
8487
deps = [
8588
":livestream_java_proto",
8689
"//google/api:api_java_proto",
90+
"//google/cloud/location:location_java_proto",
8791
],
8892
)
8993

@@ -129,6 +133,7 @@ go_proto_library(
129133
"//google/api:annotations_go_proto",
130134
"//google/longrunning:longrunning_go_proto",
131135
"//google/rpc:status_go_proto",
136+
"//google/type:datetime_go_proto",
132137
],
133138
)
134139

@@ -144,6 +149,7 @@ go_gapic_library(
144149
transport = "grpc+rest",
145150
deps = [
146151
":livestream_go_proto",
152+
"//google/cloud/location:location_go_proto",
147153
"//google/longrunning:longrunning_go_proto",
148154
"@com_google_cloud_go_longrunning//:go_default_library",
149155
"@com_google_cloud_go_longrunning//autogen:go_default_library",
@@ -184,13 +190,15 @@ py_gapic_library(
184190
srcs = [":livestream_proto"],
185191
grpc_service_config = "livestream_grpc_service_config.json",
186192
opt_args = [
187-
"warehouse-package-name=google-cloud-video-live-stream",
188-
"python-gapic-namespace=google.cloud.video",
189193
"python-gapic-name=live_stream",
194+
"python-gapic-namespace=google.cloud.video",
195+
"warehouse-package-name=google-cloud-video-live-stream",
190196
],
191197
rest_numeric_enums = True,
192198
service_yaml = "livestream_v1.yaml",
193199
transport = "grpc+rest",
200+
deps = [
201+
],
194202
)
195203

196204
py_test(

google/cloud/video/livestream/v1/livestream_v1.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ name: livestream.googleapis.com
44
title: Live Stream API
55

66
apis:
7+
- name: google.cloud.location.Locations
78
- name: google.cloud.video.livestream.v1.LivestreamService
9+
- name: google.longrunning.Operations
810

911
types:
1012
- name: google.cloud.video.livestream.v1.ChannelOperationResponse
@@ -18,6 +20,11 @@ documentation:
1820
- selector: google.cloud.location.Locations.ListLocations
1921
description: Lists information about the supported locations for this service.
2022

23+
- selector: google.longrunning.Operations.ListOperations
24+
description: |-
25+
Lists operations that match the specified filter in the request. If
26+
the server doesn't support this method, it returns `UNIMPLEMENTED`.
27+
2128
backend:
2229
rules:
2330
- selector: google.cloud.location.Locations.GetLocation

google/cloud/video/livestream/v1/outputs.proto

Lines changed: 108 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package google.cloud.video.livestream.v1;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/protobuf/duration.proto";
21+
import "google/type/datetime.proto";
2122

2223
option csharp_namespace = "Google.Cloud.Video.LiveStream.V1";
2324
option go_package = "cloud.google.com/go/video/livestream/apiv1/livestreampb;livestreampb";
@@ -60,8 +61,9 @@ message MuxStream {
6061
// - `ts` - the corresponding file extension is `.ts`
6162
string container = 3;
6263

63-
// List of `ElementaryStream` [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed in this
64-
// stream.
64+
// List of `ElementaryStream`
65+
// [key][google.cloud.video.livestream.v1.ElementaryStream.key]s multiplexed
66+
// in this stream.
6567
//
6668
// - For `fmp4` container, must contain either one video or one audio stream.
6769
// - For `ts` container, must contain exactly one audio stream and up to one
@@ -70,6 +72,10 @@ message MuxStream {
7072

7173
// Segment settings for `fmp4` and `ts`.
7274
SegmentSettings segment_settings = 5;
75+
76+
// Identifier of the encryption configuration to use. If omitted, output
77+
// will be unencrypted.
78+
string encryption_id = 6;
7379
}
7480

7581
// Manifest configuration.
@@ -87,15 +93,17 @@ message Manifest {
8793
}
8894

8995
// The name of the generated file. The default is `manifest` with the
90-
// extension suffix corresponding to the `Manifest` [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple
96+
// extension suffix corresponding to the `Manifest`
97+
// [type][google.cloud.video.livestream.v1.Manifest.type]. If multiple
9198
// manifests are added to the channel, each must have a unique file name.
9299
string file_name = 1;
93100

94101
// Required. Type of the manifest, can be `HLS` or `DASH`.
95102
ManifestType type = 2 [(google.api.field_behavior) = REQUIRED];
96103

97-
// Required. List of `MuxStream` [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear in this
98-
// manifest.
104+
// Required. List of `MuxStream`
105+
// [key][google.cloud.video.livestream.v1.MuxStream.key]s that should appear
106+
// in this manifest.
99107
//
100108
// - For HLS, either `fmp4` or `ts` mux streams can be specified but not
101109
// mixed.
@@ -115,6 +123,15 @@ message Manifest {
115123
// player has, but were already deleted from the output Google Cloud Storage
116124
// bucket. Default value is `60s`.
117125
google.protobuf.Duration segment_keep_duration = 5;
126+
127+
// Whether to use the timecode, as specified in timecode config, when setting:
128+
//
129+
// - `availabilityStartTime` attribute in DASH manifests.
130+
// - `#EXT-X-PROGRAM-DATE-TIME` tag in HLS manifests.
131+
//
132+
// If false, ignore the input timecode and use the time from system clock
133+
// when the manifest is first generated. This is the default behavior.
134+
bool use_timecode_as_timeline = 6;
118135
}
119136

120137
// Sprite sheet configuration.
@@ -161,6 +178,22 @@ message SpriteSheet {
161178

162179
// Preprocessing configurations.
163180
message PreprocessingConfig {
181+
// Audio preprocessing configuration.
182+
message Audio {
183+
// Specify audio loudness normalization in loudness units relative to full
184+
// scale (LUFS). Enter a value between -24 and 0 according to the following:
185+
//
186+
// - -24 is the Advanced Television Systems Committee (ATSC A/85)
187+
// - -23 is the EU R128 broadcast standard
188+
// - -19 is the prior standard for online mono audio
189+
// - -18 is the ReplayGain standard
190+
// - -16 is the prior standard for stereo audio
191+
// - -14 is the new online audio standard recommended by Spotify, as well as
192+
// Amazon Echo
193+
// - 0 disables normalization. The default is 0.
194+
double lufs = 1;
195+
}
196+
164197
// Video cropping configuration for the input video. The cropped input video
165198
// is scaled to match the output resolution.
166199
message Crop {
@@ -193,6 +226,9 @@ message PreprocessingConfig {
193226
int32 right_pixels = 4;
194227
}
195228

229+
// Audio preprocessing configuration.
230+
Audio audio = 1;
231+
196232
// Specify the video cropping configuration.
197233
Crop crop = 2;
198234

@@ -212,8 +248,8 @@ message VideoStream {
212248
// Valid range is [180, 1080].
213249
int32 height_pixels = 2;
214250

215-
// Required. The target video frame rate in frames per second (FPS). Must be less
216-
// than or equal to 60. Will default to the input frame rate if larger
251+
// Required. The target video frame rate in frames per second (FPS). Must be
252+
// less than or equal to 60. Will default to the input frame rate if larger
217253
// than the input frame rate. The API will generate an output FPS that is
218254
// divisible by the input FPS, and smaller or equal to the target FPS. See
219255
// [Calculating frame
@@ -242,16 +278,18 @@ message VideoStream {
242278

243279
// Select the GOP size based on the specified duration. The default is
244280
// `2s`. Note that `gopDuration` must be less than or equal to
245-
// [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration], and
246-
// [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration] must be divisible
247-
// by `gopDuration`. Valid range is [2s, 20s].
281+
// [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration],
282+
// and
283+
// [segment_duration][google.cloud.video.livestream.v1.SegmentSettings.segment_duration]
284+
// must be divisible by `gopDuration`. Valid range is [2s, 20s].
248285
//
249286
// All video streams in the same channel must have the same GOP size.
250287
google.protobuf.Duration gop_duration = 8;
251288
}
252289

253290
// Size of the Video Buffering Verifier (VBV) buffer in bits. Must be
254-
// greater than zero. The default is equal to [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps].
291+
// greater than zero. The default is equal to
292+
// [bitrate_bps][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.bitrate_bps].
255293
int32 vbv_size_bits = 9;
256294

257295
// Initial fullness of the Video Buffering Verifier (VBV) buffer in bits.
@@ -272,8 +310,9 @@ message VideoStream {
272310
bool b_pyramid = 12;
273311

274312
// The number of consecutive B-frames. Must be greater than or equal to
275-
// zero. Must be less than [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count] if set. The default
276-
// is 0.
313+
// zero. Must be less than
314+
// [gop_frame_count][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_frame_count]
315+
// if set. The default is 0.
277316
int32 b_frame_count = 13;
278317

279318
// Specify the intensity of the adaptive quantizer (AQ). Must be between 0
@@ -291,15 +330,18 @@ message VideoStream {
291330
// The available options are [FFmpeg-compatible Profile
292331
// Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Profile).
293332
// Note that certain values for this field may cause the
294-
// transcoder to override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]
333+
// transcoder to override other fields you set in the
334+
// [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]
295335
// message.
296336
string profile = 15;
297337

298338
// Enforces the specified codec tune. The available options are
299339
// [FFmpeg-compatible Encode
300340
// Options](https://trac.ffmpeg.org/wiki/Encode/H.264#Tune)
301341
// Note that certain values for this field may cause the transcoder to
302-
// override other fields you set in the [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings] message.
342+
// override other fields you set in the
343+
// [H264CodecSettings][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings]
344+
// message.
303345
string tune = 16;
304346
}
305347

@@ -314,22 +356,30 @@ message VideoStream {
314356
message AudioStream {
315357
// The mapping for the input streams and audio channels.
316358
message AudioMapping {
317-
// Required. The `Channel` [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key] that identifies the input that this
318-
// audio mapping applies to. If an active input doesn't have an audio
319-
// mapping, the primary audio track in the input stream will be selected.
359+
// Required. The `Channel`
360+
// [InputAttachment.key][google.cloud.video.livestream.v1.InputAttachment.key]
361+
// that identifies the input that this audio mapping applies to. If an
362+
// active input doesn't have an audio mapping, the primary audio track in
363+
// the input stream will be selected.
320364
string input_key = 6 [(google.api.field_behavior) = REQUIRED];
321365

322366
// Required. The zero-based index of the track in the input stream.
323-
// All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in the same [AudioStream][google.cloud.video.livestream.v1.AudioStream]
324-
// must have the same input track.
367+
// All [mapping][google.cloud.video.livestream.v1.AudioStream.mapping]s in
368+
// the same [AudioStream][google.cloud.video.livestream.v1.AudioStream] must
369+
// have the same input track.
325370
int32 input_track = 2 [(google.api.field_behavior) = REQUIRED];
326371

327372
// Required. The zero-based index of the channel in the input stream.
328373
int32 input_channel = 3 [(google.api.field_behavior) = REQUIRED];
329374

330375
// Required. The zero-based index of the channel in the output audio stream.
331-
// Must be consistent with the [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel].
376+
// Must be consistent with the
377+
// [input_channel][google.cloud.video.livestream.v1.AudioStream.AudioMapping.input_channel].
332378
int32 output_channel = 4 [(google.api.field_behavior) = REQUIRED];
379+
380+
// Audio volume control in dB. Negative values decrease volume,
381+
// positive values increase. The default is 0.
382+
double gain_db = 5;
333383
}
334384

335385
// Specifies whether pass through (transmuxing) is enabled or not.
@@ -344,7 +394,8 @@ message AudioStream {
344394
// - `aac`
345395
string codec = 1;
346396

347-
// Required. Audio bitrate in bits per second. Must be between 1 and 10,000,000.
397+
// Required. Audio bitrate in bits per second. Must be between 1 and
398+
// 10,000,000.
348399
int32 bitrate_bps = 2 [(google.api.field_behavior) = REQUIRED];
349400

350401
// Number of audio channels. Must be between 1 and 6. The default is 2.
@@ -386,12 +437,43 @@ message TextStream {
386437
message SegmentSettings {
387438
// Duration of the segments in seconds. The default is `6s`. Note that
388439
// `segmentDuration` must be greater than or equal to
389-
// [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration], and
390-
// `segmentDuration` must be divisible by
440+
// [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration],
441+
// and `segmentDuration` must be divisible by
391442
// [gop_duration][google.cloud.video.livestream.v1.VideoStream.H264CodecSettings.gop_duration].
392443
// Valid range is [2s, 20s].
393444
//
394-
// All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in the same manifest must have the
395-
// same segment duration.
445+
// All [mux_streams][google.cloud.video.livestream.v1.Manifest.mux_streams] in
446+
// the same manifest must have the same segment duration.
396447
google.protobuf.Duration segment_duration = 1;
397448
}
449+
450+
// Timecode configuration.
451+
message TimecodeConfig {
452+
// The source of timecode.
453+
enum TimecodeSource {
454+
// The timecode source is not specified.
455+
TIMECODE_SOURCE_UNSPECIFIED = 0;
456+
457+
// Use input media timestamp.
458+
MEDIA_TIMESTAMP = 1;
459+
460+
// Use input embedded timecode e.g. picture timing SEI message.
461+
EMBEDDED_TIMECODE = 2;
462+
}
463+
464+
// The source of the timecode that will later be used in outputs/manifests.
465+
// It determines the initial timecode/timestamp (first frame) of output
466+
// streams.
467+
TimecodeSource source = 1;
468+
469+
// For EMBEDDED_TIMECODE source only.
470+
// Used to interpret the embedded timecode (which contains only the time part
471+
// and no date). We assume all inputs are live.
472+
oneof time_offset {
473+
// UTC offset. Must be whole seconds, between -18 hours and +18 hours.
474+
google.protobuf.Duration utc_offset = 2;
475+
476+
// Time zone e.g. "America/Los_Angeles".
477+
google.type.TimeZone time_zone = 3;
478+
}
479+
}

0 commit comments

Comments
 (0)