32
32
33
33
34
34
def create_job_with_embedded_captions (
35
- project_id ,
36
- location ,
37
- input_video_uri ,
38
- input_captions_uri ,
39
- output_uri ,
35
+ project_id , location , input_video_uri , input_captions_uri , output_uri ,
40
36
):
41
37
"""Creates a job based on an ad-hoc job configuration that embeds captions in the output video.
42
38
@@ -57,19 +53,12 @@ def create_job_with_embedded_captions(
57
53
job .output_uri = output_uri
58
54
job .config = transcoder_v1 .types .JobConfig (
59
55
inputs = [
60
- transcoder_v1 .types .Input (
61
- key = "input0" ,
62
- uri = input_video_uri ,
63
- ),
64
- transcoder_v1 .types .Input (
65
- key = "caption-input0" ,
66
- uri = input_captions_uri ,
67
- ),
56
+ transcoder_v1 .types .Input (key = "input0" , uri = input_video_uri ,),
57
+ transcoder_v1 .types .Input (key = "caption-input0" , uri = input_captions_uri ,),
68
58
],
69
59
edit_list = [
70
60
transcoder_v1 .types .EditAtom (
71
- key = "atom0" ,
72
- inputs = ["input0" , "caption-input0" ],
61
+ key = "atom0" , inputs = ["input0" , "caption-input0" ],
73
62
),
74
63
],
75
64
elementary_streams = [
@@ -131,9 +120,7 @@ def create_job_with_embedded_captions(
131
120
elementary_streams = ["video-stream0" , "audio-stream0" ],
132
121
),
133
122
transcoder_v1 .types .MuxStream (
134
- key = "sd-dash" ,
135
- container = "fmp4" ,
136
- elementary_streams = ["video-stream0" ],
123
+ key = "sd-dash" , container = "fmp4" , elementary_streams = ["video-stream0" ],
137
124
),
138
125
transcoder_v1 .types .MuxStream (
139
126
key = "audio-dash" ,
@@ -143,9 +130,7 @@ def create_job_with_embedded_captions(
143
130
],
144
131
manifests = [
145
132
transcoder_v1 .types .Manifest (
146
- file_name = "manifest.m3u8" ,
147
- type_ = "HLS" ,
148
- mux_streams = ["sd-hls" ],
133
+ file_name = "manifest.m3u8" , type_ = "HLS" , mux_streams = ["sd-hls" ],
149
134
),
150
135
transcoder_v1 .types .Manifest (
151
136
file_name = "manifest.mpd" ,
@@ -165,9 +150,7 @@ def create_job_with_embedded_captions(
165
150
parser = argparse .ArgumentParser ()
166
151
parser .add_argument ("--project_id" , help = "Your Cloud project ID." , required = True )
167
152
parser .add_argument (
168
- "--location" ,
169
- help = "The location to start this job in." ,
170
- default = "us-central1" ,
153
+ "--location" , help = "The location to start this job in." , default = "us-central1" ,
171
154
)
172
155
parser .add_argument (
173
156
"--input_video_uri" ,
0 commit comments