diff --git a/video/transcoder/create_job_with_embedded_captions.py b/video/transcoder/create_job_with_embedded_captions.py index a81e66888181..c28a0668f01f 100644 --- a/video/transcoder/create_job_with_embedded_captions.py +++ b/video/transcoder/create_job_with_embedded_captions.py @@ -81,31 +81,14 @@ def create_job_with_embedded_captions( ), transcoder_v1.types.ElementaryStream( key="cea-stream0", - # The following doesn't work because "mapping" is a reserved - # argument name in GCP python client libraries (see - # https://github.com/googleapis/proto-plus-python/blob/main/proto/message.py#L447): - # - # text_stream=transcoder_v1.types.TextStream( - # codec="cea608", - # mapping=[ - # transcoder_v1.types.TextStream.TextMapping( - # atom_key="atom0", - # input_key="caption-input0", - # input_track=0, - # ), - # ], - # ), - # Use a python dictionary as a workaround: - text_stream={ - "codec": "cea608", - "mapping": [ - { - "atom_key": "atom0", - "input_key": "caption-input0", - "input_track": 0, - } + text_stream=transcoder_v1.types.TextStream( + codec="cea608", + mapping_=[ + transcoder_v1.types.TextStream.TextMapping( + atom_key="atom0", input_key="caption-input0", input_track=0, + ), ], - }, + ), ), ], mux_streams=[ diff --git a/video/transcoder/create_job_with_standalone_captions.py b/video/transcoder/create_job_with_standalone_captions.py index de32f49b176f..49ccfc8b23f4 100644 --- a/video/transcoder/create_job_with_standalone_captions.py +++ b/video/transcoder/create_job_with_standalone_captions.py @@ -82,31 +82,14 @@ def create_job_with_standalone_captions( ), transcoder_v1.types.ElementaryStream( key="vtt-stream0", - # The following doesn't work because "mapping" is a reserved - # argument name in GCP python client libraries (see - # https://github.com/googleapis/proto-plus-python/blob/main/proto/message.py#L447): - # - # text_stream=transcoder_v1.types.TextStream( - # codec="webvtt", - # mapping=[ - # transcoder_v1.types.TextStream.TextMapping( - # atom_key="atom0", - # input_key="caption-input0", - # input_track=0, - # ), - # ], - # ), - # Use a python dictionary as a workaround: - text_stream={ - "codec": "webvtt", - "mapping": [ - { - "atom_key": "atom0", - "input_key": "caption-input0", - "input_track": 0, - } + text_stream=transcoder_v1.types.TextStream( + codec="webvtt", + mapping_=[ + transcoder_v1.types.TextStream.TextMapping( + atom_key="atom0", input_key="caption-input0", input_track=0, + ), ], - }, + ), ), ], mux_streams=[