forked from rDrama/rDrama
1
0
Fork 0

use ffpmeg-python fully

master
Aevann 2024-03-01 00:28:14 +02:00
parent d062843e68
commit d852a880d1
1 changed files with 1 additions and 2 deletions

View File

@ -7,7 +7,6 @@ from shutil import copyfile
from sys import stdout
from urllib.parse import urlparse
import random
import subprocess
import gevent
import requests
@ -660,7 +659,7 @@ def submit_post(v, hole=None):
p.url = process_video(file, v)
name = f'/images/{time.time()}'.replace('.','') + '.webp'
try:
subprocess.run(["ffmpeg", "-loglevel", "quiet", "-y", "-i", p.url, "-vf", "scale='iw':-2", "-q:v", "3", "-frames:v", "1", name], check=True, timeout=30)
x = ffmpeg.input(p.url).output(name, loglevel="quiet", map_metadata=-1, **{"vf":"scale='iw':-2", 'q:v':3, 'frames:v':1}).run()
except:
if os.path.isfile(name):
os.remove(name)