forked from rDrama/rDrama
1
0
Fork 0

optimize video size

master
Aevann 2024-02-05 09:05:36 +02:00
parent 6f63629477
commit 95e1b40f83
1 changed files with 2 additions and 13 deletions

View File

@ -155,19 +155,8 @@ def process_video(file, v):
os.remove(old)
abort(400, "Something went wrong processing your video and it might be on our end. Please try uploading it to https://pomf2.lain.la and post the link instead.")
if codec != 'h264':
copyfile(old, new)
gevent.spawn(convert_to_mp4, old, new)
else:
try:
ffmpeg.input(old).output(new, loglevel="quiet", map_metadata=-1, acodec="copy", vcodec="copy").run()
except:
os.remove(old)
if os.path.isfile(new):
os.remove(new)
abort(400)
os.remove(old)
copyfile(old, new)
gevent.spawn(convert_to_mp4, old, new)
media = Media(
kind='video',