Capture pipeline
getUserMedia() opens a live video stream into the page. When you trigger the shutter (immediately or after the countdown timer finishes), the current video frame is drawn onto an off-screen canvas, then the canvas is encoded to a PNG data URL. That data URL is handed to you as an instant local download - the frame never leaves the browser.