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

@ -4,8 +4,9 @@ import sys
import tkinter as tk import tkinter as tk
from tkinter import ttk, messagebox, filedialog from tkinter import ttk, messagebox, filedialog
import main as main_program import main as main_program
from pathlib import Path
CONFIG_NAME = "config.json" CONFIG_NAME = Path(sys.path[0])/"config.json"
DEFAULT_CONFIG = { DEFAULT_CONFIG = {
"crf": 18, "crf": 18,

View File

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

8
VideoCompress/pack.bat Normal file
View File

@ -0,0 +1,8 @@
@echo off
echo Packing full.
nuitka --standalone config.py --enable-plugin=upx --onefile --enable-plugin=tk-inter --include-data-files=ffmpeg.exe=ffmpeg.exe --include-data-files=ffprobe.exe=ffprobe.exe
rename config.exe full.exe
echo Packing single.
nuitka --standalone main.py --enable-plugin=upx --onefile
echo Packing config.
nuitka --standalone config.py --enable-plugin=upx --onefile --enable-plugin=tk-inter