Communitygithub.com

ai-video-editing-and-pacing

Edit AI-generated clips into a finished short video - shot length and pacing rules measured on real audiences, cutting to a music beat grid, why you never speed up generated footage, sub-pixel camera moves instead of ffmpeg zoompan, upscaling raw clips before grading, natural colour matching, loudness, and a script that measures shot lengths of any video. Use when assembling AI video clips with ffmpeg, Python/OpenCV, Remotion, Premiere or DaVinci Resolve, when an edit feels too fast or too slow, when analysing the pacing of a reference reel, or when upscaling and colour matching AI clips.

What is ai-video-editing-and-pacing?

ai-video-editing-and-pacing is a Claude Code agent skill that edit AI-generated clips into a finished short video - shot length and pacing rules measured on real audiences, cutting to a music beat grid, why you never speed up generated footage, sub-pixel camera moves instead of ffmpeg zoompan, upscaling raw clips before grading, natural colour matching, loudness, and a script that measures shot lengths of any video. Use when assembling AI video clips with ffmpeg, Python/OpenCV, Remotion, Premiere or DaVinci Resolve, when an edit feels too fast or too slow, when analysing the pacing of a reference reel, or when upscaling and colour matching AI clips.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/klakix-ai/ai-video-skills/tree/HEAD/skills/ai-video-editing-and-pacing

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Editing and pacing AI video

AI clips are generated in 4 to 10 second pieces and only 2 to 3 seconds of each are usually the best. The edit decides whether the video feels calm and expensive or frantic and cheap.

Pacing rules (measured)

  • Shots ≥ ~2.6 s (about one bar of music at 90 to 100 BPM). A first cut with a median shot of 1.29 s was "way too fast, everything flew by"; the recut at a median of 3.54 s (shortest 2.54 s) was approved.
  • Key gags get 4 to 5 s. Let the reveal land and breathe.
  • Total 30 to 40 s for story/comedy pieces on social. Viral references we measured ran 18 to 24 s with a new joke every 2.4 to 2.9 s; when copying them, keep their structure but not their speed if your audience prefers calm.
  • Glitch/flash transitions only at 3 to 4 key moments, on the beat. Everywhere else, straight cuts.
  • Exception: a fast edit can be tolerated when every cut sits exactly on a beat and each shot carries a single clear joke (one approved piece had a ~1.9 s median).

Use scripts/shot_stats.py to measure your cut and any reference video:

python scripts/shot_stats.py reference_reel.mp4
python scripts/shot_stats.py my_cut.mp4 --threshold 0.3 --list

Never speed up generated footage

Speeding clips up 1.5x to 1.7x to "add energy" produced the worst feedback of any change we made. Use the calmest part of each clip at normal speed (ai-video-camera-language has a script that finds it). Slow-motion ramps are fine.

Choosing the best seconds of a clip

  1. Make a frame strip every 0.5 s.
  2. Discard: logic errors, logo/badge frames, face drift, the model's own mid-clip cut.
  3. Prefer the window with the lowest camera speed that still contains the action beat.
  4. Cut on motion (a turn, a step, a hand) or on the beat; not mid-blink.

Beat grid

  • Detect BPM, then verify by fitting a grid; automatic tempo estimates are often off by a few BPM (one track detected 129 BPM was really 127).
  • Find bar starts: the phase of the 4-beat cycle with the strongest low-frequency energy.
  • Cut on bar starts or beats; join music sections at bar starts with ~12 ms crossfades.
  • Put the payoff on the drop; let the music stop for one key moment (silence is a cut too).
  • Use generated or licensed music. Commercial songs get muted or claimed on Instagram, TikTok and YouTube, and cannot be used in ads.

Camera moves added in post

Prefer asking the model for the move (see ai-video-camera-language). If you must add a push-in, punch zoom or shake-free reframing in post:

  • Do it with sub-pixel warps (OpenCV warpAffine with cubic interpolation) and eased curves. ffmpeg zoompan rounds position to whole pixels, so slow zooms shimmer.
  • Do it on the upscaled clip, not the 480p original.
  • Moves we used: slow push/pull, push toward a tracked point (a phone screen), a punch zoom on the beat (1.08 to 1.10 back to 1.0 over 9 frames), a 4-frame zoom-through with radial blur, a 2-frame colour split.

Upscale first, grade second

  1. Upscale raw clips (before grain, colour, overlays) to 1080p with a video upscaler (Topaz-class models). It sharpens texture, eyes, skin and metal far beyond a resize. A 5 s clip cost about $0.04 at 1080p in late 2026.
  2. Then colour-match, add grain and overlays at 1080p, so text and UI stay crisp.
  3. Upload limits: if your upscaler limits uploads per hour, concatenate same-size clips (with 4 black frames between them) into ≤ 30 s groups, upscale once, split back by frame number. Verify frame counts are preserved.
  4. Some upscalers return slightly different sizes (e.g. 1452x1080 for 4:3); crop to the delivery size in the edit.

