From 5ae2d4f4d121ec998a8d37f5a2debf930c3ab38f Mon Sep 17 00:00:00 2001 From: Matthew Adams Date: Sat, 6 Mar 2021 14:20:02 +1000 Subject: [PATCH] Limit ffmpeg to 4 threads --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index a621167..d91a1cb 100644 --- a/main.py +++ b/main.py @@ -63,7 +63,7 @@ async def on_message(message): bitrateKilobits = (7000 * 8)/duration bitrateKilobits = round(bitrateKilobits) print("Calced bitrate = " + str(bitrateKilobits)) - ffmpeg.input(fileName).output("small_" + fileName, **{'b:v': str(bitrateKilobits) + 'k'}).run() + ffmpeg.input(fileName).output("small_" + fileName, **{'b:v': str(bitrateKilobits) + 'k', '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