Revert "optimize video size"

This reverts commit 95e1b40f83.
master
Aevann 2024-02-06 00:49:28 +02:00
parent a6005690c0
commit e77cf784d7
1 changed files with 13 additions and 2 deletions

View File

@ -155,8 +155,19 @@ 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.")
copyfile(old, new)
gevent.spawn(reencode_video, old, new)
if codec != 'h264':
copyfile(old, new)
gevent.spawn(reencode_video, 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)
media = Media(
kind='video',