Improve intro logo timing
This commit is contained in:
parent
2f829382c4
commit
cdb57525ca
3 changed files with 118 additions and 10 deletions
|
|
@ -22,6 +22,7 @@ from shlex import quote
|
|||
|
||||
ROOT = Path(__file__).resolve().parent
|
||||
MOVMAKER = ROOT / "movmaker.py"
|
||||
INTRO_LOGO = ROOT / "img" / "moto_travel.png"
|
||||
PUSH_SENDER = ROOT / "send_push.js"
|
||||
PUSH_CONFIG = Path.home() / ".config" / "mvlog" / "push.json"
|
||||
STATE_NAME = ".movmaker-state.json"
|
||||
|
|
@ -30,6 +31,7 @@ ENABLED_NAME = ".movmaker-enabled"
|
|||
PREVIEW_NAME = ".movmaker-preview"
|
||||
HIDDEN_NAME = ".mvlog-hidden"
|
||||
NOTIFIED_CACHE = "cache/push_notifications.json"
|
||||
INTRO_LOGO_ALPHA = "0.5"
|
||||
|
||||
|
||||
def now() -> str:
|
||||
|
|
@ -204,7 +206,14 @@ def publish_output(host: str, remote_root: str, local_mp4: Path, old_output: str
|
|||
|
||||
def render_job(local_input: Path, local_out: Path, extra_args: list[str]) -> Path:
|
||||
local_out.mkdir(parents=True, exist_ok=True)
|
||||
cmd = [sys.executable, str(MOVMAKER), str(local_input), "--out-dir", str(local_out), *extra_args]
|
||||
intro_logo = INTRO_LOGO if INTRO_LOGO.exists() else None
|
||||
intro_args = []
|
||||
if intro_logo is not None:
|
||||
intro_args = [
|
||||
"--intro-logo", str(intro_logo),
|
||||
"--intro-logo-alpha", INTRO_LOGO_ALPHA,
|
||||
]
|
||||
cmd = [sys.executable, str(MOVMAKER), str(local_input), "--out-dir", str(local_out), *intro_args, *extra_args]
|
||||
subprocess.run(cmd, check=True)
|
||||
outputs = sorted(local_out.glob("*.mp4"), key=lambda p: p.stat().st_mtime, reverse=True)
|
||||
if not outputs:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue