Suppress ffmpeg progress output, fix trailing flag.

master
Snakes 2022-10-06 15:17:36 -04:00
parent 3cf838af29
commit 60e4e92e90
Signed by: Snakes
GPG Key ID: E745A82778055C7E
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ def process_audio(file):
def webm_to_mp4(old, new, vid): def webm_to_mp4(old, new, vid):
tmp = new.replace('.mp4', '-t.mp4') tmp = new.replace('.mp4', '-t.mp4')
subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-i", old, "-map_metadata", "-1", tmp, "-threads:v", "1"], check=True, stderr=subprocess.STDOUT) subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-threads:v", "1", "-i", old, "-map_metadata", "-1", tmp], check=True, stderr=subprocess.STDOUT)
os.replace(tmp, new) os.replace(tmp, new)
os.remove(old) os.remove(old)
requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS,
@ -97,7 +97,7 @@ def process_video(file):
copyfile(old, new) copyfile(old, new)
gevent.spawn(webm_to_mp4, old, new, g.v.id) gevent.spawn(webm_to_mp4, old, new, g.v.id)
else: else:
subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-i", old, "-map_metadata", "-1", "-c:v", "copy", "-c:a", "copy", new], check=True) subprocess.run(["ffmpeg", "-y", "-loglevel", "warning", "-nostats", "-i", old, "-map_metadata", "-1", "-c:v", "copy", "-c:a", "copy", new], check=True)
os.remove(old) os.remove(old)
media = Media( media = Media(