Skip to content

Instantly share code, notes, and snippets.

@nad2000
Created October 17, 2015 09:25
Show Gist options
  • Save nad2000/057bbdcb884c47bc7502 to your computer and use it in GitHub Desktop.
Save nad2000/057bbdcb884c47bc7502 to your computer and use it in GitHub Desktop.
Extraction of frames from a video using ffmpeg.exe
ffmpeg -i video_file.ts destination_directory/img_%05d.jpeg
# Getting framerate:
ffprobe data/Movies/Cosmos/Cosmos.A.Space.Time.Odyssey.S01E06.HDTV.x264-LOL.mp4
# Keyframes:
ffmpeg -skip_frame nokey -i data/Movies/Cosmos/Cosmos.A.Space.Time.Odyssey.S01E06.HDTV.x264-LOL.mp4 -filter:v select='eq(pict_type\,I)' -vsync 0 frames/%09d.png
# Keyframes with scaling:
ffmpeg -skip_frame nokey -i data/Movies/Cosmos/Cosmos.A.Space.Time.Odyssey.S01E06.HDTV.x264-LOL.mp4 -filter:v select='eq(pict_type\,I)',scale='128:72' -an -vsync 0 frames/%09d.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment