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