Skip to content

Commit

Permalink
feat: [video-transcoder] added support for segment template manifest …
Browse files Browse the repository at this point in the history
…generation with DASH (#4407)

* feat: added support for segment template manifest generation with DASH
feat: added support for batch mode priority
feat: added support for disabling job processing optimizations
feat: added support for content encryption (DRM)

PiperOrigin-RevId: 546916731

Source-Link: googleapis/googleapis@f1f8ba4

Source-Link: googleapis/googleapis-gen@6ddcc2d
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXRyYW5zY29kZXIvLk93bEJvdC55YW1sIiwiaCI6IjZkZGNjMmRkODJiYmE5M2NiZGZlMzk3ZWVlZjE2MmU1YTQwM2Q1OGQifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jul 11, 2023
1 parent db3b83d commit 198cb4b
Show file tree
Hide file tree
Showing 7 changed files with 4,047 additions and 35 deletions.
23 changes: 11 additions & 12 deletions packages/google-cloud-video-transcoder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[//]: # "To regenerate it, use `python -m synthtool`."
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>

# [Transcoder API: Node.js Client](https://github.com/googleapis/google-cloud-node)
# [Transcoder API: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-transcoder)

[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/video-transcoder.svg)](https://www.npmjs.org/package/@google-cloud/video-transcoder)
Expand Down Expand Up @@ -82,20 +82,19 @@ listJobs();

## Samples

Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-video-transcoder/samples) directory. Each sample's `README.md` has instructions for running its sample.

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Transcoder_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job.js,samples/README.md) |
| Transcoder_service.create_job_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job_template.js,samples/README.md) |
| Transcoder_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job.js,samples/README.md) |
| Transcoder_service.delete_job_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job_template.js,samples/README.md) |
| Transcoder_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job.js,samples/README.md) |
| Transcoder_service.get_job_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job_template.js,samples/README.md) |
| Transcoder_service.list_job_templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_job_templates.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_job_templates.js,samples/README.md) |
| Transcoder_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_jobs.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/quickstart.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/test/quickstart.js,samples/README.md) |
| Transcoder_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job.js,packages/google-cloud-video-transcoder/samples/README.md) |
| Transcoder_service.create_job_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.create_job_template.js,packages/google-cloud-video-transcoder/samples/README.md) |
| Transcoder_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job.js,packages/google-cloud-video-transcoder/samples/README.md) |
| Transcoder_service.delete_job_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.delete_job_template.js,packages/google-cloud-video-transcoder/samples/README.md) |
| Transcoder_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job.js,packages/google-cloud-video-transcoder/samples/README.md) |
| Transcoder_service.get_job_template | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job_template.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.get_job_template.js,packages/google-cloud-video-transcoder/samples/README.md) |
| Transcoder_service.list_job_templates | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_job_templates.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_job_templates.js,packages/google-cloud-video-transcoder/samples/README.md) |
| Transcoder_service.list_jobs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_jobs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/generated/v1/transcoder_service.list_jobs.js,packages/google-cloud-video-transcoder/samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-video-transcoder/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-video-transcoder/samples/quickstart.js,packages/google-cloud-video-transcoder/samples/README.md) |



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ message Job {
PROCESSING_MODE_BATCH = 2;
}

// The optimization strategy of the job. The default is `AUTODETECT`.
enum OptimizationStrategy {
// The optimization strategy is not specified.
OPTIMIZATION_STRATEGY_UNSPECIFIED = 0;

// Prioritize job processing speed.
AUTODETECT = 1;

// Disable all optimizations.
DISABLED = 2;
}

// The resource name of the job.
// Format: `projects/{project_number}/locations/{location}/jobs/{job}`
string name = 1;
Expand Down Expand Up @@ -133,6 +145,17 @@ message Job {
// The processing mode of the job.
// The default is `PROCESSING_MODE_INTERACTIVE`.
ProcessingMode mode = 20;

// The processing priority of a batch job.
// This field can only be set for batch mode jobs. The default value is 0.
// This value cannot be negative. Higher values correspond to higher
// priorities for the job.
int32 batch_mode_priority = 21;

// Optional. The optimization strategy of the job. The default is
// `AUTODETECT`.
OptimizationStrategy optimization = 22
[(google.api.field_behavior) = OPTIONAL];
}

// Transcoding job template resource.
Expand Down Expand Up @@ -189,6 +212,12 @@ message JobConfig {

// List of overlays on the output video, in descending Z-order.
repeated Overlay overlays = 10;

// List of encryption configurations for the content.
// Each configuration has an ID. Specify this ID in the
// [MuxStream.encryption_id][google.cloud.video.transcoder.v1.MuxStream.encryption_id]
// field to indicate the configuration to use for that `MuxStream` output.
repeated Encryption encryptions = 11;
}

