CLIPR: Clip Improvement, Processing, and Reframing for Python.
Project description
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, and90schunks - 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:
Cfor ClipLfor LifecycleIfor ImprovementPfor ProcessingRfor 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 to3840x2160, and improves audiomake_instagram_reel(...): reframes to a vertical1080x1920canvas, 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 outputinstagram_reel: 1080x1920 portrait canvas that preserves the original frametiktok: 1080x1920 portrait canvas with preserved framing and audio denoisewhatsapp: lighter 720x1280 portrait canvas for sharingpresentation: 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:
- Create the PyPI project
clipr-video. - Configure GitHub trusted publishing on PyPI for this repository.
- Push a git tag and publish a GitHub Release.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
feec277c359b28510c09b9e3beda8eee47fc81ff9347c0bbe33e3a8fda60466e
|
|
| MD5 |
58898859a8b9ce773459ad5e21f6d7f0
|
|
| BLAKE2b-256 |
8ce2ef4bdb35e874e8652dd5bf7550eb89f8283bfa3d3e529c8a484af14064f7
|
Provenance
The following attestation bundles were made for clipr_video-0.1.1.tar.gz:
Publisher:
publish.yml on Meet2147/clipr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clipr_video-0.1.1.tar.gz -
Subject digest:
feec277c359b28510c09b9e3beda8eee47fc81ff9347c0bbe33e3a8fda60466e - Sigstore transparency entry: 1102617872
- Sigstore integration time:
-
Permalink:
Meet2147/clipr@65c3cc50cec79d0c32050c4556c4380ee41e3904 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Meet2147
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@65c3cc50cec79d0c32050c4556c4380ee41e3904 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c78a05b69a23c6a34bc47ce33aecf2dac626e42b0e423af0b28c9d021f51bbb
|
|
| MD5 |
ad265439f4939877501a04bcbc8ebeab
|
|
| BLAKE2b-256 |
799529935f6c505737d18bebfe9db99341f9f47b45f322aba8a8be541ca2d9bd
|
Provenance
The following attestation bundles were made for clipr_video-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on Meet2147/clipr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clipr_video-0.1.1-py3-none-any.whl -
Subject digest:
3c78a05b69a23c6a34bc47ce33aecf2dac626e42b0e423af0b28c9d021f51bbb - Sigstore transparency entry: 1102617879
- Sigstore integration time:
-
Permalink:
Meet2147/clipr@65c3cc50cec79d0c32050c4556c4380ee41e3904 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Meet2147
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@65c3cc50cec79d0c32050c4556c4380ee41e3904 -
Trigger Event:
release
-
Statement type: