short-form-ffmpeg-cookbook

Installation
SKILL.md

Short-form FFmpeg cookbook: copyable commands for Reels

Input: a video (any size), optionally an SRT file and a music track. Output: a 1080×1920 9:16 MP4 ready for Reels, TikTok and Shorts. Probe first, run one recipe at a time, check the result with ffprobe and a frame grab before the next step.

ffprobe -v error -show_entries stream=codec_type,codec_name,width,height,r_frame_rate -show_entries format=duration -of compact=p=0 input.mp4

1. Crop to 9:16 vertical

# center crop, full height
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih,scale=1080:1920,setsar=1" -c:v libx264 -crf 20 -c:a copy vertical.mp4
# subject off-center: add the x offset in px
ffmpeg -i input.mp4 -vf "crop=ih*9/16:ih:200:0,scale=1080:1920,setsar=1" -c:v libx264 -crf 20 -c:a copy vertical.mp4
# keep the whole frame over a blurred copy
ffmpeg -i input.mp4 -filter_complex "[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,boxblur=20:2[bg];[0:v]scale=1080:-2[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2,setsar=1" -c:v libx264 -crf 20 -c:a copy vertical-blur.mp4
Installs
1
Repository
varghq/skills
GitHub Stars
21
First Seen
4 days ago