From 8a24a9e77309327b70c40b9823ee37151bab28d6 Mon Sep 17 00:00:00 2001 From: Shayan Jizan Date: Sun, 21 May 2023 13:49:05 -0400 Subject: [PATCH 1/3] Update Dockerfile Install the ffmpeg dependency. --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 6d090c6..4cf2a71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.10.9-slim RUN apt update +RUN apt-get install -y ffmpeg RUN apt install python3-pip -y RUN mkdir /app From fcf6ef93e520cb5250e4ec66a44ea8053ad2bce9 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 26 May 2023 17:16:53 -0300 Subject: [PATCH 2/3] Fix #1649 randrange bug --- video_creation/background.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/video_creation/background.py b/video_creation/background.py index 010f15e..7cfdf81 100644 --- a/video_creation/background.py +++ b/video_creation/background.py @@ -47,7 +47,14 @@ def get_start_and_end_times(video_length: int, length_of_clip: int) -> Tuple[int Returns: tuple[int,int]: Start and end time of the randomized interval """ - random_time = randrange(180, int(length_of_clip) - int(video_length)) + initialValue = 180 + # Issue #1649 - Ensures that will be a valid interval in the video + while(int(length_of_clip) <= int(video_length+initialValue)): + if(initialValue == initialValue //2): + raise Exception("Your background is too short for this video length") + else: + initialValue //= 2 #Divides the initial value by 2 until reach 0 + random_time = randrange(initialValue, int(length_of_clip) - int(video_length)) return random_time, random_time + video_length @@ -157,4 +164,4 @@ def chop_background( return background_config["video"][2] # Create a tuple for downloads background (background_audio_options, background_video_options) -background_options = load_background_options() \ No newline at end of file +background_options = load_background_options() From 47f762eb0d93ce2533b05064553606ff2bfb9104 Mon Sep 17 00:00:00 2001 From: Xpl0itU <24777100+Xpl0itU@users.noreply.github.com> Date: Sat, 27 May 2023 18:06:16 +0200 Subject: [PATCH 3/3] Fix adding ffmpeg to path This fixes adding ffmpeg to the path by adding it to the user path instead of the system path, which doesn't require admin privileges to do --- utils/ffmpeg_install.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/ffmpeg_install.py b/utils/ffmpeg_install.py index 5522028..1f72cfb 100644 --- a/utils/ffmpeg_install.py +++ b/utils/ffmpeg_install.py @@ -23,7 +23,7 @@ def ffmpeg_install_windows(): os.remove(f"ffmpeg/doc/{file}") os.rmdir("ffmpeg/doc") # Add to the path - subprocess.run("setx /M PATH \"%PATH%;%CD%\\ffmpeg\"", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + subprocess.run("setx PATH \"%PATH%;%CD%\\ffmpeg\"", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) print("FFmpeg installed successfully! Please restart your computer and then re-run the program.") exit() except Exception as e: @@ -81,4 +81,4 @@ def ffmpeg_install(): except Exception as e: print("Welcome fellow traveler! You're one of the few who have made it this far. We have no idea how you got at this error, but we're glad you're here. Please report this error to the developer, and we'll try to fix it as soon as possible. Thank you for your patience!") print(e) - return None \ No newline at end of file + return None