From 54491985e61e4acb72c714485a4b7f2c0f5434c0 Mon Sep 17 00:00:00 2001 From: Matthew Adams Date: Sun, 18 Apr 2021 20:30:39 +1000 Subject: [PATCH] Hard limit file sizes, reduce audio bitrate --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 5515f62..d2db177 100644 --- a/main.py +++ b/main.py @@ -112,7 +112,7 @@ async def on_message(message): else: bitrateKilobits = 800 print("Calced bitrate = " + str(bitrateKilobits)) - ffmpeg.input(fileName).output("small_" + fileName, **{'b:v': str(bitrateKilobits) + 'k', 'threads': '4'}).run() + ffmpeg.input(fileName).output("small_" + fileName, **{'b:v': str(bitrateKilobits) + 'k', 'b:a': '64k', 'fs': '8M', 'threads': '4'}).run() with open("small_" + fileName, 'rb') as fp: await message.channel.send(file=discord.File(fp, str("small_" + fileName))) # Delete the compressed and original file