Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

docs(samples): update samples to use mapping_ attribute of AudioStream #142

Merged
merged 2 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions 31 samples/snippets/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 31 samples/snippets/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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.