skill
EDA Skillpack
Public Made by Adomby adom
All skills for all EDA capabilities across the Adom ecosystem.
main
from pathlib import Path
import subprocess,json
D=Path(__file__).parent;out=D/'publish/docs/videos';out.mkdir(parents=True,exist_ok=True)
parts=[('placement-first',0,None,'Independent Astra placement: 122 movable parts; 27 fixed contacts'),('desktop-m0-20260913-192929',0,None,'Placement correction: turn the shunt so the current-sense taps do not cross'),('desktop-m0-20260913-201333',0,None,'Add the two prescribed inner reference planes'),('routing-original',0,410,'Astra routes the independently placed board through native undo steps'),('routing-original',460,None,'Power pours and 40 additional stitching vias; 50 seconds of unrelated test removed'),('final-review',0,None,'Separate final review: Kelvin pad isolation; +12 V tail trimmed off camera')]
manifest=[];files=[];cursor=0
for i,(name,start,end,title) in enumerate(parts):
src=D/'media'/f'{name}.mp4';dur=float(json.loads(subprocess.check_output(['ffprobe','-v','error','-show_entries','format=duration','-of','json',str(src)]))['format']['duration']);end=end or dur
caption=D/'media'/f'stage-{i}.txt';caption.write_text(title+' | Recorded playback 1x')
dest=D/'media'/f'encoded-{i}.mp4';vf=f"setpts=PTS-STARTPTS,scale=1920:-2,drawbox=x=0:y=0:w=iw:h=36:[email protected]:t=fill,drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:textfile={caption}:fontsize=19:fontcolor=white:x=15:y=7"
cmd=['ffmpeg','-v','warning','-y','-ss',str(start),'-i',str(src),'-t',str(end-start),'-vf',vf,'-c:v','libx264','-preset','fast','-crf','22','-pix_fmt','yuv420p','-fps_mode','cfr','-r','30','-video_track_timescale','90000','-movflags','+faststart','-an',str(dest)]
print('encoding',i,name,flush=True);subprocess.run(cmd,check=True);files.append(dest)
manifest.append(dict(source=src.name,sourceStart=start,sourceEnd=end,outputStart=cursor,playbackFactor=1,title=title,command=cmd));cursor+=end-start
lst=D/'media/concat.txt';lst.write_text(''.join("file '"+str(p)+"'\n" for p in files));dest=out/'astra-esc-independent.mp4'
subprocess.run(['ffmpeg','-v','warning','-y','-f','concat','-safe','0','-i',str(lst),'-c','copy','-movflags','+faststart',str(dest)],check=True)
subprocess.run(['ffmpeg','-v','error','-y','-sseof','-2','-i',str(dest),'-frames:v','1','-q:v','2',str(out/'astra-esc-independent-poster.jpg')],check=True)
(D/'evidence/edit-manifest.json').write_text(json.dumps({'segments':manifest,'notes':['Distinct real recorded stages joined; planning gaps are not represented as video.','No speedup applied. Original recorder timeline has known static-hold timing defects, AB issue195.','Main capture finalized during external runtime restart after final stitching; recovered MP4 preserved.','Exactly source seconds410-460 omitted from main capture to remove an unrelated recorder test and idle time.','The +12V dangling-tail trim happened off camera between main and final-review clips.','Top stage labels added during editing; the live caption calls used same-ID text updates, never hide/show loops.']},indent=2))
print('DONE',dest,flush=True)