# Redact startup UI, which can include private provider metadata.
# Keeps the actual interaction before quit and the actual result after relaunch.
import json,subprocess,sys
from pathlib import Path
p=Path(sys.argv[1]); phase=json.loads((p/'phases.json').read_text())
a=max(0,phase['quit']-.3); b=phase['restored']
f=f"drawbox=x=0:y=0:w=iw:h=ih:color=0x172333:t=fill:enable='between(t,{a},{b})',drawtext=text='Electron quit and relaunch':fontcolor=white:fontsize=30:x=(w-tw)/2:y=(h-th)/2:enable='between(t,{a},{b})'"
subprocess.run(['ffmpeg','-hide_banner','-loglevel','error','-y','-i',str(p/'restart.mp4'),'-vf',f,'-c:v','libx264','-preset','fast','-crf','23','-pix_fmt','yuv420p','-movflags','+faststart',str(p/'restart-public.mp4')],check=True)
subprocess.run(['ffmpeg','-hide_banner','-loglevel','error','-y','-i',str(p/'restart-public.mp4'),'-vf','fps=1/2,scale=422:390,tile=5x7','-frames:v','1',str(p/'video-review.png')],check=True)
