forked from MarseyWorld/MarseyWorld
Suppress ffmpeg progress output, fix trailing flag.
parent
3cf838af29
commit
60e4e92e90
|
@ -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(
|
||||||
|
|
Loading…
Reference in New Issue