https://github.com/crypticsignal/i-frames-saver
Takes a video file as input and saves the keyframes (or all I-frames) as PNG files.
https://github.com/crypticsignal/i-frames-saver
ffmpeg ffprobe frames i-frames idr keyframes png video
Last synced: 4 months ago
JSON representation
Takes a video file as input and saves the keyframes (or all I-frames) as PNG files.
- Host: GitHub
- URL: https://github.com/crypticsignal/i-frames-saver
- Owner: CrypticSignal
- License: mit
- Created: 2021-03-08T20:35:32.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-09-28T20:56:25.000Z (over 3 years ago)
- Last Synced: 2025-01-10T20:45:16.506Z (6 months ago)
- Topics: ffmpeg, ffprobe, frames, i-frames, idr, keyframes, png, video
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# I-frames-saver
A command-line program that takes a video file as input and saves the I-frames (or keyframes only by using the `-k` argument) as PNG files.Using this program is very simple, simply specify the path of the video using the `-f` argument, e.g. `python3 main.py -f video.mp4`. Include the `-k` argument if you are only interested in keyframes, e.g. `python3 main.py -f video.mp4 -k`
*Note: with H.264, "keyframes" refers to Instantaneous Decoder Refresh (IDR) frames, which is a special type of I-frame. Where there is an IDR frame, subsequent frames cannot reference any frames before the IDR frame. Because of this, video segments that begin with an IDR frame can be independently decoded.*
# Usage
```
usage: main.py [-h] -f FILE_PATH [-k]optional arguments:
-h, --help show this help message and exit
-f FILE_PATH, --file-path FILE_PATH
Enter the path of the file that you want to analyse.
If the path contains a space, it must be surrounded in double quotes.
Example: -f "C:/Users/H/Desktop/my file.mp4"
-k, --key-frames-only
Only process keyframes.
```