Limit ffmpeg to 4 threads

This commit is contained in:
Matthew Adams
2021-03-06 14:20:02 +10:00
parent e1a364da51
commit 5ae2d4f4d1

View File

@@ -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