convert a video file or multiple video files in a directory into a series of image frames
Project description
mp42frame.py
This Python script, mp42frame.py
, is used to convert a video file or multiple video files in a directory into a series of image frames.
Dependencies
- OpenCV (cv2)
- sys
- os
- glob
Usage
-
For a single video file:
python mp42frame.py <video_file.mp4>
This will create a new directory with the same name as the video file (without the '.mp4' extension) and save the extracted frames as JPEG files in this directory.
-
For multiple video files in a directory:
python mp42frame.py <directory_path>
This will process all '.mp4' files in the specified directory. For each video file, a new directory will be created with the same name as the video file (without the '.mp4' extension) and the extracted frames will be saved as JPEG files in these directories.
Note
- The script will exit if no argument is provided.
- The frames are saved as 'frame_n.jpg', where 'n' is the frame number.
- The script will stop if the 'Escape' key is hit during the frame extraction process.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mp42frame-0.0.10.tar.gz
.
File metadata
- Download URL: mp42frame-0.0.10.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.6.0 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4abd8f475ee61539bc384baecff0800a4ab85782cb8c373615685a45561f5d43 |
|
MD5 | 7c8175678eb8cfa9bbf7b73c4d6e1dd2 |
|
BLAKE2b-256 | 265ba03a9503b1d329534cdfc41d062938de56297fff7374e1fe87318d0e05b7 |
Provenance
File details
Details for the file mp42frame-0.0.10-py3-none-any.whl
.
File metadata
- Download URL: mp42frame-0.0.10-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.6.0 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c1d9c701e897af0d02bd3f4652db32e42b8ab52c023e78e59989cb4727dca7f |
|
MD5 | 034a3574b8bcf92bde849efec3e95749 |
|
BLAKE2b-256 | dc1ce2c31510bc69b3b230813871031d2202dddb35a448df9865872b7d7902d1 |