Skip to content

Latest commit

 

History

History
221 lines (170 loc) · 7.31 KB

File metadata and controls

221 lines (170 loc) · 7.31 KB
name video
description FFmpeg-powered video editing — color grading, montage, transitions, text overlays, social media export

Video Skill — FFmpeg Video Editing CLI

You are a video editor. You use FFmpeg via ~/dev/_claude/video-cli/video_cli.py to edit, grade, and export videos.

Project location

~/dev/_claude/video-cli/

Quick reference

V=~/dev/_claude/video-cli/video_cli.py

# Show all presets, formats, transitions
python3 $V presets

# Video info
python3 $V info video.mp4

# Color grading
python3 $V grade -i video.mp4 -p cinematic-warm
python3 $V grade -i video.mp4 -p cinematic-teal-orange

# Concatenate with transition
python3 $V concat intro.mp4 main.mp4 outro.mp4 -t fadeblack -d 0.5

# Add text overlay
python3 $V text -i video.mp4 --text "NIOX" --position center --size 80 --start 0.5 --end 4

# Resize for social media
python3 $V resize -i video.mp4 -f tiktok
python3 $V resize -i video.mp4 -f instagram

# Trim
python3 $V trim -i video.mp4 -s 00:00:05 -e 00:00:30

# Stabilize (2-pass)
python3 $V stabilize -i shaky.mp4

# Full montage pipeline
python3 $V montage --intro intro.mp4 --clips speech.MOV broll.mp4 --outro outro.mp4 \
  -g cinematic-warm -t fadeblack -f tiktok --title "NIOX" --subtitle "Accompagnement IA"

Color grading presets

Preset Style
cinematic-warm Film look chaud, tons dorés, contrastes doux
cinematic-cold Tons bleutés, contrastes forts
cinematic-teal-orange Blockbuster teal & orange
vintage-film Pellicule vintage, grain, noirs relevés
moody-dark Sombre, désaturé, ambiance thriller
bright-clean Lumineux, net, couleurs vives — YouTube/TikTok
sunset-golden Golden hour, tons orangés
bw-contrast Noir et blanc contrasté, dramatique
pastel-soft Tons pastels doux, style editorial
none Aucun grading

Social media formats

Format Dimensions Usage
tiktok 1080x1920 (9:16) TikTok, Reels, Story
instagram 1080x1080 (1:1) Instagram Post
insta-port 1080x1350 (4:5) Instagram Portrait
youtube 1920x1080 (16:9) YouTube
linkedin 1920x1080 (16:9) LinkedIn Video
twitter 1280x720 (16:9) Twitter/X
whatsapp 1080x1920 (9:16) WhatsApp Status

Transitions (xfade)

fade, fadeblack, fadewhite, dissolve, wipeleft, wiperight, slideleft, slideright, circlecrop, circleclose, circleopen, radial, pixelize, diagtl, diagtr, smoothleft, smoothright, smoothup, smoothdown

Workflow: full content production

1. Record speech (face camera)

User records on phone/webcam.

2. Generate intro/outro

Use AI tools (Kling, Runway Gen-4, Vidu) with prompts:

Intro: Dark navy workspace, golden light sweep, cinematic 4K, 5-8 sec
Outro: Dark background, golden bokeh particles, glass surface, 5-8 sec

3. Montage pipeline

python3 $V montage \
  --intro ~/Videos/intro.mp4 \
  --clips ~/Videos/speech.MOV ~/Videos/broll.mp4 \
  --outro ~/Videos/outro.mp4 \
  -g cinematic-warm \
  -t fadeblack \
  -f tiktok \
  --title "NIOX" \
  --subtitle "Accompagnement IA"

4. Export for multiple platforms

# Same video, multiple formats
python3 $V resize -i output/montage-final.mp4 -f tiktok -o output/for-tiktok.mp4
python3 $V resize -i output/montage-final.mp4 -f instagram -o output/for-instagram.mp4
python3 $V resize -i output/montage-final.mp4 -f youtube -o output/for-youtube.mp4

5. Upload to TikTok (via tiktok-manager)

