forked from MarseyWorld/MarseyWorld
optimize video size
parent
6f63629477
commit
95e1b40f83
|
@ -155,19 +155,8 @@ def process_video(file, v):
|
||||||
os.remove(old)
|
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.")
|
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)
|
||||||
copyfile(old, new)
|
gevent.spawn(convert_to_mp4, 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)
|
|
||||||
|
|
||||||
media = Media(
|
media = Media(
|
||||||
kind='video',
|
kind='video',
|
||||||
|
|
Loading…
Reference in New Issue