Skip to content

Commit

Permalink
docs(samples): update samples to use mapping_ attribute of AudioStream (
Browse files Browse the repository at this point in the history
#142)

* fix: revise samples with fix from #138

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and parthea committed Jun 8, 2023
1 parent b5560df commit c4cf452
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 48 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 @@ -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=[
Expand Down
31 changes: 7 additions & 24 deletions video/transcoder/create_job_with_standalone_captions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down

0 comments on commit c4cf452

Please sign in to comment.