"""Create a controlled pan from the published CC0 coffee photo; no AI model here."""
import json, pathlib, subprocess, sys
root=pathlib.Path(__file__).resolve().parent
source=root.parent/'images'/'coffee.png'
command=['ffmpeg','-hide_banner','-loglevel','error','-y','-loop','1','-i',str(source),'-f','lavfi','-i','sine=frequency=440:sample_rate=48000:duration=3','-vf',"scale=640:426,crop=568:320:x='36+30*sin(t*1.5)':y=53,scale=320:180:flags=lanczos,setsar=1,format=yuv420p",'-t','3','-r','24','-c:v','libx264','-crf','25','-preset','medium','-c:a','aac','-b:a','96k','-movflags','+faststart',str(root/'coffee-pan-input.mp4')]
subprocess.run(command,check=True)
(root/'fixture-command.json').write_text(json.dumps(command,indent=2)+'\n')
