Video API, gRPC: VideoService.Transcode
Transcode video.
gRPC request
rpc Transcode (TranscodeVideoRequest) returns (operation.Operation)
TranscodeVideoRequest
{
"video_id": "string",
"field_mask": "google.protobuf.FieldMask",
"subtitle_ids": [
"string"
],
"translation_settings": {
"tracks": [
{
"input_track": {
"track_index": "int64",
"src_lang": "string"
},
"subtitles": [
{
"dst_lang": "string",
"label": "string"
}
],
"audio": [
{
"dst_lang": "string",
"label": "string"
}
]
}
]
},
"summarization_settings": {
"tracks": [
{
"input_track": {
"track_index": "int64",
"src_lang": "string"
}
}
],
"process_all_tracks": "bool"
}
}
Field |
Description |
video_id |
string ID of the video. |
field_mask |
Required field. Field mask that specifies which transcoding specific fields of the video |
subtitle_ids[] |
string IDs of active manually uploaded video subtitles. |
translation_settings |
Video translation settings. |
summarization_settings |
Video summarization settings. |
VideoTranslationSettings
Field |
Description |
tracks[] |
Translation settings for each track. |
TranslationTrack
Field |
Description |
input_track |
Required field. Input track settings. |
subtitles[] |
Settings for target subtitle tracks. |
audio[] |
Settings for target audio tracks. |
InputTrack
Field |
Description |
track_index |
int64 Input audio track index (one-based). |
src_lang |
string Source track language in any of the following formats:
|
SubtitleTrack
Field |
Description |
dst_lang |
string Required field. Target language in any of the following formats:
|
label |
string Required field. Track label to be displayed on the screen during video playback. |
AudioTrack
Field |
Description |
dst_lang |
string Required field. Target language in any of the following formats:
|
label |
string Required field. Track label to be displayed on the screen during video playback. |
VideoSummarizationSettings
Field |
Description |
tracks[] |
Summarization settings for each track. |
process_all_tracks |
bool Summarize all available tracks. |
SummarizationTrack
Field |
Description |
input_track |
Required field. Input track settings. |
InputTrack
Field |
Description |
track_index |
int64 Input audio track index (one-based). |
src_lang |
string Source track language (three-letter code according to ISO 639-2/T, ISO 639-2/B, or ISO 639-3). |
operation.Operation
{
"id": "string",
"description": "string",
"created_at": "google.protobuf.Timestamp",
"created_by": "string",
"modified_at": "google.protobuf.Timestamp",
"done": "bool",
"metadata": {
"video_id": "string"
},
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": {
"id": "string",
"channel_id": "string",
"title": "string",
"description": "string",
"thumbnail_id": "string",
"status": "VideoStatus",
"error_message": "string",
"visibility_status": "VisibilityStatus",
"duration": "google.protobuf.Duration",
"auto_transcode": "AutoTranscode",
"enable_ad": "google.protobuf.BoolValue",
"subtitle_ids": [
"string"
],
"features": {
"summary": {
"result": "FeatureResult",
"urls": [
{
"url": "string",
"track_index": "int64",
"src_lang": "string"
}
]
}
},
// Includes only one of the fields `tusd`
"tusd": {
"url": "string",
"file_size": "int64"
},
// end of the list of possible fields
// Includes only one of the fields `public_access`, `sign_url_access`
"public_access": "VideoPublicAccessRights",
"sign_url_access": "VideoSignURLAccessRights",
// end of the list of possible fields
"created_at": "google.protobuf.Timestamp",
"updated_at": "google.protobuf.Timestamp",
"labels": "map<string, string>"
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
created_at |
Creation timestamp. |
created_by |
string ID of the user or service account who initiated the operation. |
modified_at |
The time when the Operation resource was last modified. |
done |
bool If the value is |
metadata |
Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
TranscodeVideoMetadata
Field |
Description |
video_id |
string ID of the video. |
Video
Field |
Description |
id |
string ID of the video. |
channel_id |
string ID of the channel where the video was created. |
title |
string Video title displayed to users. |
description |
string Detailed description of the video. |
thumbnail_id |
string ID of the video's thumbnail image. |
status |
enum VideoStatus Video status.
|
error_message |
string Error message describing the reason for video processing failure, if any. |
visibility_status |
enum VisibilityStatus Visibility status of the video.
|
duration |
Video duration. Optional, may be empty until the transcoding result is ready. |
auto_transcode |
enum AutoTranscode Auto-transcoding setting.
|
enable_ad |
Enable advertisement for this video. |
subtitle_ids[] |
string List of IDs defining the active subtitles for the video. |
features |
Additional video processing features and their results. |
tusd |
Upload video using the tus protocol. Includes only one of the fields Video upload source definition (one source variant must be chosen). |
public_access |
Publicly accessible video available for viewing by anyone with the direct link. Includes only one of the fields Video access permission settings. |
sign_url_access |
Checking access rights using url's signature. Includes only one of the fields Video access permission settings. |
created_at |
Time when video was created. |
updated_at |
Time of last video update. |
labels |
object (map<string, string>) Custom labels as |
VideoFeatures
Field |
Description |
summary |
Summarization result. |
Summary
Field |
Description |
result |
enum FeatureResult
|
urls[] |
SummaryURL
Field |
Description |
url |
string |
track_index |
int64 Input audio track index (one-based). |
src_lang |
string Source track language (three-letter code according to ISO 639-2/T, ISO 639-2/B, or ISO 639-3). |
VideoTUSDSource
Video upload source via tus protocol.
Field |
Description |
url |
string URL for uploading video via the tus protocol. |
file_size |
int64 Size of the uploaded file, in bytes. |
VideoPublicAccessRights
Field |
Description |
Empty |
VideoSignURLAccessRights
Field |
Description |
Empty |