Skip to main content

Pixtract

Pixtract is a powerful and efficient command-line tool designed to extract high-quality frames from videos. It streamlines the process of obtaining sharp, non-duplicate images from your video files, making it ideal for computer vision datasets, video analysis, or simply capturing the best moments from your recordings.

Features

  • High-Quality Frame Extraction: Extracts frames from a variety of video formats (MP4, MOV, AVI, MKV).
  • Blur Detection: Automatically analyzes and discards blurry frames, ensuring you only get sharp, clear images.
  • Duplicate Frame Removal: Efficiently identifies and removes duplicate or near-duplicate frames based on a configurable threshold, saving you time and disk space.
  • Image Rotation: Corrects the orientation of frames with adjustable rotation.
  • Batch Processing: Process multiple videos in a single run, from a given directory.
  • Dry Run Mode: Simulate the process without creating or deleting any files.
  • Verbose Output: Get detailed logging information for debugging or deeper insights.

Installation

You can install Pixtract directly from GitHub using Git:

pip install git+https://github.com/rahaaatul/Pixtract.git

or from PyPI using pip:

pip install pixtract

Or with pipx for isolated installation:

pipx install pixtract

Usage

To use Pixtract, simply run the pixtract command with the path to your video file or a directory containing videos.

Basic Usage

Process a single video and save frames to a default output folder:

pixtract "path/to/your/video.mp4"

Process all videos in a directory and save frames to a specified output folder:

pixtract "path/to/your/videos_directory" -o "path/to/your/output_folder"

Examples

Extract frames from my_movie.mp4, remove blurry frames (sharpness threshold 50), and remove duplicates (threshold 0.98):

pixtract my_movie.mp4 -s 50 -d 0.98

Process videos in my_videos/, rotate frames by 90 degrees, and enable verbose output:

pixtract my_videos/ -r 90 -v

Simulate processing holiday_clip.mp4 without actually saving or deleting files:

pixtract holiday_clip.mp4 --dry-run

Command-Line Options

Option Short Type Default Description
--input-path str Current Dir Path to a video file or a directory containing videos.
--output -o str Processed_Frames Path to the output directory.
--sharpness -s int 100 Set the sharpness threshold for blur detection. Lower values are more permissive.
--duplicate -d float 1 Set the threshold for duplicate detection. Higher values are more strict.
--rotate -r int 0 Rotate frames by 0, 90, 180, or 270 degrees.
--dry-run flag False Simulate the process without creating or deleting files.
--limit -l int None Limit the number of videos to process.
--verbose -v flag False Enable verbose (debug) output.

Development

To set up the project for development, clone the repository and install the development dependencies:

git clone https://github.com/rahaaatul/pixtract.git
cd pixtract
pip install -e .[dev]

Running Tests

To run the test suite, ensure you have installed the development dependencies and then execute pytest:

pip install -e .[dev]
pytest

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request. For bug reports, please use the Bug Report template. For new features, use the Feature Request template.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for pixtract 0.1.0

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

Source distribution (sdist)

Source distribution for pixtract 0.1.0
File Size Uploaded
pixtract-0.1.0.tar.gz 12.5 kB Details

Built distribution (wheel)

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

Total release size: 23.9 kB

Release files / pixtract-0.1.0.tar.gz

Download URL pixtract-0.1.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b8eb305e8213f4ceb5cbb6ca63808da82453523d7132ff83712daed53b75a4ba
BLAKE2b-256 checksum
How to use checksums
e858189bc8ea3c5d681f4370f0ecb94a383a4c7163c12ac0a9f726e6ef814b3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2025.

Transparency log

Release files / pixtract-0.1.0-py3-none-any.whl

Download URL pixtract-0.1.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd3dec918f5347b9971ddfe7c5fb099157878f8cfe2575b09404329efc941c4a
BLAKE2b-256 checksum
How to use checksums
1856eb816c7bc64bca4077e756ddd842ad70943eeee2d9f58fefcf342f8dbeb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 18, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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