Skip to content

Commit

Permalink
fix: rename mapping attribute of AudioStream to mapping_ (#121)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
4 people committed Jun 8, 2023
1 parent 83151e7 commit bee40e7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 60 deletions.
31 changes: 7 additions & 24 deletions video/transcoder/create_job_with_embedded_captions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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=[
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
27 changes: 6 additions & 21 deletions video/transcoder/create_job_with_standalone_captions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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=[
Expand Down Expand Up @@ -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,
),
),
Expand All @@ -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",
Expand Down
24 changes: 9 additions & 15 deletions video/transcoder/job_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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/"
Expand Down Expand Up @@ -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/"
Expand Down Expand Up @@ -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/"
Expand Down
1 change: 1 addition & 0 deletions video/transcoder/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
backoff==1.11.1
google-cloud-storage==1.43.0
pytest==6.2.4
proto-plus>=1.20.1

0 comments on commit bee40e7

Please sign in to comment.