main
John Lauer
Keep all six R11 review clips clean; deliver captions through the Wiki player
e1f6118
"""An explicitly labeled explanatory graphic; never pretend this is screen capture."""
from pathlib import Path
import json,subprocess
R=Path(__file__).resolve().parents[1];O=R/'videos/compact-r11/chapter'
cues=[(0,2.60,'The thermal model needs the complete heat path:'),(3.03,5.65,'from Q1, through its insulating interface,'),(5.91,7.95,'into the heatsink, and out to the air.'),(8.39,11.62,'This comparison uses explicit cooling assumptions.'),(12.06,13.99,'It shows why fan failure matters,'),(14.27,18.01,'but it does not qualify the assembly\nor increase our five-watt rating.')]
def t(s):
m=round(s*1000);return f'00:00:{m//1000:02}.{m%1000:03}'
(O/'03-thermal.vtt').write_text('WEBVTT\n\n'+''.join(f'{t(a)} --> {t(b)}\n{c}\n\n'for a,b,c in cues))
(O/'03-thermal.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)))
n=json.loads((O/'03-thermal.json').read_text())['text'];(O/'03-thermal.txt').write_text(n+'\n')
out=O/'03-thermal-review.mp4'
subprocess.run(['ffmpeg','-y','-loglevel','error','-loop','1','-i',str(R/'revisions/compact-r11/evidence/v5-package-path-scenario.png'),'-i',str(O/'03-thermal.mp3'),'-vf',f"scale=1920:1080,zoompan=z=1+0.012*on/543:x=iw/2-iw/zoom/2:y=ih/2-ih/zoom/2:d=1:s=1280x720:fps=30,pad=1280:810:0:0:color=0x101820",'-af','atrim=end=18.12,loudnorm=I=-16:TP=-1.5:LRA=7','-t','18.12','-r','30','-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/'03-thermal-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','03-thermal','--title','Q1 external heat path: assumptions versus qualification','--description','Authored chart of the actual exploratory network solve, not a screen recording or resolved fin-temperature map.','--raw',str(out),'--narration',n,'--warning','Hypothetical airflow and interface values; no thermal pass or higher power rating.'],check=True)
print('Thermal explanatory review clip prepared; user approval remains pending.')