videocompress 1.2.1

This commit is contained in:
2025-06-26 11:03:32 +08:00
parent 680c222f9f
commit f796f207ea
3 changed files with 15 additions and 3 deletions

View File

@ -13,8 +13,8 @@ import re
root = None
TRAIN = False
ESTI_FILE = Path("esti.out")
CFG_FILE = Path("config.json")
ESTI_FILE = Path(sys.path[0])/"esti.out"
CFG_FILE = Path(sys.path[0])/"config.json"
CFG = {
"crf":"18",
"bitrate": None,
@ -348,9 +348,12 @@ def traverse_directory(root_dir: Path):
prog.advance(task,t)
def test():
os.environ["PATH"] = Path(__file__).parent.as_posix() + os.pathsep + os.environ["PATH"]
try:
subprocess.run([CFG["ffmpeg"],"-version"],stdout=-3,stderr=-3).check_returncode()
except Exception as e:
print(__file__)
logging.critical("无法运行ffmpeg")
exit(-1)
try: