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
The name reflects the core workflow:
Cfor ClipLfor LifecycleIfor ImprovementPfor ProcessingRfor Reframing
Install ffmpeg, then install the package:
pip install -e .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.
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
clipr split sample.mp4 --durations 30 60 90 --output-dir output --show-progressclipr process sample.mp4 output/reel.mp4 \
--social-preset instagram_reel \
--start-time 5 \
--duration 20 \
--audio-denoise \
--show-progressclipr batch sample_videos output/batch \
--social-preset whatsapp \
--duration 30 \
--show-progressWhen --show-progress is enabled, CLIPR prints a live percentage bar in the terminal while ffmpeg is processing.
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
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.pyPYTHONPATH=src python3 -m unittest discover -s testsPyPI 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.
