3232
3333
3434def 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 ,
4036):
4137 """Creates a job based on an ad-hoc job configuration that embeds captions in the output video.
4238
@@ -57,19 +53,12 @@ def create_job_with_embedded_captions(
5753 job .output_uri = output_uri
5854 job .config = transcoder_v1 .types .JobConfig (
5955 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 ,),
6858 ],
6959 edit_list = [
7060 transcoder_v1 .types .EditAtom (
71- key = "atom0" ,
72- inputs = ["input0" , "caption-input0" ],
61+ key = "atom0" , inputs = ["input0" , "caption-input0" ],
7362 ),
7463 ],
7564 elementary_streams = [
@@ -131,9 +120,7 @@ def create_job_with_embedded_captions(
131120 elementary_streams = ["video-stream0" , "audio-stream0" ],
132121 ),
133122 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" ],
137124 ),
138125 transcoder_v1 .types .MuxStream (
139126 key = "audio-dash" ,
@@ -143,9 +130,7 @@ def create_job_with_embedded_captions(
143130 ],
144131 manifests = [
145132 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" ],
149134 ),
150135 transcoder_v1 .types .Manifest (
151136 file_name = "manifest.mpd" ,
@@ -165,9 +150,7 @@ def create_job_with_embedded_captions(
165150 parser = argparse .ArgumentParser ()
166151 parser .add_argument ("--project_id" , help = "Your Cloud project ID." , required = True )
167152 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" ,
171154 )
172155 parser .add_argument (
173156 "--input_video_uri" ,
0 commit comments