---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://framesfield.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
title: "FFmpeg Frame Rate Conform and Upscale Skill"
description: "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."
canonical: "https://framesfield.com/skills/ffmpeg-optical-flow-fps-and-upscale-skill"
---

# FFmpeg Frame Rate Conform and Upscale Skill

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

- **Canonical URL:** https://framesfield.com/skills/ffmpeg-optical-flow-fps-and-upscale-skill
- **Raw Payload URL:** https://framesfield.com/raw/skills/ffmpeg-optical-flow-fps-and-upscale-skill
- **Asset Type:** SKILL.md
- **Compatible Hosts:** Claude Code, Cursor, Codex
- **Target Creative Tool:** FFmpeg
- **License:** MIT
- **Last Verified:** 2026-11-29
- **Source Reference:** https://ffmpeg.org/ffmpeg-filters.html#minterpolate

## Setup & Install

```bash
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

```

## Copyable Asset (SKILL.md)

````markdown
---
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
```
````

## Example Input

```text
"Convert our 16fps 1280x720 Wan 2.2 shot (renders/wan_shot03.mp4) to match our 24fps 1920x1080 Gemini Omni Flash timeline cleanly."
```

## Expected Output

```text
- 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`).
```

## 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)

## Known Limits

- 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

## Implementation Notes

## Essential bridge for local Wan 2.2 pipelines

Run this conform skill right after exporting 16 fps renders from [Skill 04: ComfyUI Wan 2.2 Dual-Expert I2V Graph](/skills/comfyui-character-turnaround) and [Workflow 05: Local Zero-API-Cost Image-to-Video Pipeline](/workflows/open-weight-local-video-render).
