From 39d3e4482aa3d64f88afe20edef6dcab7c288b59 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 20 Oct 2024 16:17:21 +0300 Subject: [PATCH] reencode HE-AACv2 (not supported on chromium desktop) https://www.chromium.org/audio-video/ --- files/helpers/media.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/helpers/media.py b/files/helpers/media.py index e9b4211e9..e8ccd1d5a 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -184,7 +184,9 @@ def process_video(file, v): if stream["codec_type"] == "video": codec = stream['codec_name'] bitrate = int(stream.get('bit_rate', 3000000)) - break + elif stream["codec_type"] == "audio": + profile = stream['profile'] + except: os.remove(old) stop(400, "Something went wrong processing your video on our end. Please try uploading it to https://pomf2.lain.la and post the link instead.") @@ -194,7 +196,7 @@ def process_video(file, v): stop(400, "Something went wrong processing your video on our end. Please try uploading it to https://pomf2.lain.la and post the link instead.") is_reencoding = False - if codec != 'h264': + if codec != 'h264' or profile != 'LC': is_reencoding = True copyfile(old, new) gevent.spawn(reencode_video, old, new)