Skip to content
FramesField
ASSET 03 Developer / Local Tooling SKILL.md
VERIFIED 2026-11-26
Raw .md

FFmpeg Studio Conform & Loudness Skill

Where & How To Use This

Save this file as .agents/skills/ffmpeg-studio-conform/SKILL.md inside your project folder. Whenever you ask Claude Code, Cursor, or Codex to join or level video clips, it automatically follows this safe FFmpeg checklist.

Drop-in SKILL.md instruction file for Claude Code, Cursor, and Codex agents to inspect raw AI video renders via ffprobe, standardize mixed frame rates (16/24/30 fps), normalize audio strictly to EBU R128 (-14 LUFS / -1.0 dBTP), and concatenate delivery masters without A/V drift.

Works With Glossary
Claude Code Cursor Codex
Target tool: FFmpeg · License: MIT

1. Quick Install Command

Terminal Command
mkdir -p .agents/skills/ffmpeg-studio-conform
curl -fsSL https://framesfield.com/skills/ffmpeg-loudness-conform.md -o .agents/skills/ffmpeg-studio-conform/SKILL.md

2. Copyable SKILL.md File

COPY OR DOWNLOAD RAW FILE
FFmpeg Studio Conform & Loudness Skill SKILL.md
---
name: ffmpeg-studio-conform
description: Inspect, conform mixed AI video clips (Veo, Kling, Wan, Runway) to a unified frame rate and color space, normalize loudness to EBU R128 (-14 LUFS), and build deterministic delivery masters using local ffprobe and ffmpeg.
---

# FFmpeg Studio Conform Protocol

Follow these exact rules whenever the user asks to splice, conform, resize, or master video clips.

## 1. Always Probe First (Never Guess Stream Specs)
Before generating any ffmpeg command, run `ffprobe` on every input clip to verify width, height, frame rate, pixel format, and presence of an audio stream:
```bash
ffprobe -v error -show_entries stream=codec_type,codec_name,width,height,r_frame_rate,pix_fmt,sample_rate,channels -of json "<input>"
```

## 2. Handle Silent Clips Explicitly
AI video outputs from Runway Gen-4 Turbo or Wan 2.2 lack an audio stream. Never run `-f concat` mixing audio-bearing clips (Veo 3.1 / Kling 2.6) with silent clips; synthesize matching silent stereo PCM first:
```bash
ffmpeg -y -i silent_clip.mp4 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 \
  -shortest -c:v copy -c:a pcm_s16le silent_with_audio.mov
```

## 3. Intermediate Conform Standard
Transcode every heterogeneous clip to identical mezzanine properties before concatenation:
- Video: `1920x1080` (or `1080x1920` for 9:16), `fps=24`, `setsar=1`, `yuv420p`, `libx264 -crf 15`
- Audio: `pcm_s16le`, `48000 Hz`, `2 channels (stereo)`

## 4. Two-Pass Loudness Normalization (-14 LUFS)
Measure integrated loudness first, then apply linear normalization in pass 2:
```bash
ffmpeg -i concat_master.mov -af "loudnorm=I=-14:TP=-1.0:LRA=11:print_format=json" -f null -
```
Feed measured `input_i`, `input_tp`, `input_lra`, and `input_thresh` into pass 2 with `linear=true` and export with `-movflags +faststart`.

## 5. Verification Checklist
After export, run `ffprobe` on the final master and report exact duration, resolution, frame rate, codec, and measured LUFS to the user.

3. Example Input & Expected Output

Sample Prompt / Input
"Conform all 4 MP4 files in ./shots/ (two Veo 3.1 24fps dialogue clips and two silent Runway Gen-4 720p clips) into a single 1080p 24fps master at -14 LUFS with a 0.25s black fade-out."
Expected Output
1. Runs ffprobe across ./shots/*.mp4 and outputs a stream audit table (identifies 2 silent streams + 720p upscale needed).
2. Injects 48kHz stereo anullsrc tracks into the 2 silent Gen-4 clips and normalizes all 4 clips to 1920x1080 @ 24fps PCM mezzanine MOVs.
3. Runs pass-1 loudnorm analysis, prints measured LUFS/True Peak, and executes pass-2 linear loudnorm render to ./master_1080p_24fps.mp4.
4. Verifies output duration (24.00s), yuv420p, and -14.0 LUFS target.

What You Need & Known Limits

Requirements

  • FFmpeg 6.1+ and ffprobe available on system PATH (`brew install ffmpeg` on macOS)
  • Local filesystem read/write shell access in Claude Code, Cursor, or Codex
  • Sufficient scratch disk space for lossless PCM mezzanine clips (~120MB per minute)

Watch Out For

  • Does not perform optical-flow speed ramping automatically unless explicitly instructed to use minterpolate
  • HDR10 / HLG Rec.2020 inputs require an explicit zscale/tonemap LUT stage before Rec.709 delivery

Why agents fail at FFmpeg without a strict protocol

Left unguided, coding agents reach for single-pass -f concat -c copy commands that silently break whenever a silent Runway or Wan 2.2 render is spliced beside a dialogue-bearing Veo 3.1 clip. Enforcing a probe-first -> mezzanine conform -> two-pass R128 protocol guarantees deterministic, broadcast-safe exports on the first execution.

Frequently Asked Questions

02 Q&A
Q01 Where should I save this SKILL.md file for Claude Code or Codex?
Place it at `.agents/skills/ffmpeg-studio-conform/SKILL.md` (or `.claude/skills/ffmpeg-studio-conform/SKILL.md` for Claude Code project scope) so your coding agent loads the protocol automatically whenever video mastering tasks arise.
Q02 Why does the skill forbid stream-copying (`-c copy`) across mixed AI video models?
Different video models emit mismatched timebases, GOP lengths, SAR metadata, and missing audio tracks. Using `-c copy` creates frozen frames, desynced dialogue, or broken playback on Safari and mobile players.