mirror of
https://github.com/thewesker/Video-Archive-Discord-Bot.git
synced 2025-12-20 04:11:05 -05:00
Limit ffmpeg to 4 threads
This commit is contained in:
2
main.py
2
main.py
@@ -63,7 +63,7 @@ async def on_message(message):
|
|||||||
bitrateKilobits = (7000 * 8)/duration
|
bitrateKilobits = (7000 * 8)/duration
|
||||||
bitrateKilobits = round(bitrateKilobits)
|
bitrateKilobits = round(bitrateKilobits)
|
||||||
print("Calced bitrate = " + str(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:
|
with open("small_" + fileName, 'rb') as fp:
|
||||||
await message.channel.send(file=discord.File(fp, str("small_" + fileName)))
|
await message.channel.send(file=discord.File(fp, str("small_" + fileName)))
|
||||||
# Delete the compressed and original file
|
# Delete the compressed and original file
|
||||||
|
|||||||
Reference in New Issue
Block a user