a convenient Python library for capturing cover image from video
Project description
CoverSnap
A convenient Python library for capturing cover image from video.
Installation
You can install CoverSnap using pip (python >= 3.8):
pip install coversnap
CLI
usage: coversnap [-h] -i INPUT -o OUTPUT
Capture image from video and save it to file, return black image if failed
optional arguments:
-h, --help show this help message and exit
-i INPUT, --INPUT INPUT
absolute path to input video
-o OUTPUT, --OUTPUT OUTPUT
absolute path to output image
Python
To capture a cover image from a video, use the capture_image
function provided by the CoverSnap library. Here's an
example of how to use it:
import os
import cv2
from coversnap import capture_image
input_video = "path/to/video.mp4"
output_image = "path/to/output.jpg"
# Capture the cover image from the video
img = capture_image(input_video)
# Save the captured image to the specified file
_, file_extension = os.path.splitext(output_image)
cv2.imencode(file_extension, img)[1].tofile(output_image)
License
CoverSnap is licensed under the MIT License.
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
coversnap-0.0.3.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for coversnap-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 562d3dbbedd942467a7c6ccc41be6dcd269c433466afce103b3eabaf99f0f827 |
|
MD5 | 4f4bc9dd1141d56a7e6d466c70fa4f28 |
|
BLAKE2b-256 | d911e63fc2603a862224b7012a6f6f65be0935481860407f456a66dcc3602e2a |