// Input asset.
Expand Down Expand Up @@ -296,27 +325,50 @@ message MuxStream {

// Segment settings for `ts`, `fmp4` and `vtt`.
SegmentSettings segment_settings = 5;

// Identifier of the encryption configuration to use. If omitted, output will
// be unencrypted.
string encryption_id = 7;
}

// Manifest configuration.
message Manifest {
// The manifest type can be either `HLS` or `DASH`.
// The manifest type, which corresponds to the adaptive streaming format used.
enum ManifestType {
// The manifest type is not specified.
MANIFEST_TYPE_UNSPECIFIED = 0;

// Create `HLS` manifest. The corresponding file extension is `.m3u8`.
// Create an HLS manifest. The corresponding file extension is `.m3u8`.
HLS = 1;

// Create `DASH` manifest. The corresponding file extension is `.mpd`.
// Create an MPEG-DASH manifest. The corresponding file extension is `.mpd`.
DASH = 2;
}

// `DASH` manifest configuration.
message DashConfig {
// The segment reference scheme for a `DASH` manifest.
enum SegmentReferenceScheme {
// The segment reference scheme is not specified.
SEGMENT_REFERENCE_SCHEME_UNSPECIFIED = 0;

// Lists the URLs of media files for each segment.
SEGMENT_LIST = 1;

// Lists each segment from a template with $Number$ variable.
SEGMENT_TEMPLATE_NUMBER = 2;
}

// The segment reference scheme for a `DASH` manifest. The default is
// `SEGMENT_LIST`.
SegmentReferenceScheme segment_reference_scheme = 1;
}

// The name of the generated file. The default is `manifest` with the
// extension suffix corresponding to the `Manifest.type`.
string file_name = 1;

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

// Required. List of user given `MuxStream.key`s that should appear in this
Expand All @@ -326,6 +378,12 @@ message Manifest {
// and `.m3u8` extension is generated for each element of the
// `Manifest.mux_streams`.
repeated string mux_streams = 3 [(google.api.field_behavior) = REQUIRED];

// Specifies the manifest configuration.
oneof manifest_config {
// `DASH` manifest configuration.
DashConfig dash = 4;
}
}

// A Pub/Sub destination.
Expand Down Expand Up @@ -1246,3 +1304,86 @@ message SegmentSettings {
// Required. Create an individual segment file. The default is `false`.
bool individual_segments = 3 [(google.api.field_behavior) = REQUIRED];
}

// Encryption settings.
message Encryption {
// Configuration for AES-128 encryption.
message Aes128Encryption {}

// Configuration for SAMPLE-AES encryption.
message SampleAesEncryption {}

// Configuration for MPEG Common Encryption (MPEG-CENC).
message MpegCommonEncryption {
// Required. Specify the encryption scheme.
//
// Supported encryption schemes:
//
// - `cenc`
// - `cbcs`
string scheme = 2 [(google.api.field_behavior) = REQUIRED];
}

// Configuration for secrets stored in Google Secret Manager.
message SecretManagerSource {
// Required. The name of the Secret Version containing the encryption key in
// the following format:
// `projects/{project}/secrets/{secret_id}/versions/{version_number}`
//
// Note that only numbered versions are supported. Aliases like "latest" are
// not supported.
string secret_version = 1 [(google.api.field_behavior) = REQUIRED];
}

// Widevine configuration.
message Widevine {}

// Fairplay configuration.
message Fairplay {}

// Playready configuration.
message Playready {}

// Clearkey configuration.
message Clearkey {}

// Defines configuration for DRM systems in use.
message DrmSystems {
// Widevine configuration.
Widevine widevine = 1;

// Fairplay configuration.
Fairplay fairplay = 2;

// Playready configuration.
Playready playready = 3;

// Clearkey configuration.
Clearkey clearkey = 4;
}

// Required. Identifier for this set of encryption options.
string id = 6 [(google.api.field_behavior) = REQUIRED];

// Encryption mode can be either `aes` or `cenc`.
oneof encryption_mode {
// Configuration for AES-128 encryption.
Aes128Encryption aes_128 = 3;

// Configuration for SAMPLE-AES encryption.
SampleAesEncryption sample_aes = 4;

// Configuration for MPEG Common Encryption (MPEG-CENC).
MpegCommonEncryption mpeg_cenc = 5;
}

// Defines where content keys are stored.
oneof secret_source {
// Keys are stored in Google Secret Manager.
SecretManagerSource secret_manager_key_source = 7;
}

// Required. DRM system(s) to use; at least one must be specified. If a
// DRM system is omitted, it is considered disabled.
DrmSystems drm_systems = 8 [(google.api.field_behavior) = REQUIRED];
}
Loading

0 comments on commit 198cb4b

Please sign in to comment.