Colour

  • Keep the model's natural colour. Match clips to each other at half strength.
  • Saturation 1.0, contrast ~1.03, soft highlight shoulder, very light grain and vignette.
  • No teal-orange, no lifted blacks, no diffusion/glow stacks: called "suffocating".
  • Always A/B against the raw frame before committing a look.

Audio finishing

  • Final -14 LUFS integrated, true peak ≤ -1 dBTP (see ai-video-dialogue-and-voice/scripts/loudness.py).
  • Low sub-bass hits (55 to 32 Hz) on drops and the final beat feel big on phones with headphones and cost nothing.
  • Keep the model's native ambience under music for realism.

Text, captions and brand

  • Captions: white, bold, 1 to 3 words at a time, one accent colour. Outline them over sky.
  • For organic social reach, things that make a video look like an ad (big branded intro, model/brand credit lines, a long black end card) correlated with lower reach in our small test (3 branded videos stayed in the first test pool while unbranded edits of similar footage went further). Keep branding to a small mark at the end, or none, and put credits in the caption.
  • For landscape (4:3/16:9) deliveries, reposition captions and end cards for that frame; do not reuse vertical layouts.

ffmpeg gotchas

  • xfade needs matching time bases: add settb=AVTB to both inputs.
  • When ffmpeg is launched from Python, pass -nostdin or it may hang waiting for input.
  • aecho's second parameter is output gain for the whole signal (0.25 = -12 dB), not just the echo.
  • RMS matching does not match perceived loudness; use LUFS.
  • Windows: write scripts with LF line endings if they will run on Linux.

Individual skills in this repo

This repo contains 6 individual skills — each has its own dedicated page.

3d-previs-to-ai-video

Control AI video camera paths and choreography with a 3D blockout (previs) - build a grey-box scene in Blender, three.js or any 3D tool, animate a camera, render a reference video and pass it with character/vehicle/location reference images to Seedance 2.x reference mode (@Video1 + @Image map). Covers blockout rules, one-move-per-shot camera paths, transformations planned inside the blockout, contact-sheet checks, in-vehicle cameras and realism wording. Use for FPV flights, car transformations, complex choreography, exact camera moves, "Seedance with previsualization in Blender", or when text prompts cannot get the camera move right.

ai-video-camera-language

Camera angles, lenses and camera movement for AI video generation (Seedance, Kling, Veo, Sora, MiniMax/Hailuo, Runway, Wan, Luma). A tested library of shot types with copy-paste prompt wording, rules for camera speed, the snap-zoom-and-hold move, what to avoid (whip pans, shake, speed ramps on generated footage), and a script that measures camera speed with optical flow so you can pick the calmest part of a clip. Use when writing camera directions in a video prompt, choosing shot types for a storyboard, when a generated clip feels too fast, shaky or lifeless, or when someone asks about camera angles, camera moves or cinematography for AI video.

ai-video-prompting

Write prompts for AI video models that follow instructions precisely - Seedance 2.0 / 2.5 (text, image, multi-reference with @Image/@Video/@Audio, edit, extend), Kling, Veo, MiniMax/Hailuo, Runway, Wan and Sora. Covers prompt structure, second-by-second timelines, reference maps, negative wording, length limits, when to turn off prompt enhancers, and model-specific quirks we measured. Use when writing or fixing a text-to-video or image-to-video prompt, a Seedance reference prompt, when a model ignores parts of the prompt, or when someone asks how to prompt Seedance, Kling or Veo.

ai-video-realism

Make AI images and AI video look like real footage instead of glossy "AI slop". Device-based realism (describe the phone, GoPro, broadcast camera that shot it and its flaws), what words push models toward CGI, real-photo references for locations and vehicles, key frames with photographic image models, natural colour instead of heavy film looks, and absurd-but-real comedy. Use when output looks fake, plastic, too perfect, too cinematic or like a video game, when someone asks for "hyper-realistic", "photorealistic", "looks like a real video", or when planning key frames for an AI video.

ai-video-shot-planning

Plan a multi-shot AI video (Seedance, Kling, Veo, MiniMax/Hailuo, Runway, Wan) before spending money on generation. Turns an idea into a shot list with per-shot action beats, camera move, scene logic, costume and reference images, key frames, a cheap test plan and a cost estimate. Use when someone asks to make an AI short film, reel, ad, music video, story or "viral video" with more than one shot, asks for a storyboard or shot list, or is about to generate several clips in a row.

viral-ai-video-formats

Proven short-form formats for AI video on Instagram Reels, TikTok and YouTube Shorts, broken down from frame-by-frame analysis of viral AI reels - "history + one modern object", delayed reveal ("is this real?"), macro proof, POV-from-a-bystander-phone, spoken comment-to-DM call to action - with measured hook timing, shot length, duration, aspect ratio, music and AI-label rules. Use when planning an AI reel or short meant for reach, picking a concept, writing hooks and CTAs, or diagnosing why an AI video did not reach Explore / For You.

Related Skills