This CLI program extracts frames throughout a video length.
CLI application to extract frames from all videos within a specific directory A
, saving them as png images within a root directory B
following the same folder structure.
By calling the CLI application you will define the root directory for all videos, A
, and the root directory for all frames to be saved, B
. The same folder structure WILL be created within directory B
if it is different from A
-i
or--input_dir
:- Root directory for video searching.
-o
or--output-dir
:- Root directory for frame saving.
-n
or--frames
:- Frame rate or number of frames to be taken from the video:
- Int: Number of frames to be taken.
- Float: Frame rate in which a frame will be taken.
- Frame rate or number of frames to be taken from the video:
-e
or--extension
:- Extension of the video to be searched.
- Default: MP4
- Extension of the video to be searched.
$ python main.py -i ./videos -o ./frames -n 10 -e MP4
All requirements are in the requirements.txt
file. From pip, just run in the terminal the following command and you are ready to go.
$ pip install -r requirements.txt
Python>=3.8
OpenCV>=4.5