3232
3333
3434def create_job_with_embedded_captions (
35- project_id , location , input_video_uri , input_captions_uri , output_uri ,
35+ project_id ,
36+ location ,
37+ input_video_uri ,
38+ input_captions_uri ,
39+ output_uri ,
3640):
3741 """Creates a job based on an ad-hoc job configuration that embeds captions in the output video.
3842
@@ -53,12 +57,19 @@ def create_job_with_embedded_captions(
5357 job .output_uri = output_uri
5458 job .config = transcoder_v1 .types .JobConfig (
5559 inputs = [
56- transcoder_v1 .types .Input (key = "input0" , uri = input_video_uri ,),
57- transcoder_v1 .types .Input (key = "caption-input0" , uri = input_captions_uri ,),
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+ ),
5868 ],
5969 edit_list = [
6070 transcoder_v1 .types .EditAtom (
61- key = "atom0" , inputs = ["input0" , "caption-input0" ],
71+ key = "atom0" ,
72+ inputs = ["input0" , "caption-input0" ],
6273 ),
6374 ],
6475 elementary_streams = [
@@ -85,7 +96,9 @@ def create_job_with_embedded_captions(
8596 codec = "cea608" ,
8697 mapping_ = [
8798 transcoder_v1 .types .TextStream .TextMapping (
88- atom_key = "atom0" , input_key = "caption-input0" , input_track = 0 ,
99+ atom_key = "atom0" ,
100+ input_key = "caption-input0" ,
101+ input_track = 0 ,
89102 ),
90103 ],
91104 ),
@@ -103,7 +116,9 @@ def create_job_with_embedded_captions(
103116 elementary_streams = ["video-stream0" , "audio-stream0" ],
104117 ),
105118 transcoder_v1 .types .MuxStream (
106- key = "sd-dash" , container = "fmp4" , elementary_streams = ["video-stream0" ],
119+ key = "sd-dash" ,
120+ container = "fmp4" ,
121+ elementary_streams = ["video-stream0" ],
107122 ),
108123 transcoder_v1 .types .MuxStream (
109124 key = "audio-dash" ,
@@ -113,7 +128,9 @@ def create_job_with_embedded_captions(
113128 ],
114129 manifests = [
115130 transcoder_v1 .types .Manifest (
116- file_name = "manifest.m3u8" , type_ = "HLS" , mux_streams = ["sd-hls" ],
131+ file_name = "manifest.m3u8" ,
132+ type_ = "HLS" ,
133+ mux_streams = ["sd-hls" ],
117134 ),
118135 transcoder_v1 .types .Manifest (
119136 file_name = "manifest.mpd" ,
@@ -133,7 +150,9 @@ def create_job_with_embedded_captions(
133150 parser = argparse .ArgumentParser ()
134151 parser .add_argument ("--project_id" , help = "Your Cloud project ID." , required = True )
135152 parser .add_argument (
136- "--location" , help = "The location to start this job in." , default = "us-central1" ,
153+ "--location" ,
154+ help = "The location to start this job in." ,
155+ default = "us-central1" ,
137156 )
138157 parser .add_argument (
139158 "--input_video_uri" ,
0 commit comments