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.

Claude Code (all ten skills)
/plugin marketplace add klakix-ai/ai-video-skills
/plugin install ai-video-skills@klakix-ai-video
Any agent that reads Agent Skills (all ten)
npx skills add klakix-ai/ai-video-skills
This skill only (manual copy)
git 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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. Drive scrolling from the tracked fingertip so the UI follows the thumb.

  8. 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.

  9. For upscaled clips, track on the raw clip, scale the corners by separate x and y factors and verify frame alignment after the upscaler.

  10. 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.

Holding the screen green
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.
Negative prompt, if the model supports one
content on the phone screen, glare, screen turning black

Scripts

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.py

    Finds 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.

    Example
    python scripts/track_screen.py shot.mp4 corners.json --preview preview_dir
  • composite_screen.py

    Warps 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.

    Example
    python scripts/composite_screen.py shot.mp4 corners.json ui.png out.mp4
    Example
    python 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

Back to all ten AI video skills or star the repo on GitHub.

From the team behind the skills

Klakix runs Kling, which held a flat green screen best in our tests, alongside Seedance and Veo.