python3 ~/dev/_claude/tiktok-manager/tiktok_manager.py upload \
  -v output/for-tiktok.mp4 \
  -d "Description #hashtags" \
  -s "+2h"

Highlights — Smart scene extraction

Extract the most impactful scenes from a video, scored by domain relevance.

Usage

# Immobilier — extract best property showcase scenes
python3 $V highlights -i property-tour.mp4 -d immobilier --top 5

# Highlights first, then full video
python3 $V highlights -i tour.mp4 -d immobilier --top 8 --mode highlights+full

# Business content
python3 $V highlights -i meeting.mp4 -d business --top 3

# Signal-only (no transcription, faster)
python3 $V highlights -i video.mp4 -d general --no-ai

# More scenes (lower threshold)
python3 $V highlights -i video.mp4 -d immobilier --threshold 20

Domains

Domain Focus
immobilier Pièces lumineuses, finitions, extérieurs, vues, éléments vendeurs
business Key moments, demos, résultats, call-to-action
food Close-ups, préparation, plating, plat final
sport Action, buts, célébrations
general Impact visuel, dynamisme, variété

Pipeline

  1. PySceneDetect → détecte les coupures de scènes
  2. FFmpeg → extrait chaque scène en clip
  3. Scoring signal → audio RMS, activité mouvement, durée idéale
  4. Scoring IA (optionnel) → Whisper transcription + mots-clés domaine + LLM scoring via Groq
  5. Ranking → combine les scores, sélectionne top N
  6. Concat → assemble le highlight reel

Modes de sortie

  • highlights — uniquement les meilleures scènes
  • highlights+full — highlights en intro, puis la vidéo complète

Output

  • *-highlights.mp4 — la vidéo highlight
  • *-highlights-analysis.json — scores détaillés de chaque scène

AI Music Generation (ElevenLabs)

Generate background music via ElevenLabs AI sound generation.

# Presets
python3 $V music -s jazz -d 55              # Jazz lounge
python3 $V music -s classical -d 55          # Classical strings
python3 $V music -s ambient -d 55            # Ambient pad
python3 $V music -s upbeat -d 55             # Upbeat corporate
python3 $V music -s cinematic -d 55          # Film score
python3 $V music -s lofi -d 55               # Lo-fi chill

# Custom prompt
python3 $V music -p "african percussion with kora and soft drums" -d 30

Requires ELEVENLABS_API_KEY env var. Free tier includes sound generation credits. Max 30s per generation — auto-splits and concatenates for longer durations.

Music + video mixing with ducking

After generating music, mix it with the video using sidechain compression:

ffmpeg -i video.mp4 -i music.m4a \
  -filter_complex "[0:a]asplit=2[v][vsc];[1:a]volume=0.35[m];[m][vsc]sidechaincompress=threshold=0.015:ratio=6:attack=200:release=1200:level_sc=1[md];[v][md]amix=inputs=2:duration=first[out]" \
  -map 0:v -map "[out]" -c:v copy -c:a aac output.mp4

Encoding for compatibility

IMPORTANT: Always use these settings for final output to ensure QuickTime/WhatsApp/iPhone compatibility:

ffmpeg -i input.mp4 \
  -c:v libx264 -profile:v baseline -level 3.1 -pix_fmt yuv420p \
  -movflags +faststart \
  -c:a aac -ar 44100 -ac 2 -b:a 192k \
  output.mp4

Advanced: custom FFmpeg filters

For anything not covered by presets, you can run raw ffmpeg:

ffmpeg -i input.mp4 -vf "CUSTOM_FILTER_CHAIN" -c:a copy output.mp4

Useful filters: curves, lut3d, colorbalance, colortemperature, vibrance, eq, noise, zoompan (Ken Burns), drawtext, overlay, blend, vignette (via overlay), vidstabdetect/vidstabtransform.

Integration with other skills

  • canva-cli (~/dev/_claude/canva-cli/) — design thumbnails, lower thirds, title cards
  • tiktok-manager (~/dev/_claude/tiktok-manager/) — upload and schedule to TikTok
  • transcribe (/transcribe) — transcribe audio for subtitles