From bee40e79c4e5dca8b4c086d721a8b9105b586681 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 20:49:17 -0500 Subject: [PATCH] fix: rename mapping attribute of AudioStream to mapping_ (#121) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/googleapis/googleapis/commit/73da6697f598f1ba30618924936a59f8e457ec89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/46df624a54b9ed47c1a7eefb7a49413cf7b82f98 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 Co-authored-by: Dov Shlachter Co-authored-by: Anthonios Partheniou --- .../create_job_with_embedded_captions.py | 31 +++++-------------- .../create_job_with_standalone_captions.py | 27 ++++------------ video/transcoder/job_test.py | 24 ++++++-------- video/transcoder/requirements-test.txt | 1 + 4 files changed, 23 insertions(+), 60 deletions(-) diff --git a/video/transcoder/create_job_with_embedded_captions.py b/video/transcoder/create_job_with_embedded_captions.py index 31e4216ce9b0..a81e66888181 100644 --- a/video/transcoder/create_job_with_embedded_captions.py +++ b/video/transcoder/create_job_with_embedded_captions.py @@ -32,11 +32,7 @@ def create_job_with_embedded_captions( - project_id, - location, - input_video_uri, - input_captions_uri, - output_uri, + project_id, location, input_video_uri, input_captions_uri, output_uri, ): """Creates a job based on an ad-hoc job configuration that embeds captions in the output video. @@ -57,19 +53,12 @@ def create_job_with_embedded_captions( job.output_uri = output_uri job.config = transcoder_v1.types.JobConfig( inputs=[ - transcoder_v1.types.Input( - key="input0", - uri=input_video_uri, - ), - transcoder_v1.types.Input( - key="caption-input0", - uri=input_captions_uri, - ), + transcoder_v1.types.Input(key="input0", uri=input_video_uri,), + transcoder_v1.types.Input(key="caption-input0", uri=input_captions_uri,), ], edit_list=[ transcoder_v1.types.EditAtom( - key="atom0", - inputs=["input0", "caption-input0"], + key="atom0", inputs=["input0", "caption-input0"], ), ], elementary_streams=[ @@ -131,9 +120,7 @@ def create_job_with_embedded_captions( elementary_streams=["video-stream0", "audio-stream0"], ), transcoder_v1.types.MuxStream( - key="sd-dash", - container="fmp4", - elementary_streams=["video-stream0"], + key="sd-dash", container="fmp4", elementary_streams=["video-stream0"], ), transcoder_v1.types.MuxStream( key="audio-dash", @@ -143,9 +130,7 @@ def create_job_with_embedded_captions( ], manifests=[ transcoder_v1.types.Manifest( - file_name="manifest.m3u8", - type_="HLS", - mux_streams=["sd-hls"], + file_name="manifest.m3u8", type_="HLS", mux_streams=["sd-hls"], ), transcoder_v1.types.Manifest( file_name="manifest.mpd", @@ -165,9 +150,7 @@ def create_job_with_embedded_captions( parser = argparse.ArgumentParser() parser.add_argument("--project_id", help="Your Cloud project ID.", required=True) parser.add_argument( - "--location", - help="The location to start this job in.", - default="us-central1", + "--location", help="The location to start this job in.", default="us-central1", ) parser.add_argument( "--input_video_uri", diff --git a/video/transcoder/create_job_with_standalone_captions.py b/video/transcoder/create_job_with_standalone_captions.py index 5ed546763c9f..de32f49b176f 100644 --- a/video/transcoder/create_job_with_standalone_captions.py +++ b/video/transcoder/create_job_with_standalone_captions.py @@ -33,11 +33,7 @@ def create_job_with_standalone_captions( - project_id, - location, - input_video_uri, - input_captions_uri, - output_uri, + project_id, location, input_video_uri, input_captions_uri, output_uri, ): """Creates a job based on an ad-hoc job configuration that can use captions from a standalone file. @@ -58,19 +54,12 @@ def create_job_with_standalone_captions( job.output_uri = output_uri job.config = transcoder_v1.types.JobConfig( inputs=[ - transcoder_v1.types.Input( - key="input0", - uri=input_video_uri, - ), - transcoder_v1.types.Input( - key="caption-input0", - uri=input_captions_uri, - ), + transcoder_v1.types.Input(key="input0", uri=input_video_uri,), + transcoder_v1.types.Input(key="caption-input0", uri=input_captions_uri,), ], edit_list=[ transcoder_v1.types.EditAtom( - key="atom0", - inputs=["input0", "caption-input0"], + key="atom0", inputs=["input0", "caption-input0"], ), ], elementary_streams=[ @@ -136,9 +125,7 @@ def create_job_with_standalone_captions( container="vtt", elementary_streams=["vtt-stream0"], segment_settings=transcoder_v1.types.SegmentSettings( - segment_duration=duration.Duration( - seconds=6, - ), + segment_duration=duration.Duration(seconds=6,), individual_segments=True, ), ), @@ -162,9 +149,7 @@ def create_job_with_standalone_captions( parser = argparse.ArgumentParser() parser.add_argument("--project_id", help="Your Cloud project ID.", required=True) parser.add_argument( - "--location", - help="The location to start this job in.", - default="us-central1", + "--location", help="The location to start this job in.", default="us-central1", ) parser.add_argument( "--input_video_uri", diff --git a/video/transcoder/job_test.py b/video/transcoder/job_test.py index fa9a93e0f89c..d924472c858d 100644 --- a/video/transcoder/job_test.py +++ b/video/transcoder/job_test.py @@ -63,8 +63,12 @@ output_uri_for_animated_overlay = ( f"gs://{output_bucket_name}/test-output-animated-overlay/" ) -output_uri_for_embedded_captions = f"gs://{output_bucket_name}/test-output-embedded-captions/" -output_uri_for_standalone_captions = f"gs://{output_bucket_name}/test-output-standalone-captions/" +output_uri_for_embedded_captions = ( + f"gs://{output_bucket_name}/test-output-embedded-captions/" +) +output_uri_for_standalone_captions = ( + f"gs://{output_bucket_name}/test-output-standalone-captions/" +) small_spritesheet_file_prefix = "small-sprite-sheet" large_spritesheet_file_prefix = "large-sprite-sheet" @@ -267,10 +271,7 @@ def test_create_job_with_animated_overlay(capsys, test_bucket): def test_create_job_with_set_number_spritesheet(capsys, test_bucket): create_job_with_set_number_images_spritesheet.create_job_with_set_number_images_spritesheet( - project_id, - location, - input_uri, - output_uri_for_set_number_spritesheet, + project_id, location, input_uri, output_uri_for_set_number_spritesheet, ) out, _ = capsys.readouterr() 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): def test_create_job_with_periodic_spritesheet(capsys, test_bucket): create_job_with_periodic_images_spritesheet.create_job_with_periodic_images_spritesheet( - project_id, - location, - input_uri, - output_uri_for_periodic_spritesheet, + project_id, location, input_uri, output_uri_for_periodic_spritesheet, ) out, _ = capsys.readouterr() job_name_prefix = f"projects/{project_number}/locations/{location}/jobs/" @@ -409,11 +407,7 @@ def test_create_job_with_concatenated_inputs(capsys, test_bucket): def test_create_job_with_embedded_captions(capsys, test_bucket): create_job_with_embedded_captions.create_job_with_embedded_captions( - project_id, - location, - input_uri, - captions_uri, - output_uri_for_embedded_captions, + project_id, location, input_uri, captions_uri, output_uri_for_embedded_captions, ) out, _ = capsys.readouterr() job_name_prefix = f"projects/{project_number}/locations/{location}/jobs/" diff --git a/video/transcoder/requirements-test.txt b/video/transcoder/requirements-test.txt index 52c66823c1a1..2996534ce7ab 100644 --- a/video/transcoder/requirements-test.txt +++ b/video/transcoder/requirements-test.txt @@ -1,3 +1,4 @@ backoff==1.11.1 google-cloud-storage==1.43.0 pytest==6.2.4 +proto-plus>=1.20.1