[TIDY] Apply autopep8 formatting
This commit is contained in:
parent
909bf79673
commit
b0e83b1134
12 changed files with 405 additions and 329 deletions
|
@ -52,20 +52,21 @@ parser.add_argument('--force', action="store_true", default=False, help='''
|
|||
args = parser.parse_args()
|
||||
|
||||
if (args.skip is None):
|
||||
args.skip = []
|
||||
args.skip = []
|
||||
|
||||
|
||||
def headline(str):
|
||||
print("##################################################")
|
||||
print(str)
|
||||
print("##################################################")
|
||||
print()
|
||||
print("##################################################")
|
||||
print(str)
|
||||
print("##################################################")
|
||||
print()
|
||||
|
||||
|
||||
def error(str):
|
||||
headline(str)
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
headline(str)
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
cparser = ConfigParser()
|
||||
cparser.read(os.path.join(os.path.dirname(args.project), 'config.ini'))
|
||||
|
@ -145,6 +146,7 @@ if args.debug:
|
|||
else:
|
||||
events = list(schedulelib.events(schedule))
|
||||
|
||||
|
||||
def describe_event(event):
|
||||
return "#{}: {}".format(event['id'], event['title'])
|
||||
|
||||
|
@ -231,58 +233,62 @@ def enqueue_job(event):
|
|||
outfile = os.path.join(os.path.dirname(args.project), event_id + '.ts')
|
||||
|
||||
videofilter = "drawtext=fontfile={fontfile}:fontsize={fontsize}:fontcolor={fontcolor}:x={x}:y={y}:text='{text}':".format(
|
||||
fontfile = font_t,
|
||||
fontsize = title_fontsize,
|
||||
fontcolor = title_fontcolor,
|
||||
x = title_x,
|
||||
y = title_y,
|
||||
text = t)
|
||||
fontfile=font_t,
|
||||
fontsize=title_fontsize,
|
||||
fontcolor=title_fontcolor,
|
||||
x=title_x,
|
||||
y=title_y,
|
||||
text=t)
|
||||
videofilter += "alpha='if(lt(t,{fade_in_start_time}),0,if(lt(t,{fade_in_end_time}),(t-{fade_in_start_time})/{fade_duration},if(lt(t,{fade_out_start_time}),1,if(lt(t,{fade_out_end_time}),({fade_duration}-(t-{fade_out_start_time}))/{fade_duration},0))))',".format(
|
||||
fade_in_start_time = title_in,
|
||||
fade_in_end_time = title_in + fade_duration,
|
||||
fade_out_start_time = title_in + fade_duration + title_duration,
|
||||
fade_out_end_time = title_in + fade_duration + title_duration + fade_duration,
|
||||
fade_duration = fade_duration
|
||||
)
|
||||
fade_in_start_time=title_in,
|
||||
fade_in_end_time=title_in + fade_duration,
|
||||
fade_out_start_time=title_in + fade_duration + title_duration,
|
||||
fade_out_end_time=title_in + fade_duration + title_duration + fade_duration,
|
||||
fade_duration=fade_duration
|
||||
)
|
||||
videofilter += "drawtext=fontfile={fontfile}:fontsize={fontsize}:fontcolor={fontcolor}:x={x}:y={y}:text='{text}':".format(
|
||||
fontfile = font_s,
|
||||
fontsize = speaker_fontsize,
|
||||
fontcolor = speaker_fontcolor,
|
||||
x = speaker_x,
|
||||
y = speaker_y,
|
||||
text = s)
|
||||
fontfile=font_s,
|
||||
fontsize=speaker_fontsize,
|
||||
fontcolor=speaker_fontcolor,
|
||||
x=speaker_x,
|
||||
y=speaker_y,
|
||||
text=s)
|
||||
videofilter += "alpha='if(lt(t,{fade_in_start_time}),0,if(lt(t,{fade_in_end_time}),(t-{fade_in_start_time})/{fade_duration},if(lt(t,{fade_out_start_time}),1,if(lt(t,{fade_out_end_time}),({fade_duration}-(t-{fade_out_start_time}))/{fade_duration},0))))',".format(
|
||||
fade_in_start_time = speaker_in,
|
||||
fade_in_end_time = speaker_in + fade_duration,
|
||||
fade_out_start_time = speaker_in + fade_duration + speaker_duration,
|
||||
fade_out_end_time = speaker_in + fade_duration + speaker_duration + fade_duration,
|
||||
fade_duration = fade_duration
|
||||
)
|
||||
fade_in_start_time=speaker_in,
|
||||
fade_in_end_time=speaker_in + fade_duration,
|
||||
fade_out_start_time=speaker_in + fade_duration + speaker_duration,
|
||||
fade_out_end_time=speaker_in + fade_duration + speaker_duration + fade_duration,
|
||||
fade_duration=fade_duration
|
||||
)
|
||||
videofilter += "drawtext=fontfile={fontfile}:fontsize={fontsize}:fontcolor={fontcolor}:x={x}:y={y}:text={text}:".format(
|
||||
fontfile = font_tt,
|
||||
fontsize = text_fontsize,
|
||||
fontcolor = text_fontcolor,
|
||||
x = text_x,
|
||||
y = text_y,
|
||||
text = text_text)
|
||||
fontfile=font_tt,
|
||||
fontsize=text_fontsize,
|
||||
fontcolor=text_fontcolor,
|
||||
x=text_x,
|
||||
y=text_y,
|
||||
text=text_text)
|
||||
videofilter += "alpha='if(lt(t,{fade_in_start_time}),0,if(lt(t,{fade_in_end_time}),(t-{fade_in_start_time})/{fade_duration},if(lt(t,{fade_out_start_time}),1,if(lt(t,{fade_out_end_time}),({fade_duration}-(t-{fade_out_start_time}))/{fade_duration},0))))'".format(
|
||||
fade_in_start_time = text_in,
|
||||
fade_in_end_time = text_in + fade_duration,
|
||||
fade_out_start_time = text_in + fade_duration + text_duration,
|
||||
fade_out_end_time = text_in + fade_duration + text_duration + fade_duration,
|
||||
fade_duration = fade_duration
|
||||
)
|
||||
fade_in_start_time=text_in,
|
||||
fade_in_end_time=text_in + fade_duration,
|
||||
fade_out_start_time=text_in + fade_duration + text_duration,
|
||||
fade_out_end_time=text_in + fade_duration + text_duration + fade_duration,
|
||||
fade_duration=fade_duration
|
||||
)
|
||||
|
||||
if fileformat == '.mov':
|
||||
if alpha == 'true':
|
||||
if prores == 'true':
|
||||
cmd = 'ffmpeg -y -i "{0}" -vf "{1}" -vcodec prores_ks -pix_fmt yuva444p10le -profile:v 4444 -shortest -movflags faststart -f mov "{2}"'.format(infile, videofilter, outfile)
|
||||
cmd = 'ffmpeg -y -i "{0}" -vf "{1}" -vcodec prores_ks -pix_fmt yuva444p10le -profile:v 4444 -shortest -movflags faststart -f mov "{2}"'.format(
|
||||
infile, videofilter, outfile)
|
||||
else:
|
||||
cmd = 'ffmpeg -y -i "{0}" -vf "{1}" -shortest -c:v qtrle -movflags faststart -f mov "{2}"'.format(infile, videofilter, outfile)
|
||||
cmd = 'ffmpeg -y -i "{0}" -vf "{1}" -shortest -c:v qtrle -movflags faststart -f mov "{2}"'.format(
|
||||
infile, videofilter, outfile)
|
||||
else:
|
||||
cmd = 'ffmpeg -y -i "{0}" -vf "{1}" -map 0:0 -c:v mpeg2video -q:v 2 -aspect 16:9 -map 0:1 -c:a mp2 -b:a 384k -shortest -f mpegts "{2}"'.format(infile, videofilter, outfile)
|
||||
cmd = 'ffmpeg -y -i "{0}" -vf "{1}" -map 0:0 -c:v mpeg2video -q:v 2 -aspect 16:9 -map 0:1 -c:a mp2 -b:a 384k -shortest -f mpegts "{2}"'.format(
|
||||
infile, videofilter, outfile)
|
||||
else:
|
||||
cmd = 'ffmpeg -y -i "{0}" -vf "{1}" -map 0:0 -c:v mpeg2video -pix_fmt:v yuv420p -qscale:v 2 -qmin:v 2 -qmax:v 7 -keyint_min 0 -bf 0 -g 0 -maxrate:0 90M -aspect 16:9 -map 0:1 -c:a mp2 -b:a 384k -shortest -f mpegts "{2}"'.format(infile, videofilter, outfile)
|
||||
cmd = 'ffmpeg -y -i "{0}" -vf "{1}" -map 0:0 -c:v mpeg2video -pix_fmt:v yuv420p -qscale:v 2 -qmin:v 2 -qmax:v 7 -keyint_min 0 -bf 0 -g 0 -maxrate:0 90M -aspect 16:9 -map 0:1 -c:a mp2 -b:a 384k -shortest -f mpegts "{2}"'.format(
|
||||
infile, videofilter, outfile)
|
||||
|
||||
if args.debug:
|
||||
print(cmd)
|
||||
|
@ -321,5 +327,3 @@ for event in events:
|
|||
|
||||
|
||||
print('all done')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue