Skip to content

Commit bee40e7

Browse files
gcf-owl-bot[bot]software-dovparthea
committed
fix: rename mapping attribute of AudioStream to mapping_ (#121)
fix: resolve issue where mapping attribute of AudioStream could not be set fix(deps): require proto-plus >= 1.20.1 * chore: use gapic-generator-python 0.58.4 committer: dovs PiperOrigin-RevId: 419025932 Source-Link: googleapis/googleapis@73da669 Source-Link: googleapis/googleapis-gen@46df624 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDZkZjYyNGE1NGI5ZWQ0N2MxYTdlZWZiN2E0OTQxM2NmN2I4MmY5OCJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): require proto-plus >= 1.20.1 * ensure proto-plus>=1.20.1 is used for testing Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Dov Shlachter <[email protected]> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent 83151e7 commit bee40e7

File tree

4 files changed

+23
-60
lines changed

4 files changed

+23
-60
lines changed

video/transcoder/create_job_with_embedded_captions.py

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@
3232

3333

3434
def create_job_with_embedded_captions(
35-
project_id,
36-
location,
37-
input_video_uri,
38-
input_captions_uri,
39-
output_uri,
35+
project_id, location, input_video_uri, input_captions_uri, output_uri,
4036
):
4137
"""Creates a job based on an ad-hoc job configuration that embeds captions in the output video.
4238
@@ -57,19 +53,12 @@ def create_job_with_embedded_captions(
5753
job.output_uri = output_uri
5854
job.config = transcoder_v1.types.JobConfig(
5955
inputs=[
60-
transcoder_v1.types.Input(
61-
key="input0",
62-
uri=input_video_uri,
63-
),
64-
transcoder_v1.types.Input(
65-
key="caption-input0",
66-
uri=input_captions_uri,
67-
),
56+
transcoder_v1.types.Input(key="input0", uri=input_video_uri,),
57+
transcoder_v1.types.Input(key="caption-input0", uri=input_captions_uri,),
6858
],
6959
edit_list=[
7060
transcoder_v1.types.EditAtom(
71-
key="atom0",
72-
inputs=["input0", "caption-input0"],
61+
key="atom0", inputs=["input0", "caption-input0"],
7362
),
7463
],
7564
elementary_streams=[
@@ -131,9 +120,7 @@ def create_job_with_embedded_captions(
131120
elementary_streams=["video-stream0", "audio-stream0"],
132121
),
133122
transcoder_v1.types.MuxStream(
134-
key="sd-dash",
135-
container="fmp4",
136-
elementary_streams=["video-stream0"],
123+
key="sd-dash", container="fmp4", elementary_streams=["video-stream0"],
137124
),
138125
transcoder_v1.types.MuxStream(
139126
key="audio-dash",
@@ -143,9 +130,7 @@ def create_job_with_embedded_captions(
143130
],
144131
manifests=[
145132
transcoder_v1.types.Manifest(
146-
file_name="manifest.m3u8",
147-
type_="HLS",
148-
mux_streams=["sd-hls"],
133+
file_name="manifest.m3u8", type_="HLS", mux_streams=["sd-hls"],
149134
),
150135
transcoder_v1.types.Manifest(
151136
file_name="manifest.mpd",
@@ -165,9 +150,7 @@ def create_job_with_embedded_captions(
165150
parser = argparse.ArgumentParser()
166151
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
167152
parser.add_argument(
168-
"--location",
169-
help="The location to start this job in.",
170-
default="us-central1",
153+
"--location", help="The location to start this job in.", default="us-central1",
171154
)
172155
parser.add_argument(
173156
"--input_video_uri",

video/transcoder/create_job_with_standalone_captions.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@
3333

3434

3535
def create_job_with_standalone_captions(
36-
project_id,
37-
location,
38-
input_video_uri,
39-
input_captions_uri,
40-
output_uri,
36+
project_id, location, input_video_uri, input_captions_uri, output_uri,
4137
):
4238
"""Creates a job based on an ad-hoc job configuration that can use captions from a standalone file.
4339
@@ -58,19 +54,12 @@ def create_job_with_standalone_captions(
5854
job.output_uri = output_uri
5955
job.config = transcoder_v1.types.JobConfig(
6056
inputs=[
61-
transcoder_v1.types.Input(
62-
key="input0",
63-
uri=input_video_uri,
64-
),
65-
transcoder_v1.types.Input(
66-
key="caption-input0",
67-
uri=input_captions_uri,
68-
),
57+
transcoder_v1.types.Input(key="input0", uri=input_video_uri,),
58+
transcoder_v1.types.Input(key="caption-input0", uri=input_captions_uri,),
6959
],
7060
edit_list=[
7161
transcoder_v1.types.EditAtom(
72-
key="atom0",
73-
inputs=["input0", "caption-input0"],
62+
key="atom0", inputs=["input0", "caption-input0"],
7463
),
7564
],
7665
elementary_streams=[
@@ -136,9 +125,7 @@ def create_job_with_standalone_captions(
136125
container="vtt",
137126
elementary_streams=["vtt-stream0"],
138127
segment_settings=transcoder_v1.types.SegmentSettings(
139-
segment_duration=duration.Duration(
140-
seconds=6,
141-
),
128+
segment_duration=duration.Duration(seconds=6,),
142129
individual_segments=True,
143130
),
144131
),
@@ -162,9 +149,7 @@ def create_job_with_standalone_captions(
162149
parser = argparse.ArgumentParser()
163150
parser.add_argument("--project_id", help="Your Cloud project ID.", required=True)
164151
parser.add_argument(
165-
"--location",
166-
help="The location to start this job in.",
167-
default="us-central1",
152+
"--location", help="The location to start this job in.", default="us-central1",
168153
)
169154
parser.add_argument(
170155
"--input_video_uri",

video/transcoder/job_test.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@
6363
output_uri_for_animated_overlay = (
6464
f"gs://{output_bucket_name}/test-output-animated-overlay/"
6565
)
66-
output_uri_for_embedded_captions = f"gs://{output_bucket_name}/test-output-embedded-captions/"
67-
output_uri_for_standalone_captions = f"gs://{output_bucket_name}/test-output-standalone-captions/"
66+
output_uri_for_embedded_captions = (
67+
f"gs://{output_bucket_name}/test-output-embedded-captions/"
68+
)
69+
output_uri_for_standalone_captions = (
70+
f"gs://{output_bucket_name}/test-output-standalone-captions/"
71+
)
6872

6973
small_spritesheet_file_prefix = "small-sprite-sheet"
7074
large_spritesheet_file_prefix = "large-sprite-sheet"
@@ -267,10 +271,7 @@ def test_create_job_with_animated_overlay(capsys, test_bucket):
267271

268272
def test_create_job_with_set_number_spritesheet(capsys, test_bucket):
269273
create_job_with_set_number_images_spritesheet.create_job_with_set_number_images_spritesheet(
270-
project_id,
271-
location,
272-
input_uri,
273-
output_uri_for_set_number_spritesheet,
274+
project_id, location, input_uri, output_uri_for_set_number_spritesheet,
274275
)
275276
out, _ = capsys.readouterr()
276277
job_name_prefix = f"projects/{project_number}/locations/{location}/jobs/"
@@ -318,10 +319,7 @@ def test_create_job_with_set_number_spritesheet(capsys, test_bucket):
318319

319320
def test_create_job_with_periodic_spritesheet(capsys, test_bucket):
320321
create_job_with_periodic_images_spritesheet.create_job_with_periodic_images_spritesheet(
321-
project_id,
322-
location,
323-
input_uri,
324-
output_uri_for_periodic_spritesheet,
322+
project_id, location, input_uri, output_uri_for_periodic_spritesheet,
325323
)
326324
out, _ = capsys.readouterr()
327325
job_name_prefix = f"projects/{project_number}/locations/{location}/jobs/"
@@ -409,11 +407,7 @@ def test_create_job_with_concatenated_inputs(capsys, test_bucket):
409407

410408
def test_create_job_with_embedded_captions(capsys, test_bucket):
411409
create_job_with_embedded_captions.create_job_with_embedded_captions(
412-
project_id,
413-
location,
414-
input_uri,
415-
captions_uri,
416-
output_uri_for_embedded_captions,
410+
project_id, location, input_uri, captions_uri, output_uri_for_embedded_captions,
417411
)
418412
out, _ = capsys.readouterr()
419413
job_name_prefix = f"projects/{project_number}/locations/{location}/jobs/"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
backoff==1.11.1
22
google-cloud-storage==1.43.0
33
pytest==6.2.4
4+
proto-plus>=1.20.1

0 commit comments

Comments
 (0)