Loading...
Loading...
This skill should be used when the user asks to "convert this video", "change format to mp4", "trim from X to Y", "cut the first X seconds", "speed up this video", "slow motion", "timelapse", "resize video", "scale down", "rotate video", "flip video", "remux", or any general FFmpeg video manipulation not covered by compress-video, make-gif, share-social, extract-audio, or extract-frames.
npx skill4agent add gupsammy/claudest convert-video-c copyffprobe -v quiet -show_streams "$INPUT" | grep codec_name# Remux: same codec, different container (e.g., H.264 MKV → MP4) — instant, lossless:
ffmpeg -i input.mkv -c copy output.mp4
# Re-encode: different codec required:
ffmpeg -i input.avi -c:v libx264 -crf 23 -c:a aac -b:a 128k output.mp4# Fast trim without re-encoding (-ss before -i = container-level seek):
ffmpeg -ss 00:01:30 -to 00:03:45 -i "$INPUT" -c copy "$OUTPUT"
# Re-encoding trim (use when -c copy causes A/V sync issues near keyframes):
ffmpeg -ss 00:01:30 -to 00:03:45 -i "$INPUT" -c:v libx264 -crf 23 -c:a copy "$OUTPUT"-c copy# 2x speed:
ffmpeg -i "$INPUT" -filter:v "setpts=0.5*PTS" -filter:a "atempo=2.0" "$OUTPUT"
# 0.5x slow-motion:
ffmpeg -i "$INPUT" -filter:v "setpts=2.0*PTS" -filter:a "atempo=0.5" "$OUTPUT"setpts1 / speed_multiplieratempoatempo=2.0,atempo=2.0-filter:affprobe -v quiet -show_streams "$INPUT" | grep -E "width|height"# Scale to width, auto height (-2 ensures H.264-compatible even height):
ffmpeg -i "$INPUT" -vf "scale=1280:-2" -c:a copy "$OUTPUT"
# Fit within bounding box without upscaling:
ffmpeg -i "$INPUT" \
-vf "scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,pad=ceil(iw/2)*2:ceil(ih/2)*2" \
-c:a copy "$OUTPUT"# 90° clockwise: ffmpeg -i "$INPUT" -vf "transpose=1" "$OUTPUT"
# 90° counter-clockwise: ffmpeg -i "$INPUT" -vf "transpose=2" "$OUTPUT"
# 180°: ffmpeg -i "$INPUT" -vf "transpose=1,transpose=1" "$OUTPUT"
# Horizontal flip: ffmpeg -i "$INPUT" -vf "hflip" "$OUTPUT"
# Vertical flip: ffmpeg -i "$INPUT" -vf "vflip" "$OUTPUT"# Single frame at timestamp:
ffmpeg -ss 00:00:10 -i "$INPUT" -frames:v 1 -q:v 2 output.jpg
# One frame every N seconds:
ffmpeg -i "$INPUT" -vf "fps=1/$N" -q:v 2 frames/frame_%04d.jpg-q:v 2-q:v 1force_original_aspect_ratio=decrease-vf-filter:v-filter:a-c:a copyrotate-vf "transpose=..."-c copy