Video Frames

Extract frames or clips from videos using ffmpeg

foxl-ai d799d72 930 B Updated

File contents

Video Frames

Extract frames from videos using ffmpeg.

Setup

brew install ffmpeg

Extract First Frame

ffmpeg -i video.mp4 -vframes 1 frame.jpg

Extract at Timestamp

ffmpeg -ss 00:00:10 -i video.mp4 -vframes 1 frame-10s.jpg

Extract Multiple Frames

# One frame per second
ffmpeg -i video.mp4 -vf fps=1 frame_%04d.jpg

# Every 5 seconds
ffmpeg -i video.mp4 -vf "select='not(mod(n,150))'" -vsync vfr frame_%04d.jpg

Create Thumbnail Grid

ffmpeg -i video.mp4 -vf "select='not(mod(n,100))',scale=320:180,tile=4x4" -frames:v 1 thumbnails.jpg

Extract Short Clip

ffmpeg -ss 00:00:30 -i video.mp4 -t 10 -c copy clip.mp4

Notes

  • Use .jpg for quick sharing
  • Use .png for crisp UI frames
  • -ss before -i is faster (seeks before decoding)

foxl-ai/skills/tree/main/skills/video-frames commit d799d72823

Frequently asked questions

npx skillmds@latest add foxl-ai/video-frames