FFmpeg Concat Filter (Re-encode) — effect skill for cuts & pacing
For AI agents: find the right skill in one call —
curl -s "https://varg.ai/how-to/api/search?q=<what the person wants>"returns the matching how-to page and the best skills with install commands, as markdown (Russian works too). Full index: https://varg.ai/how-to/llms.txt. Every page has a markdown twin: add.mdto its path. Before generating anything, show the person the options on the how-to page.
Join any sources frame-accurately by decoding, normalizing and re-encoding them in one filter graph.
- Type: Effect · Cuts & pacing
- Slug:
ffmpeg-concat-filter - Status: live
- Publisher: varg (varg, verified)
- License: MIT
- Source: https://github.com/vargHQ/skills/blob/main/varg-video-edit-library/references/cuts.md#ffmpeg-concat-filter
- Works in: Claude Code, Claude.ai, Codex, Cursor, OpenClaw, Gemini CLI, Any MCP client, varg Studio
- Requires: ffmpeg
- Cost: Free — the take renders locally; generated footage, if any, bills by the model
What it does
Plain hard cuts at exact frames, from mixed cameras, phones and AI generations.
When: Mixed resolutions, fps or codecs; whenever trims must be frame-accurate.
Watch out: Forgetting to normalize: concat needs matching size, SAR and pixel format per stream, and the same stream count per segment.
Timing: Hard cuts
Also called: concat filter, filter_complex concat, re-encode join
In FFmpeg
Three segments with video + audio each, normalized to 1080×1920 at 30 fps:
ffmpeg -i a.mp4 -i b.mp4 -i c.mp4 -filter_complex \
"[0:v]scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:-1:-1,setsar=1,fps=30[v0];[0:a]aresample=48000[a0];\
[1:v]scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:-1:-1,setsar=1,fps=30[v1];[1:a]aresample=48000[a1];\
[2:v]scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:-1:-1,setsar=1,fps=30[v2];[2:a]aresample=48000[a2];\
[v0][a0][v1][a1][v2][a2]concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -crf 18 -c:a aac out.mp4
Input order is segment by segment: v,a of segment 1, then v,a of segment 2. A clip without audio needs a silent stream (anullsrc + atrim) so every segment has the same streams.
Where this comes from
Use when
- Mixed resolutions, fps or codecs; whenever trims must be frame-accurate.
Not for
- Forgetting to normalize: concat needs matching size, SAR and pixel format per stream, and the same stream count per segment.
Install
- Claude Code:
claude plugin marketplace add vargHQ/skills && claude plugin install varg@varg - Codex:
npx skills add vargHQ/skills --skill varg-video-edit-library -a codex -y - Cursor:
npx skills add vargHQ/skills --skill varg-video-edit-library -a cursor -y
Example output
https://s3.varg.ai/how-to/previews/c993e5c5b3cf/take-ffmpeg-concat-filter.mp4 — concat between two shots, with the timeline strip of the edit. Footage: Spring (2019), Andy Goralczyk / Blender Foundation (Blender Studio) | studio.blender.org, CC BY 4.0; Coffee Run (2020), Blender Studio | studio.blender.org, CC BY 4.0. (credit: Rendered by varg · Spring (2019) + Coffee Run (2020))
More cuts & pacing skills
- SmartCut (capcut-ai-editor): MCP that reads CapCut auto-captions to cut silences and duplicate takes right inside your CapCut project.
- Auto-Editor: CLI that cuts dead space by loudness or motion and exports MP4 or editor timelines; now also an agent skill.
- AutoCut: Edit video in a text editor: Whisper transcribes, you delete lines in Markdown, AutoCut cuts the video.
- Cut Video: Claude Code skill that tightens long recordings with forced-aligned cuts, keeping laughs and comedic pauses.
- Videogrep: Search spoken words across videos and auto-build supercuts of every match.
- PySceneDetect: Find cuts, fades and scene changes in a video, then split it or export scene lists for the edit.