From 0e888bc1f1f4bbb99953f6c175ea03e5e248c9d4 Mon Sep 17 00:00:00 2001 From: Hassan Hossam <66433496+Hassan-Hossam@users.noreply.github.com> Date: Sun, 16 Apr 2023 12:23:07 +0200 Subject: [PATCH] Update final_video.py --- video_creation/final_video.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/video_creation/final_video.py b/video_creation/final_video.py index 4838574..794a6f5 100644 --- a/video_creation/final_video.py +++ b/video_creation/final_video.py @@ -99,8 +99,15 @@ def prepare_background(reddit_id: str, W: int, H: int) -> str: try: output.run(quiet=True) except Exception as e: - print(e) - exit() + 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() return output_path @@ -303,7 +310,7 @@ def make_final_video( text = f"Background by {background_config[2]}" background_clip = ffmpeg.drawtext( background_clip, - text=text, + text=(''), x=f"(w-text_w)", y=f"(h-text_h)", fontsize=12,