---
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 Beat-Sync Montage & Concat Skill"
description: "Executable SKILL.md playbook teaching Claude Code, Cursor, and Codex how to trim AI video clips past slow opening settle frames (-ss 0.40), snap every shot to exact musical BPM bar durations at constant 24fps CFR, unify mixed models with subtle 35mm temporal film grain, and mux stereo soundtracks at -14 LUFS with yuv420p +faststart."
canonical: "https://framesfield.com/skills/ffmpeg-beat-sync-montage-and-concat-skill"
---

# FFmpeg Beat-Sync Montage & Concat Skill

> Executable SKILL.md playbook teaching Claude Code, Cursor, and Codex how to trim AI video clips past slow opening settle frames (-ss 0.40), snap every shot to exact musical BPM bar durations at constant 24fps CFR, unify mixed models with subtle 35mm temporal film grain, and mux stereo soundtracks at -14 LUFS with yuv420p +faststart.

- **Canonical URL:** https://framesfield.com/skills/ffmpeg-beat-sync-montage-and-concat-skill
- **Raw Payload URL:** https://framesfield.com/raw/skills/ffmpeg-beat-sync-montage-and-concat-skill
- **Asset Type:** SKILL.md
- **Compatible Hosts:** Claude Code, Cursor, Codex
- **Target Creative Tool:** FFmpeg CLI / Suno v6 / Kling 4.0 / Runway Gen-4
- **License:** MIT
- **Last Verified:** 2026-11-29

## Setup & Install

```bash
mkdir -p .claude/skills/ffmpeg-beat-sync-montage && curl -fsSL https://framesfield.com/raw/skills/ffmpeg-beat-sync-montage-and-concat-skill -o .claude/skills/ffmpeg-beat-sync-montage/SKILL.md

```

## Copyable Asset (SKILL.md)

````markdown
---
name: ffmpeg-beat-sync-montage
description: Trim AI video clips past slow 0.40s I2V ease-in frames, snap cuts to exact musical BPM bar durations at constant 24fps CFR, unify mixed models with subtle 35mm temporal film grain, and mux stereo soundtracks at -14 LUFS with Safari-safe yuv420p +faststart. Use when assembling beat-synced trailers, music videos, or fast AI montages with FFmpeg.
---

# FFmpeg Beat-Sync Montage & Concat Playbook

## 1. BPM-to-Seconds Cut Math
Calculate exact cut lengths before trimming any clip:
- `beat_sec = 60 / BPM` (Example at `120 BPM`: `1 beat = 0.50s`, `2 beats = 1.00s`, `4 beats / 1 bar = 2.00s`, `8 beats = 4.00s`)
- Always skip the first `0.35s–0.50s` (`-ss 0.40`) on Image-to-Video clips so every cut enters *in motion* rather than easing out of a frozen frame.

## 2. Normalize Every Cut to Identical CFR, Geometry & SAR (Prevents Concat Glitches)
Never run `-c copy` concat on mixed-model AI clips (`Kling`, `Runway`, `Gemini Omni Flash`, `Wan`) because mismatched SAR, frame rate, or timebases cause frozen frames or audio drift. Re-encode normalized intermediate cuts at near-lossless `-crf 15`:

```bash
ffmpeg -y -ss "$START_OFFSET" -i "$SRC_CLIP" -t "$BEAT_DURATION" \
  -vf "scale=1920:1080:force_original_aspect_ratio=increase,crop=1920:1080,fps=24,setsar=1" \
  -c:v libx264 -crf 15 -pix_fmt yuv420p -an "$CUT_OUT"
```
*(For 9:16 vertical Reels/TikTok, swap `1920:1080` cleanly to `1080:1920`.)*

## 3. Join Beat-Locked Cuts + Shared 35mm Temporal Grain + -14 LUFS Audio Master
Build `concat.txt` with absolute paths (`file '/abs/path/cut_01.mp4'`), then render one unified delivery master:

```bash
ffmpeg -y -f concat -safe 0 -i concat.txt -i soundtrack_48k.wav \
  -vf "noise=alls=6:allf=t+u" \
  -af "aresample=48000,loudnorm=I=-14:TP=-1.0:LRA=11" \
  -c:v libx264 -crf 18 -pix_fmt yuv420p -movflags +faststart \
  -c:a aac -b:a 192k -ar 48000 -shortest \
  beat_synced_master.mp4
```

## 4. Mandatory ffprobe Verification Gate
Always verify pixel format, constant frame rate, audio clock, and exact runtime before reporting done:

```bash
ffprobe -v error -show_entries format=duration \
  -show_entries stream=codec_name,pix_fmt,r_frame_rate,sample_rate \
  -of compact=p=0 beat_synced_master.mp4
```
Expected checks: `codec_name=h264`, `pix_fmt=yuv420p`, `r_frame_rate=24/1`, `codec_name=aac`, `sample_rate=48000`.
````

## Example Input

```text
Assemble clips s01.mp4..s06.mp4 synced to our 120 BPM Suno v6 WAV (4s opener, three 2s build shots, two 1s climax hits) in 16:9 1080p with 35mm film grain and -14 LUFS loudness.
```

## Expected Output

```text
Normalized 6 cuts at 1920x1080 24fps CFR starting at +0.40s offset, joined with noise=alls=6:allf=t+u temporal grain, muxed 48 kHz soundtrack at -14 LUFS.
ffprobe verify: h264 | yuv420p | 24/1 fps | aac | 48000 Hz | duration=12.00s.
```

## Requirements

- Local FFmpeg 6+ installed (`ffmpeg -version`)
- Commercial-cleared stereo soundtrack (e.g., Suno v6 Pro/Premier WAV)

## Known Limits

- Always conform mixed-model source clips to shared fps/resolution/SAR before running concat—never use raw `-c copy` across different AI models
- Keep grain subtle (`alls=5` to `alls=7`); heavier values bloat H.264 bitrate unnecessarily

## Implementation Notes

## What this skill automates inside your coding agent

**Cutting mixed-model AI clips to music manually in an NLE takes 45 minutes of repetitive trimming—and naive FFmpeg `-c copy` scripts snap off-beat by up to two seconds.** Installing this progressive `SKILL.md` gives Claude Code, Cursor, and Codex an exact, live-verified beat-slicing, SAR-normalizing, 35mm grain-unifying, and `-14 LUFS` mastering pipeline ready to run on any folder of raw clips.

Pair it directly with [Workflow 26: Beat-Synced Music Video & Trailer Pipeline](/workflows/beat-synced-music-video-and-trailer-pipeline) and [Suno v6 Specs](/specs/suno-v6).
