Skip to content
FramesField
SKILL.md Developer / Local Tooling SKILL.md
Verified Nov 29, 2026

FFmpeg Frame Rate Conform and Upscale Skill

How to install this SKILL.md

Install into .claude/skills/, .cursor/skills/, or .agents/skills/ below whenever you need to match 16 fps local Wan 2.2 renders or 720p clips onto a uniform 1080p 24 fps commercial timeline.

Installable SKILL.md teaching Claude Code, Cursor, and Codex how to convert 16 fps local Wan 2.2 renders or 30 fps clips cleanly to 24 fps cinema cadence (minterpolate optical flow vs clean cadence conform) and upscale 720p footage to crisp 1080p (lanczos + restrained unsharp) without ghosting.

Compatible agent hosts
Claude Code Cursor Codex
Target tool: FFmpeg · License: MIT
  1. STEP 01
    Install the FPS & upscale SKILL.md

    Pick Claude Code, Cursor, or Codex below to download the clean raw SKILL.md file.

  2. STEP 02
    Probe source FPS & resolution first

    Your agent checks whether the clip is 16 fps Wan 2.2, 24 fps cloud, or 30 fps and chooses optical flow vs clean cadence.

  3. STEP 03
    Conform smoothly to 1080p 24 fps

    Outputs uniform 1920×1080 (or 1080×1920), 24/1 CFR, yuv420p masters ready for broadcast editing.

1. Install for your tool

Pick the app you use below for the exact verified command or config—zero manual guessing.

Direct raw file (SKILL.md) ↓
Claude Code (.claude/skills/) bash
Installs directly into .claude/skills/ffmpeg-fps-upscale/SKILL.md.
mkdir -p .claude/skills/ffmpeg-fps-upscale
curl -fsSL https://framesfield.com/raw/skills/ffmpeg-optical-flow-fps-and-upscale-skill -o .claude/skills/ffmpeg-fps-upscale/SKILL.md

2. Inspect or download the full SKILL.md file

This is the exact raw file served at /raw/skills/ffmpeg-optical-flow-fps-and-upscale-skill.

FFmpeg Frame Rate Conform and Upscale Skill SKILL.md
---
name: ffmpeg-fps-upscale
description: Convert 16 fps local open-weight clips (Wan 2.2) or mixed 30 fps renders cleanly to 24 fps using motion-compensated optical flow (minterpolate) or clean cadence conform, and upscale 720p footage cleanly to 1080p via lanczos and restrained unsharp masking.
---

# FFmpeg Frame Rate Conform & 720p-to-1080p Upscale Protocol

Use this workflow whenever conforming local 16 fps Alibaba Wan 2.2 clips or 720p-class hosted renders (Runway Gen-4 Turbo, Runway Gen-4.5) onto a 1080p 24 fps commercial master:

## 1. Choose the Right Frame-Rate Conversion Mode
- **16 fps -> 24 fps (Wan 2.2 smooth slow/medium camera moves):** Use motion-compensated optical flow (`minterpolate=mi_mode=mci`) so every 3rd frame is smoothly synthesized instead of duplicated (which causes visible 3:2 judder):
  ```bash
  ffmpeg -y -i wan22_16fps_720p.mp4 \
    -vf "minterpolate=fps=24:mi_mode=mci:mc_mode=aobmc:me_mode=bidir:vsbmc=1,scale=1920:1080:flags=lanczos,unsharp=3:3:0.35:3:3:0.0,setsar=1" \
    -c:v libx264 -preset slow -crf 18 -pix_fmt yuv420p \
    -an -movflags +faststart \
    wan22_24fps_1080p.mp4
  ```
- **Fast erratic motion or hard scene cuts:** `minterpolate` can produce warping halos across hard cuts or spinning objects. Only run `minterpolate` on **individual single-shot clips**, NEVER across an already-edited multi-cut sequence.
- **30 fps -> 24 fps clean conform (when audio sync must stay intact):** Use standard frame drop (`fps=24`) rather than blending (`mi_mode=blend`, which creates double-exposure ghosting).

## 2. Clean 720p -> 1080p Scaling Restraint
- Always use `flags=lanczos` (`scale=1920:1080:flags=lanczos` or `1080:1920` for vertical) + `setsar=1`.
- Keep `unsharp` luma amount conservative (`0.25` to `0.40`, chroma `0.0`) so edges tighten subtly without introducing white ringing halos around dark clothing or typography.

## 3. Verify Exact Output Cadence
Confirm constant frame rate and exact target dimensions before passing to concatenation:
```bash
ffprobe -v error -show_entries stream=width,height,r_frame_rate,avg_frame_rate,pix_fmt -of default=noprint_wrappers=1 wan22_24fps_1080p.mp4
```

3. Test it right away (sample prompt & result)

Sample prompt / input
"Convert our 16fps 1280x720 Wan 2.2 shot (renders/wan_shot03.mp4) to match our 24fps 1920x1080 Gemini Omni Flash timeline cleanly."
What happens when it runs
- Runs verified `minterpolate=fps=24:mi_mode=mci:mc_mode=aobmc:me_mode=bidir:vsbmc=1` + `scale=1920:1080:flags=lanczos` + restrained `unsharp=3:3:0.35:3:3:0.0`.
- Outputs `renders/wan_shot03_24fps_1080p.mp4` verified via `ffprobe` (`1920x1080`, `24/1` CFR, `yuv420p`).

What you need & known limits

Requirements

  • FFmpeg installed locally (tested live on FFmpeg 9.0.1 Homebrew and standard Linux/Windows builds)
  • Single-shot source clips (run before editing cuts together)

Watch out for

  • CPU minterpolate is compute-heavy (~5–15 seconds per 5-second clip on modern laptops); for bulk 60fps conversion consider GPU RIFE interpolation
  • Never run optical-flow interpolation across a multi-cut timeline or it will hallucinate melted morph frames across cut boundaries

Frequently Asked Questions

Why shouldn't I use simple -r 24 on a 16 fps Wan 2.2 clip?
Simple -r 24 repeats every second frame to pad 16 fps up to 24 fps, creating choppy staccato motion during smooth camera dollies. Motion-compensated minterpolate synthesizes smooth intermediate motion frames.
Why keep chroma sharpening at 0.0 in unsharp=3:3:0.35:3:3:0.0?
Sharpening chroma channels amplifies color noise and compression ringing along red/blue edges. Restricting subtle 0.35 sharpening strictly to the luma channel tightens detail cleanly without color artifacts.
Use this page in AI tools or notes
raw .md