# Redact the unrelated local command-path paragraph before the switch dialog opens.
# The update track selector and every skip reason remain visible.
import os,sys,subprocess
root=sys.argv[1]
for name in sorted(os.listdir(root)):
    if name.endswith('.jpg') and 7 <= int(name[:-4]) <= 13:
        subprocess.run(['convert',os.path.join(root,name),'-fill','#f8f8f8','-draw','rectangle 352,320 990,342','-fill','#666666','-font','DejaVu-Sans','-pointsize','12','-annotate','+352+334','Local command path redacted',os.path.join(root,name)],check=True)
subprocess.run(['ffmpeg','-y','-v','error','-f','concat','-safe','0','-i',os.path.join(root,'frames.txt'),'-vf','pad=ceil(iw/2)*2:ceil(ih/2)*2','-c:v','libx264','-pix_fmt','yuv420p','-movflags','+faststart',os.path.join(os.path.dirname(root),'track-switch.mp4')],check=True)
