aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2025-09-17 16:17:34 +0200
committersalmonik <raisersoft@proton.me>2025-09-17 16:17:34 +0200
commitcdd6fe95ba11db69f7a65130b922f2ac96569922 (patch)
treebb2e78f7dbfde35d12da0776ed98ad4874480528
parentMerge remote-tracking branch 'origin/main' (diff)
downloadsenator-sperma-cdd6fe95ba11db69f7a65130b922f2ac96569922.tar.gz
senator-sperma-cdd6fe95ba11db69f7a65130b922f2ac96569922.zip
auto overwrite files in ffmpeg
-rw-r--r--cogs/compression.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cogs/compression.py b/cogs/compression.py
index b684f9f..177f543 100644
--- a/cogs/compression.py
+++ b/cogs/compression.py
@@ -41,9 +41,9 @@ class Compression(commands.Cog):
41 logger.info(f"Compression started for: {file_type}") 41 logger.info(f"Compression started for: {file_type}")
42 42
43 if file_type == "Video": 43 if file_type == "Video":
44 command = f"ffmpeg -i {file_path} -c:v libx264 -crf 51 -b:v 100 -vf 'fps=10,scale=trunc(iw*0.5/2)*2:trunc(ih*0.5/2)*2' -preset ultrafast -c:a libopus -b:a 500 {output_path}" 44 command = f"ffmpeg -y -i {file_path} -c:v libx264 -crf 51 -b:v 100 -vf 'fps=10,scale=trunc(iw*0.5/2)*2:trunc(ih*0.5/2)*2' -preset ultrafast -c:a libopus -b:a 500 {output_path}"
45 elif file_type == "Audio": 45 elif file_type == "Audio":
46 command = f"ffmpeg -i {file_path} -ac 1 -b:a 500 -acodec libopus {output_path}" 46 command = f"ffmpeg -y -i {file_path} -ac 1 -b:a 500 -acodec libopus {output_path}"
47 elif file_type == "Image": 47 elif file_type == "Image":
48 ext = os.path.splitext(file_path)[1].lower() 48 ext = os.path.splitext(file_path)[1].lower()
49 if ext in [".jpg", ".jpeg"]: 49 if ext in [".jpg", ".jpeg"]: