AI Video Skills · Skill 9 of 10
Phone screen compositing for AI video
Phone screen compositing for AI video means generating the shot with a flat chroma-key green screen, tracking the four screen corners with sub-pixel accuracy and then warping real UI into the quad frame by frame. Video models cannot render readable, correct UI text, and full-screen UI cards cut between shots look like a slideshow. This skill includes track_screen.py and composite_screen.py.
Install
Install this skill
The plugin and npx commands install all ten skills; the manual copy installs only this one.
/plugin marketplace add klakix-ai/ai-video-skills
/plugin install ai-video-skills@klakix-ai-videonpx skills add klakix-ai/ai-video-skillsgit clone https://github.com/klakix-ai/ai-video-skills.git
cp -r ai-video-skills/skills/phone-screen-compositing ~/.claude/skills/Source: skills/phone-screen-compositing/SKILL.md on GitHub (MIT). For Codex use ~/.codex/skills/; for Claude.ai download a zip from Releases.
Key rules
What the skill teaches
Short versions of the rules in the skill. The numbers come from our own productions.
Generate the key frame with the screen "flat, evenly lit, pure chroma-key green, no content, no reflections", and keep hand motion moderate. Fast wrist turns and fabric covering the screen are the hard cases.
Prompt the video to keep the screen a perfectly flat, uniform green the whole time. Kling held this 5 of 5 times for 5 seconds; most models drift without it.
Track the corners per frame with no temporal smoothing. Smoothing over 5 to 9 frames made the UI lag up to 27 px behind the phone at 716 px width.
Only nearly-still frames (under 0.5 px/frame) get a tiny 1-2-1 filter; above 2 px/frame the raw measurement is used.
Find corners from fitted straight lines on the sub-pixel contour of each edge and intersect them, which gives sharp virtual corners even when the phone has rounded ones.
Render the UI as HTML frame by frame, or in a motion tool, with a neutral phone-style layout and no real app names or logos. Keep animations calm, with no overshoot or full-frame shake.
Drive scrolling from the tracked fingertip so the UI follows the thumb.
Composite with a soft green-based alpha matte so fingers stay in front, add slight blur (sigma about 0.55), about 93% brightness and a faint glass reflection.
For upscaled clips, track on the raw clip, scale the corners by separate x and y factors and verify frame alignment after the upscaler.
Keep occluded frames out of the edit window when the phone passes behind a sleeve or hand, and use the --occlusion option only when needed.
Copy and adapt
Prompt patterns
Real wording from the skill. Swap in your own subject, lens and timings, and keep one move per shot.
The phone screen stays a perfectly flat, evenly lit, uniform pure chroma-key green the
entire time: no content, no reflections, no glare, it never turns off.content on the phone screen, glare, screen turning blackScripts
Scripts that come with it
Plain Python with no API keys or accounts. Install the dependencies with pip install opencv-python numpy, and keep ffmpeg on your PATH.
track_screen.pyFinds the green screen per frame (greenness is G minus the larger of R and B), fits sub-pixel edge lines, writes the four corners to JSON and reports the fingertip position in screen coordinates. It matches corner order to the previous frame and drops and interpolates outlier frames.
Examplepython scripts/track_screen.py shot.mp4 corners.json --preview preview_dircomposite_screen.pyWarps the UI into the corner quad, keys fingers in front, turns leftover green at rounded corners into the bezel color, clamps green spill and keeps the source audio.
Examplepython scripts/composite_screen.py shot.mp4 corners.json ui.png out.mp4Examplepython scripts/composite_screen.py shot.mp4 corners.json ui_frames/ out.mp4
FAQ
Common questions
How do I put a phone screen into an AI video?
Generate the shot with the screen as flat chroma-key green, track the four corners per frame with sub-pixel accuracy, render your UI as images or frames and perspective-warp it into the tracked quad, keeping fingers in front with a matte. The two scripts in this skill do the tracking and the compositing.
Why does my composited screen lag or jitter?
Temporal smoothing is the usual cause: smoothing over 5 to 9 frames made the UI lag up to 27 px behind the phone in our tests. Use per-frame sub-pixel tracking without smoothing, and if you push in toward the phone in post, use a sub-pixel warp, not ffmpeg zoompan.
Which video model holds a green screen best?
In our tests Kling held a flat green screen for 5 seconds 5 times out of 5 with the prompt wording in this skill; most models drift without it. Kling's minimum is 720p, so budget for roughly 2.5 times the cost of 480p alternatives.
Keep going
Related skills
- Skill 10
3D previs for AI video
Gray-box 3D blockouts as camera-path references for Seedance, transformations, in-car cameras and contact-sheet checks.skills/3d-previs-to-ai-video - Skill 02
Camera angles for AI video prompts
14 tested camera moves with copy-paste wording, 3 to avoid, the snap zoom and hold, and a camera speed script.skills/ai-video-camera-language - Skill 05
Make AI video look like real footage
Device-based realism, words that push models toward CGI, real-photo references and natural color.skills/ai-video-realism
From the team behind the skills
Klakix runs Kling, which held a flat green screen best in our tests, alongside Seedance and Veo.