mirror of
https://github.com/thewesker/Video-Archive-Discord-Bot.git
synced 2025-12-20 04:11:05 -05:00
Hard limit file sizes, reduce audio bitrate
This commit is contained in:
2
main.py
2
main.py
@@ -112,7 +112,7 @@ async def on_message(message):
|
|||||||
else:
|
else:
|
||||||
bitrateKilobits = 800
|
bitrateKilobits = 800
|
||||||
print("Calced bitrate = " + str(bitrateKilobits))
|
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:
|
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