|
61 | 61 | if args.p:
|
62 | 62 | codec = ['prores','-profile:v','3']
|
63 | 63 | else:
|
64 |
| - codec = ['libx264','-pix_fmt','yuv420p', '-crf', '21'] |
| 64 | + codec = ['libx264','-pix_fmt','yuv420p', '-crf', '19' '-veryfast'] |
65 | 65 |
|
66 | 66 | if args.s:
|
67 | 67 | print '***********************************************'
|
68 | 68 | print 'You have chosen to burn in subtitles. This will take a long time. A better approach may be to make a clean transcode to a high quality format such as PRORES and make further clean or subtitled surrogates from that new copy. '
|
69 | 69 | print '***********************************************'
|
70 |
| - time.sleep(5) |
| 70 | + time.sleep(1) |
71 | 71 |
|
72 | 72 | dcp_dir = args.input
|
73 | 73 | temp_dir = tempfile.gettempdir()
|
|
150 | 150 | print 'Please select which CPL youd like to process'
|
151 | 151 | chosen_cpl = raw_input()
|
152 | 152 | cpl_parse = etree.parse(cpl_list[int(chosen_cpl) - 1])
|
153 |
| - |
| 153 | + if args.s: |
| 154 | + cpl_namespace = cpl_parse.xpath('namespace-uri(.)') |
| 155 | + subtitle_language = cpl_parse.findall('//ns:MainSubtitle/ns:Language',namespaces={'ns': cpl_namespace}) |
| 156 | + print 'This CPL contains ', subtitle_language[0].text, ' subtitles. Proceed?' |
| 157 | + subs_confirmation = raw_input('Y/N') |
| 158 | + if subs_confirmation not in ['Y','y']: |
| 159 | + print 'please run script again and choose different CPL' # use a while loop with a function to return to the cpl choice. |
| 160 | + sys.exit() |
| 161 | + |
154 | 162 |
|
155 |
| - |
156 | 163 | print cpl_parse
|
157 | 164 | cpl_namespace = cpl_parse.xpath('namespace-uri(.)')
|
158 |
| - |
| 165 | + subtitle_language = cpl_parse.findall('//ns:MainSubtitle/ns:Language',namespaces={'ns': cpl_namespace}) |
159 | 166 | xmluuid = cpl_parse.findall('//ns:MainPicture/ns:Id',namespaces={'ns': cpl_namespace})
|
160 | 167 | xmluuid_audio = cpl_parse.findall('//ns:MainSound/ns:Id',namespaces={'ns': cpl_namespace})
|
161 | 168 | xmluuid_subs = cpl_parse.findall('//ns:MainSubtitle/ns:Id',namespaces={'ns': cpl_namespace})
|
|
165 | 172 | intrinsic_audio = cpl_parse.findall('//ns:MainSound/ns:IntrinsicDuration',namespaces={'ns': cpl_namespace})
|
166 | 173 | entry_image = cpl_parse.findall('//ns:MainPicture/ns:EntryPoint',namespaces={'ns': cpl_namespace})
|
167 | 174 | entry_audio = cpl_parse.findall('//ns:MainSound/ns:EntryPoint',namespaces={'ns': cpl_namespace})
|
| 175 | + |
168 | 176 | video_fps = cpl_parse.xpath('//ns:MainPicture/ns:EditRate',namespaces={'ns': cpl_namespace})
|
169 | 177 | for i in video_fps:
|
170 | 178 | print i, 'hjkhjkyuiyukhukhjkhj'
|
|
262 | 270 | print subs
|
263 | 271 | counter = 0
|
264 | 272 | count = len(subs)
|
265 |
| - |
| 273 | + if not len(subs) == len(pic_mxfs): |
| 274 | + print 'The amount of picture files does not equal the amount of subtitles. This feature is not supported yet. Sorry!' |
| 275 | + sys.exit() |
| 276 | + |
266 | 277 | while counter < count:
|
267 | 278 | srt_file = temp_dir + '/' + os.path.basename(subs[counter]) +'.srt'
|
268 | 279 | output_filename = os.path.basename(dcp_dir) + '_subs_reel' + str(counter + 1) + time.strftime("_%Y_%m_%dT%H_%M_%S")
|
|
302 | 313 | myfile.write(in_point + ' --> ' + out + '\n')
|
303 | 314 | bla = [bla.text for bla in xmlo.iterfind('.//Subtitle[%s]//Text' % int(counter2) ) ]
|
304 | 315 | for i in bla:
|
305 |
| - myfile.write(i + '\n') |
| 316 | + myfile.write(i.encode("utf-8") + '\n') |
306 | 317 | myfile.write('\n')
|
307 | 318 |
|
308 | 319 | print 'Transforming ' + str(current_sub_counter) + ' of' + str(count) + ' subtitles\r' ,
|
@@ -379,7 +390,7 @@ def write_textfile(textfile, list_type):
|
379 | 390 |
|
380 | 391 | # Removes PKLs from list of files to hash, as these files are not in manifest.
|
381 | 392 |
|
382 |
| -print pic_mxfs |
| 393 | + |
383 | 394 | if email == 'enabled':
|
384 | 395 | emailfrom = ""
|
385 | 396 | emailto = ['', '']
|
|
0 commit comments