Utility to extract frames out of a video
Project description
Videosplit is a utility to extract frames from a given video.
It can extract:
- n number of frames (equally spaced throughout the video)
- relevant* frames
- frames separated by t seconds
Example usage:
```
from videosplit import VideoSplit
videosplit = VideoSplit()
frames = videosplit.get_relevant('input.mp4') # frames = [input01.jpg, input02.jpg, ...]
frames = videsplit.get_n_frames('input.mp4', 10) # frames = [input01.jpg,..., input10.jpg]
frames = videosplit.get_interval('input.mp4', 10) # one frame every 10 seconds
```
Note:
The filenames of the jpg files are based on the name of the video file. Therefore, if you call more than one call on the same file, the jpg files may be overwritten. To solve this, specify an output name:
```
frames = videosplit.get_relevant("input.mp4", "tmp") # frames = [tmp01.jpg,...]
```
*Currently, relevant frames are ex``tracted by finding the I-frames of the video (https://www.webopedia.com/TERM/I/I_frame.html). Frames could be extracted based on "scene-changes" but testing showed that it did not return relevant results (one frame out of a 9 minute video for example).
It can extract:
- n number of frames (equally spaced throughout the video)
- relevant* frames
- frames separated by t seconds
Example usage:
```
from videosplit import VideoSplit
videosplit = VideoSplit()
frames = videosplit.get_relevant('input.mp4') # frames = [input01.jpg, input02.jpg, ...]
frames = videsplit.get_n_frames('input.mp4', 10) # frames = [input01.jpg,..., input10.jpg]
frames = videosplit.get_interval('input.mp4', 10) # one frame every 10 seconds
```
Note:
The filenames of the jpg files are based on the name of the video file. Therefore, if you call more than one call on the same file, the jpg files may be overwritten. To solve this, specify an output name:
```
frames = videosplit.get_relevant("input.mp4", "tmp") # frames = [tmp01.jpg,...]
```
*Currently, relevant frames are ex``tracted by finding the I-frames of the video (https://www.webopedia.com/TERM/I/I_frame.html). Frames could be extracted based on "scene-changes" but testing showed that it did not return relevant results (one frame out of a 9 minute video for example).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
videosplit-0.4.1.tar.gz
(3.4 kB
view hashes)
Built Distribution
Close
Hashes for videosplit-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ccad08530adb03eaa5a301348cce102f75e9c679b81a631e32bbf0c039e1d57 |
|
MD5 | de1930cf415c0a11177c6cee7ded6c2f |
|
BLAKE2b-256 | d1efc1e3f37b480d801d385b5958b4eb1332ee8c654914686b4ea7c083fa7a39 |