|
|
@ -99,7 +99,14 @@ def prepare_background(reddit_id: str, W: int, H: int) -> str:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
output.run(quiet=True)
|
|
|
|
output.run(quiet=True)
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
print(e)
|
|
|
|
print('An error occurred while running...')
|
|
|
|
|
|
|
|
print('trying auto error fixing...')
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
os.remove(f"assets/temp/{reddit_id}/background.mp4")
|
|
|
|
|
|
|
|
os.remove(f"assets/temp/{reddit_id}/background_noaudio.mp4")
|
|
|
|
|
|
|
|
prepare_background(reddit_id, W, H)
|
|
|
|
|
|
|
|
except:
|
|
|
|
|
|
|
|
print('Please Rerun the script ')
|
|
|
|
exit()
|
|
|
|
exit()
|
|
|
|
return output_path
|
|
|
|
return output_path
|
|
|
|
|
|
|
|
|
|
|
@ -303,7 +310,7 @@ def make_final_video(
|
|
|
|
text = f"Background by {background_config[2]}"
|
|
|
|
text = f"Background by {background_config[2]}"
|
|
|
|
background_clip = ffmpeg.drawtext(
|
|
|
|
background_clip = ffmpeg.drawtext(
|
|
|
|
background_clip,
|
|
|
|
background_clip,
|
|
|
|
text=text,
|
|
|
|
text=(''),
|
|
|
|
x=f"(w-text_w)",
|
|
|
|
x=f"(w-text_w)",
|
|
|
|
y=f"(h-text_h)",
|
|
|
|
y=f"(h-text_h)",
|
|
|
|
fontsize=12,
|
|
|
|
fontsize=12,
|
|
|
|