Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

CoverSnap

A convenient Python library for capturing cover image from video.

codecov CI-test pip-test Release PyPI version GitHub

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)

Development

Environment Setup

Before getting started with development, make sure you have the following tools and dependencies installed:

  • Python 3.8 or higher
  • PDM (Python Development Master)

Installing Development Dependencies

In the project's root directory, run the following command to install the development dependencies:

pdm run dev

Running Tests

pdm run test

This will run the tests and generate test coverage reports. The test results will be displayed in the terminal, and XML and HTML format coverage reports will also be generated.

Code Style Checking and Static Type Checking

pdm run lint

This will run the code style checking and static type checking. The results will be displayed in the terminal.

License

CoverSnap is licensed under the MIT License.

Metadata

Release files for CoverSnap 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CoverSnap 0.0.4
File Size Uploaded
coversnap-0.0.4.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CoverSnap 0.0.4
File Interpreter ABI Platform
coversnap-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / coversnap-0.0.4.tar.gz

Download URL coversnap-0.0.4.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
30f76f275e46c27113b28062cc8bccd58a6165c6bbdd74cc2e1d6fe6d831de3e
BLAKE2b-256 checksum
How to use checksums
10d94543dbf8c73b244ec7ed00cdda3dc3299f2eecfe00d664616c7e9f491782
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / coversnap-0.0.4-py3-none-any.whl

Download URL coversnap-0.0.4-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6507762a15ec27bf5f1e3bea3356badb679412659f37c1062fa902e808165dbf
BLAKE2b-256 checksum
How to use checksums
42a36eca5c63583b88279201d9c231a6d99ecdbf7e7c3422ce000c77d2f6bf57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page