main
John Lauer Keep all six R11 review clips clean; deliver captions through the Wiki player e1f6118
from pathlib import Path
import json,subprocess
R=Path(__file__).resolve().parents[1];O=R/'videos/compact-r11/chapter'
n='These are calculated current densities on the revised copper. All six networks pass the screen. Cooling qualification is still open.'
(O/'06-current.txt').write_text(n+'\n')
cues=[(0.158,3.059,'These are calculated current densities\non the revised copper.'),(3.488,5.160,'All six networks pass the screen.'),(5.571,7.456,'Cooling qualification is still open.')]
def t(s):
 m=round(s*1000);return f'00:00:{m//1000:02}.{m%1000:03}'
(O/'06-current.vtt').write_text('WEBVTT\n\n'+''.join(f'{t(a)} --> {t(b)}\n{c}\n\n'for a,b,c in cues))
(O/'06-current.srt').write_text('\n'.join(f"{i+1}\n{t(a).replace('.',',')} --> {t(b).replace('.',',')}\n{c}\n"for i,(a,b,c)in enumerate(cues)))
out=O/'06-current-review.mp4'
f=f"[0:v]trim=end=12,setpts=(PTS-STARTPTS)/{12/7.57},crop=2560:1350:0:132,scale=1280:675,pad=1280:810:0:0:color=0x101820,fps=30[v];[1:a]atrim=end=7.57,asetpts=PTS-STARTPTS,loudnorm=I=-16:TP=-1.5:LRA=7[a]"
subprocess.run(['ffmpeg','-y','-loglevel','error','-i',str(R/'videos/compact-r11/window-3147662-20261014-030237.mp4'),'-i',str(O/'06-current.mp3'),'-filter_complex',f,'-map','[v]','-map','[a]','-t','7.57','-c:v','libx264','-preset','fast','-crf','23','-pix_fmt','yuv420p','-c:a','aac','-b:a','96k','-movflags','+faststart',str(out)],check=True)
q=subprocess.run(['ffmpeg','-hide_banner','-i',str(out),'-af','silencedetect=noise=-40dB:d=0.7','-f','null','-'],capture_output=True,text=True,check=True);(O/'06-current-silence.log').write_text(q.stderr);assert 'silence_start' not in q.stderr
subprocess.run(['adom-video-post','manifest','add',str(O/'storyboard.json'),'--id','06-current','--title','Fresh v5 current screen','--description','Actual live Fields net selection, 1.59x. Explicit current-only presentation; invalid assembly thermal inference excluded.','--raw',str(out),'--narration',n,'--warning','Computed current screen, not measurement or thermal acceptance. Temporary UI note and crop isolate current results; saved solver data is unchanged.'],check=True)