fabienbaradel / Frames_Extractor

A short python script to extract frames from video using ffmpeg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extract frames from video in Python

Given a directory of mp4 files, extract the frames

Input dir:

avi ----> 1 ---> clip.mp4
     |
      --> 2 ---> clip.mp4
     |
     ...
     |
     ---> n ---> clip.mp4

Output dir:

avi ----> 1 ---> clip.mp4
     |       |
     |       --> frames ---> 01.png ... 0N.png
     |
      --> 2 ---> clip.mp4
     |       |
     |       --> frames ---> 01.png ... 0N.png
     |
     ...
     |
     ---> n ---> clip.mp4
             |
             --> frames ---> 01.png ... 0N.png

Example

python main.py --dir <path-to-you-dir> --width 320 --height 240 --fps 30 --extension mp4

Requirements

  • python 3.5
  • ffmpeg

TODO

  • Multiprocessing

About

A short python script to extract frames from video using ffmpeg


Languages

Language:Python 100.0%