Skip to content

Commit 35069f7

Browse files
feat: [google-cloud-video-transcoder] add support for automatically generating subtitle for input videos (#14286)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 798365183 Source-Link: googleapis/googleapis@c58a1bb Source-Link: googleapis/googleapis-gen@bbdcfcb Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXZpZGVvLXRyYW5zY29kZXIvLk93bEJvdC55YW1sIiwiaCI6ImJiZGNmY2IwNjJhZDhkYjk2YmZjYjM3M2I3NjNkZDhkNGRjYzY1NGQifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: ohmayr <omairnaveed@ymail.com>
1 parent 594263e commit 35069f7

File tree

8 files changed

+116
-3
lines changed

8 files changed

+116
-3
lines changed

packages/google-cloud-video-transcoder/google/cloud/video/transcoder/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
ElementaryStream,
3232
Encryption,
3333
Input,
34+
InputAttributes,
3435
Job,
3536
JobConfig,
3637
JobTemplate,
@@ -43,6 +44,7 @@
4344
SegmentSettings,
4445
SpriteSheet,
4546
TextStream,
47+
TrackDefinition,
4648
VideoStream,
4749
)
4850
from google.cloud.video.transcoder_v1.types.services import (
@@ -67,6 +69,7 @@
6769
"ElementaryStream",
6870
"Encryption",
6971
"Input",
72+
"InputAttributes",
7073
"Job",
7174
"JobConfig",
7275
"JobTemplate",
@@ -79,6 +82,7 @@
7982
"SegmentSettings",
8083
"SpriteSheet",
8184
"TextStream",
85+
"TrackDefinition",
8286
"VideoStream",
8387
"CreateJobRequest",
8488
"CreateJobTemplateRequest",

packages/google-cloud-video-transcoder/google/cloud/video/transcoder/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.16.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-video-transcoder/google/cloud/video/transcoder_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
ElementaryStream,
3030
Encryption,
3131
Input,
32+
InputAttributes,
3233
Job,
3334
JobConfig,
3435
JobTemplate,
@@ -41,6 +42,7 @@
4142
SegmentSettings,
4243
SpriteSheet,
4344
TextStream,
45+
TrackDefinition,
4446
VideoStream,
4547
)
4648
from .types.services import (
@@ -70,6 +72,7 @@
7072
"GetJobRequest",
7173
"GetJobTemplateRequest",
7274
"Input",
75+
"InputAttributes",
7376
"Job",
7477
"JobConfig",
7578
"JobTemplate",
@@ -86,6 +89,7 @@
8689
"SegmentSettings",
8790
"SpriteSheet",
8891
"TextStream",
92+
"TrackDefinition",
8993
"TranscoderServiceClient",
9094
"VideoStream",
9195
)

packages/google-cloud-video-transcoder/google/cloud/video/transcoder_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "1.16.0" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-cloud-video-transcoder/google/cloud/video/transcoder_v1/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
ElementaryStream,
2121
Encryption,
2222
Input,
23+
InputAttributes,
2324
Job,
2425
JobConfig,
2526
JobTemplate,
@@ -32,6 +33,7 @@
3233
SegmentSettings,
3334
SpriteSheet,
3435
TextStream,
36+
TrackDefinition,
3537
VideoStream,
3638
)
3739
from .services import (
@@ -54,6 +56,7 @@
5456
"ElementaryStream",
5557
"Encryption",
5658
"Input",
59+
"InputAttributes",
5760
"Job",
5861
"JobConfig",
5962
"JobTemplate",
@@ -66,6 +69,7 @@
6669
"SegmentSettings",
6770
"SpriteSheet",
6871
"TextStream",
72+
"TrackDefinition",
6973
"VideoStream",
7074
"CreateJobRequest",
7175
"CreateJobTemplateRequest",

packages/google-cloud-video-transcoder/google/cloud/video/transcoder_v1/types/resources.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"SpriteSheet",
4040
"Overlay",
4141
"PreprocessingConfig",
42+
"TrackDefinition",
43+
"InputAttributes",
4244
"VideoStream",
4345
"AudioStream",
4446
"TextStream",
@@ -408,6 +410,8 @@ class Input(proto.Message):
408410
formats <https://cloud.google.com/transcoder/docs/concepts/supported-input-and-output-formats>`__.
409411
preprocessing_config (google.cloud.video.transcoder_v1.types.PreprocessingConfig):
410412
Preprocessing configurations.
413+
attributes (google.cloud.video.transcoder_v1.types.InputAttributes):
414+
Optional. Input Attributes.
411415
"""
412416

413417
key: str = proto.Field(
@@ -423,6 +427,11 @@ class Input(proto.Message):
423427
number=3,
424428
message="PreprocessingConfig",
425429
)
430+
attributes: "InputAttributes" = proto.Field(
431+
proto.MESSAGE,
432+
number=4,
433+
message="InputAttributes",
434+
)
426435

427436

428437
class Output(proto.Message):
@@ -1533,6 +1542,72 @@ class BwdifConfig(proto.Message):
15331542
)
15341543

15351544

1545+
class TrackDefinition(proto.Message):
1546+
r"""Track definition for the input asset.
1547+
1548+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
1549+
1550+
Attributes:
1551+
input_track (int):
1552+
The input track.
1553+
1554+
This field is a member of `oneof`_ ``_input_track``.
1555+
languages (MutableSequence[str]):
1556+
Optional. A list of languages spoken in the input asset,
1557+
represented by a BCP 47 language code, such as "en-US" or
1558+
"sr-Latn". For more information, see
1559+
https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1560+
detect_languages (bool):
1561+
Optional. Whether to automatically detect the
1562+
languages present in the track. If true, the
1563+
system will attempt to identify all the
1564+
languages present in the track and populate the
1565+
languages field.
1566+
detected_languages (MutableSequence[str]):
1567+
Output only. A list of languages detected in the input
1568+
asset, represented by a BCP 47 language code, such as
1569+
"en-US" or "sr-Latn". For more information, see
1570+
https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
1571+
This field is only populated if the detect_languages field
1572+
is set to true.
1573+
"""
1574+
1575+
input_track: int = proto.Field(
1576+
proto.INT32,
1577+
number=1,
1578+
optional=True,
1579+
)
1580+
languages: MutableSequence[str] = proto.RepeatedField(
1581+
proto.STRING,
1582+
number=2,
1583+
)
1584+
detect_languages: bool = proto.Field(
1585+
proto.BOOL,
1586+
number=3,
1587+
)
1588+
detected_languages: MutableSequence[str] = proto.RepeatedField(
1589+
proto.STRING,
1590+
number=4,
1591+
)
1592+
1593+
1594+
class InputAttributes(proto.Message):
1595+
r"""Input attributes that provide additional information about
1596+
the input asset.
1597+
1598+
Attributes:
1599+
track_definitions (MutableSequence[google.cloud.video.transcoder_v1.types.TrackDefinition]):
1600+
Optional. A list of track definitions for the
1601+
input asset.
1602+
"""
1603+
1604+
track_definitions: MutableSequence["TrackDefinition"] = proto.RepeatedField(
1605+
proto.MESSAGE,
1606+
number=1,
1607+
message="TrackDefinition",
1608+
)
1609+
1610+
15361611
class VideoStream(proto.Message):
15371612
r"""Video stream resource.
15381613

packages/google-cloud-video-transcoder/samples/generated_samples/snippet_metadata_google.cloud.video.transcoder.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-video-transcoder",
11-
"version": "1.16.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

packages/google-cloud-video-transcoder/tests/unit/gapic/transcoder_v1/test_transcoder_service.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6505,6 +6505,19 @@ def test_create_job_rest_call_success(request_type):
65056505
},
65066506
},
65076507
},
6508+
"attributes": {
6509+
"track_definitions": [
6510+
{
6511+
"input_track": 1188,
6512+
"languages": ["languages_value1", "languages_value2"],
6513+
"detect_languages": True,
6514+
"detected_languages": [
6515+
"detected_languages_value1",
6516+
"detected_languages_value2",
6517+
],
6518+
}
6519+
]
6520+
},
65086521
}
65096522
],
65106523
"edit_list": [
@@ -7345,6 +7358,19 @@ def test_create_job_template_rest_call_success(request_type):
73457358
},
73467359
},
73477360
},
7361+
"attributes": {
7362+
"track_definitions": [
7363+
{
7364+
"input_track": 1188,
7365+
"languages": ["languages_value1", "languages_value2"],
7366+
"detect_languages": True,
7367+
"detected_languages": [
7368+
"detected_languages_value1",
7369+
"detected_languages_value2",
7370+
],
7371+
}
7372+
]
7373+
},
73487374
}
73497375
],
73507376
"edit_list": [

0 commit comments

Comments
 (0)