Skip to main content

CLIPR: Clip Improvement, Processing, and Reframing for Python.

Project description

CLIPR logo

CLIPR

CLIPR stands for Clip Improvement, Processing, and Reframing.

CLIPR is a Python video-processing library built around local ffmpeg, with a clean API for splitting, enhancing, reframing, and batch-processing videos.

For portrait outputs like Reels and TikTok, CLIPR reframes footage into the target canvas instead of simply rotating the whole source video.

It supports:

  • Splitting one video into 30s, 60s, and 90s chunks
  • Batch processing a whole directory of videos
  • Smart social presets for YouTube, Instagram Reels, TikTok, WhatsApp, and presentations
  • Trim and crop operations
  • Audio enhancement with normalization, denoise, and volume adjustment
  • Orientation changes for portrait, landscape, and rotation modes
  • Progress tracking callbacks and a CLI percentage bar for long-running jobs

Why CLIPR

The name reflects the core workflow:

  • C for Clip
  • L for Lifecycle
  • I for Improvement
  • P for Processing
  • R for Reframing

Installation

Install ffmpeg, then install the package:

pip install -e .

Quick Python Example

from pathlib import Path

from clipr import (
    AudioEnhancementSettings,
    EnhancementSettings,
    ProcessingOptions,
    SocialPreset,
    TrimSettings,
    batch_process_directory,
    make_4k_widescreen,
    make_instagram_reel,
    process_video,
    split_video,
)


def show_progress(percent: float, message: str) -> None:
    print(message)


split_video(
    Path("sample.mp4"),
    segment_lengths=(30, 60, 90),
    output_dir=Path("output/segments"),
    progress_callback=show_progress,
)

process_video(
    Path("sample.mp4"),
    Path("output/reel.mp4"),
    options=ProcessingOptions(
        enhancement=EnhancementSettings(),
        audio=AudioEnhancementSettings(normalize=True, denoise=True),
        trim=TrimSettings(start_time=5, duration=20),
        social_preset=SocialPreset.INSTAGRAM_REEL,
    ),
    progress_callback=show_progress,
)

batch_process_directory(
    Path("sample_videos"),
    Path("output/batch"),
    options=ProcessingOptions(
        enhancement=EnhancementSettings(),
        audio=AudioEnhancementSettings(normalize=True),
        social_preset=SocialPreset.WHATSAPP,
    ),
    progress_callback=show_progress,
)

make_4k_widescreen(
    Path("sample.mp4"),
    Path("output/movie_4k.mp4"),
    progress_callback=show_progress,
)

make_instagram_reel(
    Path("sample.mp4"),
    Path("output/reel_ready.mp4"),
    progress_callback=show_progress,
)

There is also a runnable example in examples/example_usage.py.

Convenience Helpers

  • make_4k_widescreen(...): crops to widescreen, enhances video, upscales to 3840x2160, and improves audio
  • make_instagram_reel(...): reframes to a vertical 1080x1920 canvas, enhances audio/video, and applies Reel-friendly defaults

CLI

Split video

clipr split sample.mp4 --durations 30 60 90 --output-dir output --show-progress

Full single-video processing

clipr process sample.mp4 output/reel.mp4 \
  --social-preset instagram_reel \
  --start-time 5 \
  --duration 20 \
  --audio-denoise \
  --show-progress

Batch processing

clipr batch sample_videos output/batch \
  --social-preset whatsapp \
  --duration 30 \
  --show-progress

When --show-progress is enabled, CLIPR prints a live percentage bar in the terminal while ffmpeg is processing.

Social Presets

  • youtube: 1920x1080 landscape output
  • instagram_reel: 1080x1920 portrait canvas that preserves the original frame
  • tiktok: 1080x1920 portrait canvas with preserved framing and audio denoise
  • whatsapp: lighter 720x1280 portrait canvas for sharing
  • presentation: 1920x1080 landscape output with slightly boosted audio

Example File To Test

After install, place a sample video as sample.mp4 in the project root and optionally add more videos in sample_videos/.

Run:

PYTHONPATH=src python3 examples/example_usage.py

Development

PYTHONPATH=src python3 -m unittest discover -s tests

Publishing

PyPI release settings live in publish.toml.

The repository includes .github/workflows/publish.yml, which builds and publishes the package to PyPI when you publish a GitHub Release.

Before the first release:

  1. Create the PyPI project clipr-video.
  2. Configure GitHub trusted publishing on PyPI for this repository.
  3. Push a git tag and publish a GitHub Release.

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

clipr_video-0.1.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clipr_video-0.1.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file clipr_video-0.1.1.tar.gz.

File metadata

  • Download URL: clipr_video-0.1.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for clipr_video-0.1.1.tar.gz
Algorithm Hash digest
SHA256 feec277c359b28510c09b9e3beda8eee47fc81ff9347c0bbe33e3a8fda60466e
MD5 58898859a8b9ce773459ad5e21f6d7f0
BLAKE2b-256 8ce2ef4bdb35e874e8652dd5bf7550eb89f8283bfa3d3e529c8a484af14064f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipr_video-0.1.1.tar.gz:

Publisher: publish.yml on Meet2147/clipr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clipr_video-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: clipr_video-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for clipr_video-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3c78a05b69a23c6a34bc47ce33aecf2dac626e42b0e423af0b28c9d021f51bbb
MD5 ad265439f4939877501a04bcbc8ebeab
BLAKE2b-256 799529935f6c505737d18bebfe9db99341f9f47b45f322aba8a8be541ca2d9bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for clipr_video-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Meet2147/clipr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page